From 923206ee4cd8c6a86ee6ace71ee6456fcc213f32 Mon Sep 17 00:00:00 2001 From: Anton Gunnarsson Date: Fri, 4 Jul 2025 06:22:28 +0000 Subject: [PATCH] Merged in chore/sw-3145-move-subtitle (pull request #2516) chore(SW-3145): Move Title and Subtitle to design-system * Move Title and Subtitle to design-system * Fix export Approved-by: Linus Flood --- .../DynamicContent/HowItWorks/index.tsx | 3 +- .../JobylonFeed/JobList/index.tsx | 2 +- .../JobylonFeed/JobylonCard/index.tsx | 2 +- .../DynamicContent/LoyaltyLevels/index.tsx | 2 +- .../DynamicContent/Overview/Friend/index.tsx | 2 +- .../Stats/Points/PointsColumn/index.tsx | 2 +- .../OverviewTable/LargeTable/index.tsx | 3 +- .../OverviewTable/RewardList/Card/index.tsx | 2 +- .../Rewards/CurrentRewards/Client.tsx | 2 +- .../Rewards/NextLevel/index.tsx | 2 +- .../Rewards/Redeem/ConfirmClose.tsx | 2 +- .../Rewards/Redeem/Flows/Campaign.tsx | 2 +- .../Rewards/Redeem/Flows/Tier.tsx | 2 +- .../Stays/EmptyUpcomingStays/index.tsx | 2 +- .../DynamicContent/Stays/StayCard/index.tsx | 2 +- .../Blocks/FullWidthCampaign/index.tsx | 2 +- .../components/Blocks/TextCols/index.tsx | 3 +- .../components/ContentCard/index.tsx | 2 +- .../CityListing/CityListingItem/index.tsx | 2 +- .../CountryMap/CityListItem/index.tsx | 3 +- .../HotelsSection/index.tsx | 3 +- .../HotelPage/Map/MapCard/index.tsx | 2 +- .../ContactInformation/index.tsx | 4 +- .../MeetingsAndConferences/index.tsx | 4 +- .../ContentType/LoyaltyPage/index.tsx | 2 +- .../ContentType/StartPage/index.tsx | 2 +- .../components/Countdown/index.tsx | 3 +- .../Header/MyPagesMobileDropdown/index.tsx | 2 +- .../components/DatePicker/Single/Desktop.tsx | 2 +- .../components/DatePicker/Single/Mobile.tsx | 2 +- .../DeprecatedJsonToHtml/renderOptions.tsx | 4 +- .../DestinationFilterAndSort/Filter/index.tsx | 6 +- .../DestinationFilterAndSort/index.tsx | 2 +- apps/scandic-web/components/Dialog/index.tsx | 2 +- .../components/Forms/Edit/Profile/index.tsx | 2 +- .../GuestsRoomsPicker/GuestsRoom/index.tsx | 2 +- .../MainMenu/MyPagesMenuContent/index.tsx | 2 +- .../NavigationMenu/MegaMenu/index.tsx | 2 +- .../BookingConfirmation/Header/index.tsx | 3 +- .../HotelDetails/index.tsx | 2 +- .../PaymentDetails/index.tsx | 3 +- .../Promos/Promo/index.tsx | 2 +- .../Details/MemberPriceModal/index.tsx | 4 +- .../EnterDetails/Header/index.tsx | 2 +- .../PaymentCallback/TimeoutSpinner/index.tsx | 2 +- .../PriceChangeSummary/index.tsx | 2 +- .../EnterDetails/PriceChangeDialog/index.tsx | 4 +- .../EnterDetails/Room/Multiroom.tsx | 2 +- .../EnterDetails/Room/One.tsx | 2 +- .../EnterDetails/SelectedRoom/index.tsx | 2 +- .../EnterDetails/Summary/UI/index.tsx | 2 +- .../FindMyBooking/AdditionalInfoForm.tsx | 2 +- .../HotelReservation/FindMyBooking/index.tsx | 2 +- .../HotelCard/HotelChequeCard/index.tsx | 3 +- .../HotelCard/HotelPointsRow/index.tsx | 3 +- .../HotelCard/HotelPriceCard/index.tsx | 3 +- .../HotelCard/HotelVoucherCard/index.tsx | 3 +- .../ListingHotelCardDialog/index.tsx | 2 +- .../StandaloneHotelCardDialog/index.tsx | 2 +- .../Ancillaries/AddedAncillaries/index.tsx | 2 +- .../MyStay/Ancillaries/index.tsx | 2 +- .../HotelReservation/MyStay/Header/index.tsx | 3 +- .../Modal/ModalContent/Header/index.tsx | 3 +- .../ReferenceCard/PriceContainer/index.tsx | 3 +- .../Filters/FilterAndSortModal/index.tsx | 2 +- .../Filters/FilterContent/index.tsx | 3 +- .../HotelReservation/SelectHotel/index.tsx | 2 +- .../RateSummary/MobileSummary/Summary.tsx | 2 +- .../RoomsContainer/RateSummary/index.tsx | 2 +- .../SelectedRoomPanel/index.tsx | 2 +- .../Rooms/MultiRoomWrapper/index.tsx | 2 +- .../LanguageSwitcherContainer/index.tsx | 3 +- .../LanguageSwitcherContent/index.tsx | 2 +- .../Modal/ModalContentWithActions/index.tsx | 2 +- apps/scandic-web/components/Modal/index.tsx | 3 +- .../components/SasTierComparison/index.tsx | 4 +- .../components/Section/Header/index.tsx | 5 +- .../Sidebar/JoinLoyalty/Contact/index.tsx | 2 +- .../Sidebar/JoinLoyalty/ReadMore/index.tsx | 2 +- .../components/Sidebar/JoinLoyalty/index.tsx | 2 +- .../Accordion/AccordionItem/index.tsx | 2 +- .../TempDesignSystem/Card/index.tsx | 2 +- .../components/TempDesignSystem/Card/utils.ts | 7 +-- .../TempDesignSystem/LoyaltyCard/index.tsx | 2 +- .../MeetingRoomCard/index.tsx | 2 +- .../TempDesignSystem/TeaserCard/index.tsx | 2 +- .../TempDesignSystem/Text/Subtitle/index.tsx | 29 --------- .../Text/Subtitle/subtitle.ts | 9 --- .../TempDesignSystem/Text/Title/index.tsx | 39 ------------ .../TempDesignSystem/Text/Title/title.ts | 12 ---- .../utils/checkForEmptyChildren.ts | 13 ---- .../components/Webviews/LoyaltyPage/index.tsx | 3 +- .../lib/components/Subtitle/index.tsx | 50 +++++++++++++++ .../components}/Subtitle/subtitle.module.css | 0 .../lib/components}/Subtitle/variants.ts | 12 ++-- .../lib/components/Title/index.tsx | 63 +++++++++++++++++++ .../lib/components}/Title/title.module.css | 0 .../lib/components}/Title/variants.ts | 12 ++-- packages/design-system/package.json | 2 + 99 files changed, 231 insertions(+), 227 deletions(-) delete mode 100644 apps/scandic-web/components/TempDesignSystem/Text/Subtitle/index.tsx delete mode 100644 apps/scandic-web/components/TempDesignSystem/Text/Subtitle/subtitle.ts delete mode 100644 apps/scandic-web/components/TempDesignSystem/Text/Title/index.tsx delete mode 100644 apps/scandic-web/components/TempDesignSystem/Text/Title/title.ts delete mode 100644 apps/scandic-web/components/TempDesignSystem/utils/checkForEmptyChildren.ts create mode 100644 packages/design-system/lib/components/Subtitle/index.tsx rename {apps/scandic-web/components/TempDesignSystem/Text => packages/design-system/lib/components}/Subtitle/subtitle.module.css (100%) rename {apps/scandic-web/components/TempDesignSystem/Text => packages/design-system/lib/components}/Subtitle/variants.ts (82%) create mode 100644 packages/design-system/lib/components/Title/index.tsx rename {apps/scandic-web/components/TempDesignSystem/Text => packages/design-system/lib/components}/Title/title.module.css (100%) rename {apps/scandic-web/components/TempDesignSystem/Text => packages/design-system/lib/components}/Title/variants.ts (83%) diff --git a/apps/scandic-web/components/Blocks/DynamicContent/HowItWorks/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/HowItWorks/index.tsx index 47884e0b4..d25a37d05 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/HowItWorks/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/HowItWorks/index.tsx @@ -1,4 +1,5 @@ -import Title from "@/components/TempDesignSystem/Text/Title" +import Title from "@scandic-hotels/design-system/Title" + import { getIntl } from "@/i18n" import SectionWrapper from "../SectionWrapper" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobList/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobList/index.tsx index 38ab0f384..5b9dd2252 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobList/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobList/index.tsx @@ -3,7 +3,7 @@ import { useReducer } from "react" import { useIntl } from "react-intl" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import JobylonCard from "../JobylonCard" import Filter from "./Filter" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobylonCard/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobylonCard/index.tsx index dc5c85fe7..ecc875e80 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobylonCard/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/JobylonFeed/JobylonCard/index.tsx @@ -5,9 +5,9 @@ import { useIntl } from "react-intl" import { dt } from "@scandic-hotels/common/dt" import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import styles from "./jobylonCard.module.css" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx index bd5bb0415..6479eff9a 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/LoyaltyLevels/index.tsx @@ -1,11 +1,11 @@ import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Title from "@scandic-hotels/design-system/Title" import { serverClient } from "@/lib/trpc/server" import MembershipLevelIcon from "@/components/Levels/Icon" import BiroScript from "@/components/TempDesignSystem/Text/BiroScript" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import SectionWrapper from "../SectionWrapper" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Overview/Friend/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Overview/Friend/index.tsx index 08dcbbb80..1e84dfa37 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Overview/Friend/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Overview/Friend/index.tsx @@ -1,10 +1,10 @@ import { MembershipLevelEnum } from "@scandic-hotels/common/constants/membershipLevels" import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" import { membershipLevels } from "@/constants/membershipLevels" import MembershipLevelIcon from "@/components/Levels/Icon" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import { isHighestMembership } from "@/utils/user" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Overview/Stats/Points/PointsColumn/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Overview/Stats/Points/PointsColumn/index.tsx index d98cabcab..8dd2f83ec 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Overview/Stats/Points/PointsColumn/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Overview/Stats/Points/PointsColumn/index.tsx @@ -1,6 +1,6 @@ import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import styles from "./pointsColumn.module.css" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx index aa9d320cd..a48a34b42 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/LargeTable/index.tsx @@ -1,6 +1,7 @@ import { ChevronDown } from "react-feather" -import Title from "@/components/TempDesignSystem/Text/Title" +import Title from "@scandic-hotels/design-system/Title" + import { findAvailableRewards, getGroupedLabelAndDescription, diff --git a/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/RewardList/Card/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/RewardList/Card/index.tsx index 4a49abd04..2ee73ae56 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/RewardList/Card/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/OverviewTable/RewardList/Card/index.tsx @@ -1,6 +1,6 @@ import { ChevronDown } from "react-feather" -import Title from "@/components/TempDesignSystem/Text/Title" +import Title from "@scandic-hotels/design-system/Title" import RewardValue from "../../RewardValue" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/CurrentRewards/Client.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/CurrentRewards/Client.tsx index dee59fd7b..cffb38ba7 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/CurrentRewards/Client.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/CurrentRewards/Client.tsx @@ -2,6 +2,7 @@ import { useRef, useState } from "react" +import Title from "@scandic-hotels/design-system/Title" import { trpc } from "@scandic-hotels/trpc/client" import { type Reward } from "@scandic-hotels/trpc/types/rewards" @@ -12,7 +13,6 @@ import ScriptedRewardText from "@/components/Blocks/DynamicContent/Rewards/Scrip import Pagination from "@/components/MyPages/Pagination" import ExpirationDate from "@/components/Rewards/ExpirationDate" import Grids from "@/components/TempDesignSystem/Grids" -import Title from "@/components/TempDesignSystem/Text/Title" import useLang from "@/hooks/useLang" import { getEarliestExpirationDate } from "@/utils/rewards" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/NextLevel/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/NextLevel/index.tsx index 0d26e3623..d4895fe3f 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/NextLevel/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/NextLevel/index.tsx @@ -2,6 +2,7 @@ import { Lock } from "react-feather" import { MembershipLevelEnum } from "@scandic-hotels/common/constants/membershipLevels" import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" import { getMembershipLevel } from "@/lib/trpc/memoizedRequests" import { serverClient } from "@/lib/trpc/server" @@ -11,7 +12,6 @@ import SectionHeader from "@/components/Section/Header" import SectionLink from "@/components/Section/Link" import Chip from "@/components/TempDesignSystem/Chip" import Grids from "@/components/TempDesignSystem/Grids" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import styles from "./next.module.css" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/ConfirmClose.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/ConfirmClose.tsx index 243107239..961626ff5 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/ConfirmClose.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/ConfirmClose.tsx @@ -1,9 +1,9 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" import Button from "@/components/TempDesignSystem/Button" -import Title from "@/components/TempDesignSystem/Text/Title" import useRedeemFlow from "./useRedeemFlow" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Campaign.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Campaign.tsx index 1f260d084..aea5a8eef 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Campaign.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Campaign.tsx @@ -5,9 +5,9 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Title from "@scandic-hotels/design-system/Title" import Button from "@/components/TempDesignSystem/Button" -import Title from "@/components/TempDesignSystem/Text/Title" import { toast } from "@/components/TempDesignSystem/Toasts" import { RewardIcon } from "../../RewardIcon" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Tier.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Tier.tsx index 8b3cf2b38..3ab09d385 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Tier.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Rewards/Redeem/Flows/Tier.tsx @@ -3,10 +3,10 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" import JsonToHtml from "@/components/JsonToHtml" import Button from "@/components/TempDesignSystem/Button" -import Title from "@/components/TempDesignSystem/Text/Title" import { isRestaurantOnSiteTierReward } from "@/utils/rewards" import { RewardIcon } from "../../RewardIcon" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/EmptyUpcomingStays/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/EmptyUpcomingStays/index.tsx index 4be2c43d3..8805be5d6 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/EmptyUpcomingStays/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/EmptyUpcomingStays/index.tsx @@ -1,7 +1,7 @@ import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Title from "@scandic-hotels/design-system/Title" import Link from "@/components/TempDesignSystem/Link" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" diff --git a/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx b/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx index 91d544f1c..554fd90c8 100644 --- a/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx +++ b/apps/scandic-web/components/Blocks/DynamicContent/Stays/StayCard/index.tsx @@ -3,10 +3,10 @@ import { dt } from "@scandic-hotels/common/dt" import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Title from "@scandic-hotels/design-system/Title" import Image from "@/components/Image" import Link from "@/components/TempDesignSystem/Link" -import Title from "@/components/TempDesignSystem/Text/Title" import useLang from "@/hooks/useLang" import styles from "./stay.module.css" diff --git a/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx b/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx index d41b24643..d658adb91 100644 --- a/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx +++ b/apps/scandic-web/components/Blocks/FullWidthCampaign/index.tsx @@ -1,10 +1,10 @@ import Preamble from "@scandic-hotels/design-system/Preamble" +import Title from "@scandic-hotels/design-system/Title" import Image from "@/components/Image" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" import BiroScript from "@/components/TempDesignSystem/Text/BiroScript" -import Title from "@/components/TempDesignSystem/Text/Title" import styles from "./fullWidthCampaign.module.css" diff --git a/apps/scandic-web/components/Blocks/TextCols/index.tsx b/apps/scandic-web/components/Blocks/TextCols/index.tsx index cb878943b..22ca66fd7 100644 --- a/apps/scandic-web/components/Blocks/TextCols/index.tsx +++ b/apps/scandic-web/components/Blocks/TextCols/index.tsx @@ -1,5 +1,6 @@ +import Subtitle from "@scandic-hotels/design-system/Subtitle" + import JsonToHtml from "@/components/JsonToHtml" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { renderOptions } from "./renderOptions" diff --git a/apps/scandic-web/components/ContentCard/index.tsx b/apps/scandic-web/components/ContentCard/index.tsx index 6bce5a56d..95bc3cd81 100644 --- a/apps/scandic-web/components/ContentCard/index.tsx +++ b/apps/scandic-web/components/ContentCard/index.tsx @@ -1,9 +1,9 @@ import Body from "@scandic-hotels/design-system/Body" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Image from "@/components/Image" import Chip from "@/components/TempDesignSystem/Chip" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./contentCard.module.css" diff --git a/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx index 7fa65706d..4b3c748b5 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/CityListing/CityListingItem/index.tsx @@ -5,10 +5,10 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import { Divider } from "@scandic-hotels/design-system/Divider" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import ImageGallery from "@/components/ImageGallery" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { mapImageVaultImagesToGalleryImages } from "@/utils/imageGallery" import ExperienceList from "../../ExperienceList" diff --git a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx index e3a4b3714..c2320288c 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/DestinationCountryPage/CountryMap/CityListItem/index.tsx @@ -3,9 +3,10 @@ import Link from "next/link" import { useIntl } from "react-intl" +import Subtitle from "@scandic-hotels/design-system/Subtitle" + import ImageGallery from "@/components/ImageGallery" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { mapImageVaultImagesToGalleryImages } from "@/utils/imageGallery" import ExperienceList from "../../../ExperienceList" diff --git a/apps/scandic-web/components/ContentType/DestinationPage/DestinationOverviewPage/HotelsSection/index.tsx b/apps/scandic-web/components/ContentType/DestinationPage/DestinationOverviewPage/HotelsSection/index.tsx index 3d7afb0fb..8a9ce28a0 100644 --- a/apps/scandic-web/components/ContentType/DestinationPage/DestinationOverviewPage/HotelsSection/index.tsx +++ b/apps/scandic-web/components/ContentType/DestinationPage/DestinationOverviewPage/HotelsSection/index.tsx @@ -1,6 +1,7 @@ +import Title from "@scandic-hotels/design-system/Title" + import { getDestinationsList } from "@/lib/trpc/memoizedRequests" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import { DestinationsList } from "./DestinationsList" diff --git a/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/index.tsx index b7b81a355..3173fd864 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/Map/MapCard/index.tsx @@ -7,10 +7,10 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" +import Title from "@scandic-hotels/design-system/Title" import PoiMarker from "@/components/Maps/Markers/Poi" import Button from "@/components/TempDesignSystem/Button" -import Title from "@/components/TempDesignSystem/Text/Title" import { trackHotelMapClick } from "@/utils/tracking" import styles from "./mapCard.module.css" diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/index.tsx index eef8363d2..443eb9d8c 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/AboutTheHotel/ContactInformation/index.tsx @@ -2,12 +2,12 @@ import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import FacebookIcon from "@scandic-hotels/design-system/Icons/FacebookIcon" import InstagramIcon from "@scandic-hotels/design-system/Icons/InstagramIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" +import Title from "@scandic-hotels/design-system/Title" import { Country } from "@scandic-hotels/trpc/types/country" import Image from "@/components/Image" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" diff --git a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/MeetingsAndConferences/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/MeetingsAndConferences/index.tsx index 4578291c2..244c481f4 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/MeetingsAndConferences/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/SidePeeks/MeetingsAndConferences/index.tsx @@ -1,9 +1,9 @@ import Body from "@scandic-hotels/design-system/Body" +import Subtitle from "@scandic-hotels/design-system/Subtitle" +import Title from "@scandic-hotels/design-system/Title" import ButtonLink from "@/components/ButtonLink" import SidePeek from "@/components/TempDesignSystem/SidePeek" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import { appendSlugToPathname } from "@/utils/appendSlugToPathname" diff --git a/apps/scandic-web/components/ContentType/LoyaltyPage/index.tsx b/apps/scandic-web/components/ContentType/LoyaltyPage/index.tsx index d4e8bf0be..7fe392b85 100644 --- a/apps/scandic-web/components/ContentType/LoyaltyPage/index.tsx +++ b/apps/scandic-web/components/ContentType/LoyaltyPage/index.tsx @@ -2,6 +2,7 @@ import { cx } from "class-variance-authority" import { Suspense } from "react" import Preamble from "@scandic-hotels/design-system/Preamble" +import Title from "@scandic-hotels/design-system/Title" import { serverClient } from "@/lib/trpc/server" @@ -10,7 +11,6 @@ import Hero from "@/components/Hero" import MaxWidth from "@/components/MaxWidth" import Sidebar from "@/components/Sidebar" import SidebarSkeleton from "@/components/Sidebar/SidebarSkeleton" -import Title from "@/components/TempDesignSystem/Text/Title" import TrackingSDK from "@/components/TrackingSDK" import { isLoggedInUser } from "@/utils/isLoggedInUser" diff --git a/apps/scandic-web/components/ContentType/StartPage/index.tsx b/apps/scandic-web/components/ContentType/StartPage/index.tsx index b83174bf6..5b375f696 100644 --- a/apps/scandic-web/components/ContentType/StartPage/index.tsx +++ b/apps/scandic-web/components/ContentType/StartPage/index.tsx @@ -1,3 +1,4 @@ +import Title from "@scandic-hotels/design-system/Title" import { BlocksEnums } from "@scandic-hotels/trpc/types/blocks" import { getStartPage } from "@/lib/trpc/memoizedRequests" @@ -6,7 +7,6 @@ import Blocks from "@/components/Blocks" import FullWidthCampaign from "@/components/Blocks/FullWidthCampaign" import { FloatingBookingWidget } from "@/components/BookingWidget/FloatingBookingWidget" import Image from "@/components/Image" -import Title from "@/components/TempDesignSystem/Text/Title" import TrackingSDK from "@/components/TrackingSDK" import styles from "./startPage.module.css" diff --git a/apps/scandic-web/components/Countdown/index.tsx b/apps/scandic-web/components/Countdown/index.tsx index 6669c49de..f3564e1fe 100644 --- a/apps/scandic-web/components/Countdown/index.tsx +++ b/apps/scandic-web/components/Countdown/index.tsx @@ -4,8 +4,7 @@ import { useState } from "react" import { useInterval } from "usehooks-ts" import { dt } from "@scandic-hotels/common/dt" - -import Title from "@/components/TempDesignSystem/Text/Title" +import Title from "@scandic-hotels/design-system/Title" import type { CountdownProps } from "@/types/components/countdown" diff --git a/apps/scandic-web/components/Current/Header/MyPagesMobileDropdown/index.tsx b/apps/scandic-web/components/Current/Header/MyPagesMobileDropdown/index.tsx index ea578e51e..d43401dee 100644 --- a/apps/scandic-web/components/Current/Header/MyPagesMobileDropdown/index.tsx +++ b/apps/scandic-web/components/Current/Header/MyPagesMobileDropdown/index.tsx @@ -4,13 +4,13 @@ import { useIntl } from "react-intl" import { Divider } from "@scandic-hotels/design-system/Divider" import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" +import Title from "@scandic-hotels/design-system/Title" import { logout } from "@/constants/routes/handleAuth" import useDropdownStore from "@/stores/main-menu" import { useMyPagesNavigation } from "@/components/Header/MainMenu/MyPagesMenuContent" import Link from "@/components/TempDesignSystem/Link" -import Title from "@/components/TempDesignSystem/Text/Title" import useLang from "@/hooks/useLang" import styles from "./my-pages-mobile-dropdown.module.css" diff --git a/apps/scandic-web/components/DatePicker/Single/Desktop.tsx b/apps/scandic-web/components/DatePicker/Single/Desktop.tsx index ea8cb107e..9526ddb03 100644 --- a/apps/scandic-web/components/DatePicker/Single/Desktop.tsx +++ b/apps/scandic-web/components/DatePicker/Single/Desktop.tsx @@ -9,9 +9,9 @@ import { dt } from "@scandic-hotels/common/dt" import Caption from "@scandic-hotels/design-system/Caption" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { locales } from "../locales" diff --git a/apps/scandic-web/components/DatePicker/Single/Mobile.tsx b/apps/scandic-web/components/DatePicker/Single/Mobile.tsx index a33333c25..8dff89704 100644 --- a/apps/scandic-web/components/DatePicker/Single/Mobile.tsx +++ b/apps/scandic-web/components/DatePicker/Single/Mobile.tsx @@ -5,9 +5,9 @@ import { useIntl } from "react-intl" import { Lang } from "@scandic-hotels/common/constants/language" import { dt } from "@scandic-hotels/common/dt" import Body from "@scandic-hotels/design-system/Body" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { locales } from "../locales" diff --git a/apps/scandic-web/components/DeprecatedJsonToHtml/renderOptions.tsx b/apps/scandic-web/components/DeprecatedJsonToHtml/renderOptions.tsx index 8f43da2f0..2330bfb9c 100644 --- a/apps/scandic-web/components/DeprecatedJsonToHtml/renderOptions.tsx +++ b/apps/scandic-web/components/DeprecatedJsonToHtml/renderOptions.tsx @@ -3,6 +3,8 @@ import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { Divider } from "@scandic-hotels/design-system/Divider" import Footnote from "@scandic-hotels/design-system/Footnote" +import Subtitle from "@scandic-hotels/design-system/Subtitle" +import Title from "@scandic-hotels/design-system/Title" import { AvailableParagraphFormatEnum, RTEItemTypeEnum, @@ -16,8 +18,6 @@ import Link from "@/components/TempDesignSystem/Link" import ImageContainer from "../ImageContainer" import Table from "../TempDesignSystem/Table" import BiroScript from "../TempDesignSystem/Text/BiroScript" -import Subtitle from "../TempDesignSystem/Text/Subtitle" -import Title from "../TempDesignSystem/Text/Title" import { hasAvailableParagraphFormat, hasAvailableULFormat } from "./utils" import styles from "./jsontohtml.module.css" diff --git a/apps/scandic-web/components/DestinationFilterAndSort/Filter/index.tsx b/apps/scandic-web/components/DestinationFilterAndSort/Filter/index.tsx index 40bac2d54..31be93faf 100644 --- a/apps/scandic-web/components/DestinationFilterAndSort/Filter/index.tsx +++ b/apps/scandic-web/components/DestinationFilterAndSort/Filter/index.tsx @@ -2,10 +2,10 @@ import { useIntl } from "react-intl" -import { useDestinationDataStore } from "@/stores/destination-data" +import Subtitle from "@scandic-hotels/design-system/Subtitle" +import Title from "@scandic-hotels/design-system/Title" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import Title from "@/components/TempDesignSystem/Text/Title" +import { useDestinationDataStore } from "@/stores/destination-data" import Checkbox from "./Checkbox" diff --git a/apps/scandic-web/components/DestinationFilterAndSort/index.tsx b/apps/scandic-web/components/DestinationFilterAndSort/index.tsx index d3a3eef11..2c6a299d9 100644 --- a/apps/scandic-web/components/DestinationFilterAndSort/index.tsx +++ b/apps/scandic-web/components/DestinationFilterAndSort/index.tsx @@ -13,12 +13,12 @@ import { useIntl } from "react-intl" import { Divider } from "@scandic-hotels/design-system/Divider" import Footnote from "@scandic-hotels/design-system/Footnote" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { AlertTypeEnum } from "@scandic-hotels/trpc/types/alertType" import { useDestinationDataStore } from "@/stores/destination-data" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import Alert from "../TempDesignSystem/Alert" import Filter from "./Filter" diff --git a/apps/scandic-web/components/Dialog/index.tsx b/apps/scandic-web/components/Dialog/index.tsx index a038acdab..1e6086bb5 100644 --- a/apps/scandic-web/components/Dialog/index.tsx +++ b/apps/scandic-web/components/Dialog/index.tsx @@ -7,11 +7,11 @@ import { } from "react-aria-components" import Body from "@scandic-hotels/design-system/Body" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import LoadingSpinner from "@/components/LoadingSpinner" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./dialog.module.css" diff --git a/apps/scandic-web/components/Forms/Edit/Profile/index.tsx b/apps/scandic-web/components/Forms/Edit/Profile/index.tsx index 678df9afe..78ab0dd07 100644 --- a/apps/scandic-web/components/Forms/Edit/Profile/index.tsx +++ b/apps/scandic-web/components/Forms/Edit/Profile/index.tsx @@ -7,6 +7,7 @@ import { useIntl } from "react-intl" import { profile } from "@scandic-hotels/common/constants/routes/myPages" import { logger } from "@scandic-hotels/common/logger" +import Title from "@scandic-hotels/design-system/Title" import { trpc } from "@scandic-hotels/trpc/client" import { langToApiLang } from "@scandic-hotels/trpc/constants/apiLang" @@ -17,7 +18,6 @@ import { editProfile } from "@/actions/editProfile" import Dialog from "@/components/Dialog" import ChangeNameDisclaimer from "@/components/MyPages/Profile/ChangeNameDisclaimer" import Button from "@/components/TempDesignSystem/Button" -import Title from "@/components/TempDesignSystem/Text/Title" import { toast } from "@/components/TempDesignSystem/Toasts" import usePhoneNumberParsing from "@/hooks/usePhoneNumberParsing" import { formatPhoneNumber } from "@/utils/phone" diff --git a/apps/scandic-web/components/GuestsRoomsPicker/GuestsRoom/index.tsx b/apps/scandic-web/components/GuestsRoomsPicker/GuestsRoom/index.tsx index d3dc8f319..c1b237d7a 100644 --- a/apps/scandic-web/components/GuestsRoomsPicker/GuestsRoom/index.tsx +++ b/apps/scandic-web/components/GuestsRoomsPicker/GuestsRoom/index.tsx @@ -2,10 +2,10 @@ import { useIntl } from "react-intl" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { ChildBedMapEnum } from "@scandic-hotels/trpc/enums/childBedMapEnum" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import AdultSelector from "../AdultSelector" import ChildSelector from "../ChildSelector" diff --git a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx index 9f50845b0..df62ac352 100644 --- a/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/MyPagesMenuContent/index.tsx @@ -6,12 +6,12 @@ import { useIntl } from "react-intl" import Caption from "@scandic-hotels/design-system/Caption" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { trpc } from "@scandic-hotels/trpc/client" import { logout } from "@/constants/routes/handleAuth" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import styles from "./myPagesMenuContent.module.css" diff --git a/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx b/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx index 170347720..d04df0687 100644 --- a/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx +++ b/apps/scandic-web/components/Header/MainMenu/NavigationMenu/MegaMenu/index.tsx @@ -4,12 +4,12 @@ import FocusLock from "react-focus-lock" import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import useDropdownStore from "@/stores/main-menu" import Card from "@/components/TempDesignSystem/Card" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./megaMenu.module.css" diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/index.tsx index 14abd41cd..43b9cefd1 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Header/index.tsx @@ -3,8 +3,7 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" - -import Title from "@/components/TempDesignSystem/Text/Title" +import Title from "@scandic-hotels/design-system/Title" import AddToCalendar from "../../AddToCalendar" import AddToCalendarButton from "./Actions/AddToCalendarButton" diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx index 111416560..84d26e5f3 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/HotelDetails/index.tsx @@ -3,9 +3,9 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./hotelDetails.module.css" diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx index 853f1d043..f44bfd1ac 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/PaymentDetails/index.tsx @@ -4,11 +4,10 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import SkeletonShimmer from "@scandic-hotels/design-system/SkeletonShimmer" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { useBookingConfirmationStore } from "@/stores/booking-confirmation" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" - import styles from "./paymentDetails.module.css" export default function PaymentDetails() { diff --git a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/Promo/index.tsx b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/Promo/index.tsx index 49f34de61..3591d79c1 100644 --- a/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/Promo/index.tsx +++ b/apps/scandic-web/components/HotelReservation/BookingConfirmation/Promos/Promo/index.tsx @@ -1,8 +1,8 @@ import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" -import Title from "@/components/TempDesignSystem/Text/Title" import styles from "./promo.module.css" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/MemberPriceModal/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/MemberPriceModal/index.tsx index 320119014..f25580ad3 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Details/MemberPriceModal/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Details/MemberPriceModal/index.tsx @@ -7,11 +7,11 @@ import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" import Body from "@scandic-hotels/design-system/Body" import MagicWandIcon from "@scandic-hotels/design-system/Icons/MagicWandIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" +import Title from "@scandic-hotels/design-system/Title" import Modal from "@/components/Modal" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import Title from "@/components/TempDesignSystem/Text/Title" import { useRoomContext } from "@/contexts/Details/Room" import { formatPrice } from "@/utils/numberFormatting" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Header/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Header/index.tsx index 8af4de580..35906eca9 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Header/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Header/index.tsx @@ -1,7 +1,7 @@ +import Title from "@scandic-hotels/design-system/Title" import { Typography } from "@scandic-hotels/design-system/Typography" import Image from "@/components/Image" -import Title from "@/components/TempDesignSystem/Text/Title" import ToggleSidePeek from "./ToggleSidePeek" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/TimeoutSpinner/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/TimeoutSpinner/index.tsx index 15125f47b..da65a5b3a 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/TimeoutSpinner/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Payment/PaymentCallback/TimeoutSpinner/index.tsx @@ -3,12 +3,12 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { customerService } from "@/constants/webHrefs" import LoadingSpinner from "@/components/LoadingSpinner" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import styles from "./timeoutSpinner.module.css" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx index 46ca2f2fa..9549ef4a6 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/PriceChangeSummary/index.tsx @@ -13,9 +13,9 @@ import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { formatPrice } from "@/utils/numberFormatting" import styles from "./priceChangeSummary.module.css" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx index 07227d0d1..1eba14616 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/PriceChangeDialog/index.tsx @@ -4,12 +4,12 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" +import Title from "@scandic-hotels/design-system/Title" import { useEnterDetailsStore } from "@/stores/enter-details" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import Title from "@/components/TempDesignSystem/Text/Title" import { formatPrice } from "@/utils/numberFormatting" import { calculateTotalRoomPrice } from "../Payment/helpers" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Room/Multiroom.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Room/Multiroom.tsx index 6d7c959e7..7b9628726 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Room/Multiroom.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Room/Multiroom.tsx @@ -1,6 +1,7 @@ "use client" import { useIntl } from "react-intl" +import Title from "@scandic-hotels/design-system/Title" import { ChildBedMapEnum } from "@scandic-hotels/trpc/enums/childBedMapEnum" import { useEnterDetailsStore } from "@/stores/enter-details" @@ -11,7 +12,6 @@ import Details from "@/components/HotelReservation/EnterDetails/Details/Multiroo import Header from "@/components/HotelReservation/EnterDetails/Room/Header" import Section from "@/components/HotelReservation/EnterDetails/Section" import SelectedRoom from "@/components/HotelReservation/EnterDetails/SelectedRoom" -import Title from "@/components/TempDesignSystem/Text/Title" import { useRoomContext } from "@/contexts/Details/Room" import { getBedTypeInfoText } from "./utils" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Room/One.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Room/One.tsx index a57ca25ca..3dea59d50 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Room/One.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Room/One.tsx @@ -1,6 +1,7 @@ "use client" import { useIntl } from "react-intl" +import Title from "@scandic-hotels/design-system/Title" import { ChildBedMapEnum } from "@scandic-hotels/trpc/enums/childBedMapEnum" import { useEnterDetailsStore } from "@/stores/enter-details" @@ -11,7 +12,6 @@ import Details from "@/components/HotelReservation/EnterDetails/Details/RoomOne" import Header from "@/components/HotelReservation/EnterDetails/Room/Header" import Section from "@/components/HotelReservation/EnterDetails/Section" import SelectedRoom from "@/components/HotelReservation/EnterDetails/SelectedRoom" -import Title from "@/components/TempDesignSystem/Text/Title" import { useRoomContext } from "@/contexts/Details/Room" import { getBedTypeInfoText } from "./utils" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/SelectedRoom/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/SelectedRoom/index.tsx index 30c217650..f2e6716ea 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/SelectedRoom/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/SelectedRoom/index.tsx @@ -8,10 +8,10 @@ import { selectRate } from "@scandic-hotels/common/constants/routes/hotelReserva import { Button } from "@scandic-hotels/design-system/Button" import Footnote from "@scandic-hotels/design-system/Footnote" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { useEnterDetailsStore } from "@/stores/enter-details" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { useRoomContext } from "@/contexts/Details/Room" import useLang from "@/hooks/useLang" diff --git a/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/index.tsx b/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/index.tsx index 493d1e39c..748908c56 100644 --- a/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/index.tsx +++ b/apps/scandic-web/components/HotelReservation/EnterDetails/Summary/UI/index.tsx @@ -9,6 +9,7 @@ import { dt } from "@scandic-hotels/common/dt" import Body from "@scandic-hotels/design-system/Body" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { Typography } from "@scandic-hotels/design-system/Typography" import { longDateFormat } from "@/constants/dateFormats" @@ -17,7 +18,6 @@ import BookingCodeChip from "@/components/BookingCodeChip" import PriceDetailsModal from "@/components/HotelReservation/PriceDetailsModal" import { isBookingCodeRate } from "@/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/utils" import SignupPromoDesktop from "@/components/HotelReservation/SignupPromo/Desktop" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { formatPrice } from "@/utils/numberFormatting" diff --git a/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx b/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx index 5638d2d20..1420c1788 100644 --- a/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx +++ b/apps/scandic-web/components/HotelReservation/FindMyBooking/AdditionalInfoForm.tsx @@ -6,10 +6,10 @@ import { FormProvider, useForm } from "react-hook-form" import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" import Button from "@/components/TempDesignSystem/Button" import Input from "@/components/TempDesignSystem/Form/Input" -import Title from "@/components/TempDesignSystem/Text/Title" import { type AdditionalInfoFormSchema, diff --git a/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx b/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx index 843a195ae..848b4cb48 100644 --- a/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx +++ b/apps/scandic-web/components/HotelReservation/FindMyBooking/index.tsx @@ -9,6 +9,7 @@ import { myStay } from "@scandic-hotels/common/constants/routes/myStay" import { logger } from "@scandic-hotels/common/logger" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" +import Title from "@scandic-hotels/design-system/Title" import { trpc } from "@scandic-hotels/trpc/client" import { customerService } from "@/constants/webHrefs" @@ -16,7 +17,6 @@ import { customerService } from "@/constants/webHrefs" import Button from "@/components/TempDesignSystem/Button" import Input from "@/components/TempDesignSystem/Form/Input" import Link from "@/components/TempDesignSystem/Link" -import Title from "@/components/TempDesignSystem/Text/Title" import { toast } from "@/components/TempDesignSystem/Toasts" import useLang from "@/hooks/useLang" diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx index 373df3901..6626b1b70 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/HotelChequeCard/index.tsx @@ -2,8 +2,7 @@ import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" import Caption from "@scandic-hotels/design-system/Caption" - -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import styles from "./hotelChequeCard.module.css" diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsRow/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsRow/index.tsx index da2487fed..be51dd37f 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsRow/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsRow/index.tsx @@ -1,8 +1,7 @@ import { useIntl } from "react-intl" import Caption from "@scandic-hotels/design-system/Caption" - -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import styles from "./hotelPointsRow.module.css" diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/HotelPriceCard/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/HotelPriceCard/index.tsx index 0e7c51d4d..c644cda82 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/HotelPriceCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/HotelPriceCard/index.tsx @@ -4,10 +4,9 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { Divider } from "@scandic-hotels/design-system/Divider" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { RateTypeEnum } from "@scandic-hotels/trpc/enums/rateType" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" - import styles from "./hotelPriceCard.module.css" import type { PriceCardProps } from "@/types/components/hotelReservation/selectHotel/priceCardProps" diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/HotelVoucherCard/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/HotelVoucherCard/index.tsx index 0011a023f..fe24bacf9 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/HotelVoucherCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/HotelVoucherCard/index.tsx @@ -2,8 +2,7 @@ import { useIntl } from "react-intl" import { CurrencyEnum } from "@scandic-hotels/common/constants/currency" import Caption from "@scandic-hotels/design-system/Caption" - -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import styles from "./hotelVoucherCard.module.css" diff --git a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx index dd9e44cbf..0bcd88ca4 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx @@ -7,12 +7,12 @@ import { selectRate } from "@scandic-hotels/common/constants/routes/hotelReserva import Caption from "@scandic-hotels/design-system/Caption" import { IconButton } from "@scandic-hotels/design-system/IconButton" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { Typography } from "@scandic-hotels/design-system/Typography" import { FacilityToIcon } from "@/components/ContentType/HotelPage/data" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { isValidClientSession } from "@/utils/clientSession" diff --git a/apps/scandic-web/components/HotelReservation/HotelCardDialog/StandaloneHotelCardDialog/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardDialog/StandaloneHotelCardDialog/index.tsx index cf5c80e1e..9b34ab4cc 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardDialog/StandaloneHotelCardDialog/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardDialog/StandaloneHotelCardDialog/index.tsx @@ -9,12 +9,12 @@ import Caption from "@scandic-hotels/design-system/Caption" import Footnote from "@scandic-hotels/design-system/Footnote" import { IconButton } from "@scandic-hotels/design-system/IconButton" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { Typography } from "@scandic-hotels/design-system/Typography" import { FacilityToIcon } from "@/components/ContentType/HotelPage/data" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { isValidClientSession } from "@/utils/clientSession" import { trackEvent } from "@/utils/tracking/base" diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx index ed5ad29d7..b827550f8 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/AddedAncillaries/index.tsx @@ -4,11 +4,11 @@ import { useIntl } from "react-intl" import Body from "@scandic-hotels/design-system/Body" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast" import Accordion from "@/components/TempDesignSystem/Accordion" import AccordionItem from "@/components/TempDesignSystem/Accordion/AccordionItem" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { formatPrice } from "@/utils/numberFormatting" import { getBreakfastPackagesFromAncillaryFlow } from "../../utils/hasBreakfastPackage" diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/index.tsx index 4abe90fa5..4748d963a 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Ancillaries/index.tsx @@ -2,12 +2,12 @@ import { use } from "react" import { useIntl } from "react-intl" +import Title from "@scandic-hotels/design-system/Title" import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast" import { useMyStayStore } from "@/stores/my-stay" import { Carousel } from "@/components/Carousel" -import Title from "@/components/TempDesignSystem/Text/Title" import { AddAncillaryProvider } from "@/providers/AddAncillaryProvider" import AddAncillaryFlowModal from "./AddAncillaryFlow/AddAncillaryFlowModal" diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Header/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Header/index.tsx index 4a77ac2a9..9151ef589 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Header/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Header/index.tsx @@ -1,5 +1,6 @@ +import Title from "@scandic-hotels/design-system/Title" + import BiroScript from "@/components/TempDesignSystem/Text/BiroScript" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import styles from "./header.module.css" diff --git a/apps/scandic-web/components/HotelReservation/MyStay/Modal/ModalContent/Header/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/Modal/ModalContent/Header/index.tsx index 039e1a681..5c44ba87c 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/Modal/ModalContent/Header/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/Modal/ModalContent/Header/index.tsx @@ -1,8 +1,7 @@ import { Button as ButtonRAC } from "react-aria-components" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" - -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import styles from "./header.module.css" diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/PriceContainer/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/PriceContainer/index.tsx index 0f71f9e33..3929434da 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/PriceContainer/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ReferenceCard/PriceContainer/index.tsx @@ -1,6 +1,5 @@ import Caption from "@scandic-hotels/design-system/Caption" - -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import styles from "./priceContainer.module.css" diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterAndSortModal/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterAndSortModal/index.tsx index 2ab068436..a0dd3f1f4 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterAndSortModal/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterAndSortModal/index.tsx @@ -16,12 +16,12 @@ import { useIntl } from "react-intl" import { Divider } from "@scandic-hotels/design-system/Divider" import Footnote from "@scandic-hotels/design-system/Footnote" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { useHotelFilterStore } from "@/stores/hotel-filters" import Button from "@/components/TempDesignSystem/Button" import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useInitializeFiltersFromUrl from "@/hooks/useInitializeFiltersFromUrl" import { DEFAULT_SORT } from "../../HotelSorter" diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterContent/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterContent/index.tsx index f4eca070c..3b1c86730 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterContent/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/Filters/FilterContent/index.tsx @@ -1,10 +1,9 @@ import { useEffect, useState } from "react" import { useIntl } from "react-intl" +import Title from "@scandic-hotels/design-system/Title" import { Typography } from "@scandic-hotels/design-system/Typography" -import Title from "@/components/TempDesignSystem/Text/Title" - import FilterCheckbox from "./FilterCheckbox" import styles from "./filterContent.module.css" diff --git a/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx b/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx index 64c61504d..fc9468f86 100644 --- a/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectHotel/index.tsx @@ -1,4 +1,5 @@ import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { Typography } from "@scandic-hotels/design-system/Typography" import HotelCardListing from "@/components/HotelReservation/HotelCardListing" @@ -10,7 +11,6 @@ import MobileMapButtonContainer from "@/components/HotelReservation/SelectHotel/ import NoAvailabilityAlert from "@/components/HotelReservation/SelectHotel/NoAvailabilityAlert" import StaticMap from "@/components/Maps/StaticMap" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getIntl } from "@/i18n" import { getFiltersFromHotels, type HotelResponse } from "./helpers" diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Summary.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Summary.tsx index 3e12160db..844880719 100644 --- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Summary.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/MobileSummary/Summary.tsx @@ -9,6 +9,7 @@ import { Button } from "@scandic-hotels/design-system/Button" import Caption from "@scandic-hotels/design-system/Caption" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { ChildBedMapEnum } from "@scandic-hotels/trpc/enums/childBedMapEnum" import { longDateFormat } from "@/constants/dateFormats" @@ -17,7 +18,6 @@ import { useRatesStore } from "@/stores/select-rate" import PriceDetailsModal from "@/components/HotelReservation/PriceDetailsModal" import SignupPromoDesktop from "@/components/HotelReservation/SignupPromo/Desktop" import Modal from "@/components/Modal" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { formatPrice } from "@/utils/numberFormatting" diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx index 5f58d2941..d63811a91 100644 --- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/RateSummary/index.tsx @@ -8,6 +8,7 @@ import { dt } from "@scandic-hotels/common/dt" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import Footnote from "@scandic-hotels/design-system/Footnote" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { RateEnum } from "@scandic-hotels/trpc/enums/rate" import { RateTypeEnum } from "@scandic-hotels/trpc/enums/rateType" @@ -15,7 +16,6 @@ import { useRatesStore } from "@/stores/select-rate" import SignupPromoDesktop from "@/components/HotelReservation/SignupPromo/Desktop" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { isValidClientSession } from "@/utils/clientSession" import { formatPrice } from "@/utils/numberFormatting" diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx index aa2557714..286653784 100644 --- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/SelectedRoomPanel/index.tsx @@ -8,6 +8,7 @@ import { logger } from "@scandic-hotels/common/logger" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { RateEnum } from "@scandic-hotels/trpc/enums/rate" import { useRatesStore } from "@/stores/select-rate" @@ -15,7 +16,6 @@ import { useRatesStore } from "@/stores/select-rate" import Image from "@/components/Image" import Button from "@/components/TempDesignSystem/Button" import Chip from "@/components/TempDesignSystem/Chip" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { useRoomContext } from "@/contexts/SelectRate/Room" import { isValidClientSession } from "@/utils/clientSession" diff --git a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx index 0988e3750..336dd02ee 100644 --- a/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx +++ b/apps/scandic-web/components/HotelReservation/SelectRate/RoomsContainer/Rooms/MultiRoomWrapper/index.tsx @@ -2,11 +2,11 @@ import { useEffect } from "react" import { useIntl } from "react-intl" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { useRatesStore } from "@/stores/select-rate" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { useRoomContext } from "@/contexts/SelectRate/Room" import useStickyPosition from "@/hooks/useStickyPosition" diff --git a/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContainer/index.tsx b/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContainer/index.tsx index 86b813e27..c5f279fdf 100644 --- a/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContainer/index.tsx +++ b/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContainer/index.tsx @@ -1,11 +1,10 @@ import { useIntl } from "react-intl" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import useDropdownStore from "@/stores/main-menu" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" - import styles from "./languageSwitcherContainer.module.css" import { DropdownTypeEnum } from "@/types/components/dropdown/dropdown" diff --git a/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContent/index.tsx b/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContent/index.tsx index d2682859c..8a12b4502 100644 --- a/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContent/index.tsx +++ b/apps/scandic-web/components/LanguageSwitcher/LanguageSwitcherContent/index.tsx @@ -4,12 +4,12 @@ import { usePathname } from "next/navigation" import { useIntl } from "react-intl" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { Typography } from "@scandic-hotels/design-system/Typography" import { languages } from "@/constants/languages" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import useLang from "@/hooks/useLang" import { replaceUrlPart } from "./utils" diff --git a/apps/scandic-web/components/Modal/ModalContentWithActions/index.tsx b/apps/scandic-web/components/Modal/ModalContentWithActions/index.tsx index 2ea42c333..0d77c1301 100644 --- a/apps/scandic-web/components/Modal/ModalContentWithActions/index.tsx +++ b/apps/scandic-web/components/Modal/ModalContentWithActions/index.tsx @@ -1,7 +1,7 @@ import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Button from "@/components/TempDesignSystem/Button" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import styles from "./modalContent.module.css" diff --git a/apps/scandic-web/components/Modal/index.tsx b/apps/scandic-web/components/Modal/index.tsx index b70fa7221..413dc4b09 100644 --- a/apps/scandic-web/components/Modal/index.tsx +++ b/apps/scandic-web/components/Modal/index.tsx @@ -13,8 +13,7 @@ import { useIntl } from "react-intl" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" import Preamble from "@scandic-hotels/design-system/Preamble" - -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { type AnimationState, diff --git a/apps/scandic-web/components/SasTierComparison/index.tsx b/apps/scandic-web/components/SasTierComparison/index.tsx index 29603ca67..375406ee4 100644 --- a/apps/scandic-web/components/SasTierComparison/index.tsx +++ b/apps/scandic-web/components/SasTierComparison/index.tsx @@ -4,14 +4,14 @@ import Image from "next/image" import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" +import Title from "@scandic-hotels/design-system/Title" import JsonToHtml from "@/components/JsonToHtml" import Link from "@/components/TempDesignSystem/Link" import SectionContainer from "../Section/Container" import Button from "../TempDesignSystem/Button" -import Subtitle from "../TempDesignSystem/Text/Subtitle" -import Title from "../TempDesignSystem/Text/Title" import styles from "./sasTierComparison.module.css" diff --git a/apps/scandic-web/components/Section/Header/index.tsx b/apps/scandic-web/components/Section/Header/index.tsx index 31b1f71f1..ad04baee1 100644 --- a/apps/scandic-web/components/Section/Header/index.tsx +++ b/apps/scandic-web/components/Section/Header/index.tsx @@ -1,13 +1,10 @@ import Preamble from "@scandic-hotels/design-system/Preamble" - -import Title from "@/components/TempDesignSystem/Text/Title" +import Title, { type HeadingProps } from "@scandic-hotels/design-system/Title" import SectionLink from "../Link" import styles from "./header.module.css" -import type { HeadingProps } from "@/components/TempDesignSystem/Text/Title/title" - export type HeaderProps = { link?: { href: string diff --git a/apps/scandic-web/components/Sidebar/JoinLoyalty/Contact/index.tsx b/apps/scandic-web/components/Sidebar/JoinLoyalty/Contact/index.tsx index 06e61a9d6..10a59e408 100644 --- a/apps/scandic-web/components/Sidebar/JoinLoyalty/Contact/index.tsx +++ b/apps/scandic-web/components/Sidebar/JoinLoyalty/Contact/index.tsx @@ -1,6 +1,6 @@ +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { JoinLoyaltyContactEnums } from "@scandic-hotels/trpc/types/joinLoyaltyContact" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getIntl } from "@/i18n" import ContactRow from "./ContactRow" diff --git a/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx b/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx index 894cb9e7b..3c0213108 100644 --- a/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx +++ b/apps/scandic-web/components/Sidebar/JoinLoyalty/ReadMore/index.tsx @@ -1,9 +1,9 @@ import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { faq, membershipTermsAndConditions } from "@/constants/webHrefs" import Link from "@/components/TempDesignSystem/Link" -import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" diff --git a/apps/scandic-web/components/Sidebar/JoinLoyalty/index.tsx b/apps/scandic-web/components/Sidebar/JoinLoyalty/index.tsx index 7098f4579..5839c66f8 100644 --- a/apps/scandic-web/components/Sidebar/JoinLoyalty/index.tsx +++ b/apps/scandic-web/components/Sidebar/JoinLoyalty/index.tsx @@ -1,11 +1,11 @@ import Body from "@scandic-hotels/design-system/Body" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Title from "@scandic-hotels/design-system/Title" import { ScandicFriends } from "@/components/Levels" import LoginButton from "@/components/LoginButton" import Button from "@/components/TempDesignSystem/Button" import Link from "@/components/TempDesignSystem/Link" -import Title from "@/components/TempDesignSystem/Text/Title" import { getIntl } from "@/i18n" import { isLoggedInUser } from "@/utils/isLoggedInUser" diff --git a/apps/scandic-web/components/TempDesignSystem/Accordion/AccordionItem/index.tsx b/apps/scandic-web/components/TempDesignSystem/Accordion/AccordionItem/index.tsx index 41ac27ddc..27474392b 100644 --- a/apps/scandic-web/components/TempDesignSystem/Accordion/AccordionItem/index.tsx +++ b/apps/scandic-web/components/TempDesignSystem/Accordion/AccordionItem/index.tsx @@ -4,11 +4,11 @@ import { useRef } from "react" import Body from "@scandic-hotels/design-system/Body" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import { IconByIconName } from "@/components/Icons/IconByIconName" import { trackAccordionClick } from "@/utils/tracking" -import Subtitle from "../../Text/Subtitle" import { accordionItemVariants } from "./variants" import styles from "./accordionItem.module.css" diff --git a/apps/scandic-web/components/TempDesignSystem/Card/index.tsx b/apps/scandic-web/components/TempDesignSystem/Card/index.tsx index 297e69df7..3481e56d4 100644 --- a/apps/scandic-web/components/TempDesignSystem/Card/index.tsx +++ b/apps/scandic-web/components/TempDesignSystem/Card/index.tsx @@ -2,11 +2,11 @@ import { cx } from "class-variance-authority" import Link from "next/link" import Body from "@scandic-hotels/design-system/Body" +import Title from "@scandic-hotels/design-system/Title" import Image from "@/components/Image" import Button from "@/components/TempDesignSystem/Button" import BiroScript from "@/components/TempDesignSystem/Text/BiroScript" -import Title from "@/components/TempDesignSystem/Text/Title" import { getBodyFontColor, diff --git a/apps/scandic-web/components/TempDesignSystem/Card/utils.ts b/apps/scandic-web/components/TempDesignSystem/Card/utils.ts index 3751d1b13..796969073 100644 --- a/apps/scandic-web/components/TempDesignSystem/Card/utils.ts +++ b/apps/scandic-web/components/TempDesignSystem/Card/utils.ts @@ -1,15 +1,14 @@ import type Body from "@scandic-hotels/design-system/Body" +import type Title from "@scandic-hotels/design-system/Title" import type { VariantProps } from "class-variance-authority" import type { ComponentProps } from "react" import type { ButtonProps } from "@/components/TempDesignSystem/Button/button" import type { CardProps } from "@/components/TempDesignSystem/Card/card" import type { biroScriptVariants } from "@/components/TempDesignSystem/Text/BiroScript/variants" -import type { headingVariants } from "@/components/TempDesignSystem/Text/Title/variants" -export function getTitleFontColor( - theme: CardProps["theme"] -): VariantProps["color"] { +type TitleColor = ComponentProps["color"] +export function getTitleFontColor(theme: CardProps["theme"]): TitleColor { switch (theme) { case "one": return "primaryLight" diff --git a/apps/scandic-web/components/TempDesignSystem/LoyaltyCard/index.tsx b/apps/scandic-web/components/TempDesignSystem/LoyaltyCard/index.tsx index bab1b07bf..385cbf152 100644 --- a/apps/scandic-web/components/TempDesignSystem/LoyaltyCard/index.tsx +++ b/apps/scandic-web/components/TempDesignSystem/LoyaltyCard/index.tsx @@ -1,9 +1,9 @@ import Body from "@scandic-hotels/design-system/Body" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Title from "@scandic-hotels/design-system/Title" import Image from "@/components/Image" import Link from "@/components/TempDesignSystem/Link" -import Title from "@/components/TempDesignSystem/Text/Title" import { loyaltyCardVariants } from "./variants" diff --git a/apps/scandic-web/components/TempDesignSystem/MeetingRoomCard/index.tsx b/apps/scandic-web/components/TempDesignSystem/MeetingRoomCard/index.tsx index cca3be041..b6adda481 100644 --- a/apps/scandic-web/components/TempDesignSystem/MeetingRoomCard/index.tsx +++ b/apps/scandic-web/components/TempDesignSystem/MeetingRoomCard/index.tsx @@ -6,11 +6,11 @@ import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import { Divider } from "@scandic-hotels/design-system/Divider" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import Image from "@/components/Image" import ShowMoreButton from "../ShowMoreButton" -import Subtitle from "../Text/Subtitle" import { translateRoomLighting, translateSeatingType } from "./utils" import styles from "./meetingRoomCard.module.css" diff --git a/apps/scandic-web/components/TempDesignSystem/TeaserCard/index.tsx b/apps/scandic-web/components/TempDesignSystem/TeaserCard/index.tsx index 587331942..c4aef01e5 100644 --- a/apps/scandic-web/components/TempDesignSystem/TeaserCard/index.tsx +++ b/apps/scandic-web/components/TempDesignSystem/TeaserCard/index.tsx @@ -1,9 +1,9 @@ import Body from "@scandic-hotels/design-system/Body" +import Subtitle from "@scandic-hotels/design-system/Subtitle" import ButtonLink from "@/components/ButtonLink" import Image from "@/components/Image" -import Subtitle from "../Text/Subtitle" import TeaserCardSidepeek from "./Sidepeek" import { teaserCardVariants } from "./variants" diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/index.tsx b/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/index.tsx deleted file mode 100644 index 6c79a85c4..000000000 --- a/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Slot } from "@radix-ui/react-slot" - -import { checkForEmptyChildren } from "../../utils/checkForEmptyChildren" -import { subtitleVariants } from "./variants" - -import type { SubtitleProps } from "./subtitle" - -export default function Subtitle({ - asChild = false, - className = "", - color, - textAlign, - textTransform, - type, - ...props -}: SubtitleProps) { - if (checkForEmptyChildren(props.children) === 0) { - return null - } - const Comp = asChild ? Slot : "p" - const classNames = subtitleVariants({ - className, - color, - textAlign, - textTransform, - type, - }) - return -} diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/subtitle.ts b/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/subtitle.ts deleted file mode 100644 index 9c87b1c98..000000000 --- a/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/subtitle.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { VariantProps } from "class-variance-authority" - -import type { subtitleVariants } from "./variants" - -export interface SubtitleProps - extends Omit, "color">, - VariantProps { - asChild?: boolean -} diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Title/index.tsx b/apps/scandic-web/components/TempDesignSystem/Text/Title/index.tsx deleted file mode 100644 index 9e6ea2a1e..000000000 --- a/apps/scandic-web/components/TempDesignSystem/Text/Title/index.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import { checkForEmptyChildren } from "../../utils/checkForEmptyChildren" -import { headingVariants } from "./variants" - -import type { HeadingProps } from "./title" - -export default function Title({ - /** - * What styling to use, based on heading level. If not provided `level` - * will determine the styling. - */ - as, - children, - className = "", - color, - /** - * What HTML tag to use. Defaults to h1. - */ - level = "h1", - textAlign, - textTransform, - ...rest -}: HeadingProps) { - if (checkForEmptyChildren(children) === 0) { - return null - } - const Hx = level - const classNames = headingVariants({ - className, - color, - textAlign, - textTransform, - type: as ?? level, - }) - return ( - - {children} - - ) -} diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Title/title.ts b/apps/scandic-web/components/TempDesignSystem/Text/Title/title.ts deleted file mode 100644 index 37d32376e..000000000 --- a/apps/scandic-web/components/TempDesignSystem/Text/Title/title.ts +++ /dev/null @@ -1,12 +0,0 @@ -import type { VariantProps } from "class-variance-authority" - -import type { headingVariants } from "./variants" - -type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" - -export interface HeadingProps - extends Omit, "color">, - VariantProps { - as?: HeadingLevel - level?: HeadingLevel -} diff --git a/apps/scandic-web/components/TempDesignSystem/utils/checkForEmptyChildren.ts b/apps/scandic-web/components/TempDesignSystem/utils/checkForEmptyChildren.ts deleted file mode 100644 index 01c39539e..000000000 --- a/apps/scandic-web/components/TempDesignSystem/utils/checkForEmptyChildren.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Children, type ReactNode } from "react" - -export function checkForEmptyChildren(children: ReactNode) { - return Children.toArray(children).filter((child) => { - if (child === "") { - return false - } else if (child == null) { - return false - } else { - return true - } - }).length -} diff --git a/apps/scandic-web/components/Webviews/LoyaltyPage/index.tsx b/apps/scandic-web/components/Webviews/LoyaltyPage/index.tsx index 9203e16ed..beeb9b52a 100644 --- a/apps/scandic-web/components/Webviews/LoyaltyPage/index.tsx +++ b/apps/scandic-web/components/Webviews/LoyaltyPage/index.tsx @@ -1,7 +1,8 @@ +import Title from "@scandic-hotels/design-system/Title" + import { serverClient } from "@/lib/trpc/server" import MaxWidth from "@/components/MaxWidth" -import Title from "@/components/TempDesignSystem/Text/Title" import TrackingSDK from "@/components/TrackingSDK" import LinkToOverview from "@/components/Webviews/LinkToOverview" diff --git a/packages/design-system/lib/components/Subtitle/index.tsx b/packages/design-system/lib/components/Subtitle/index.tsx new file mode 100644 index 000000000..217e7a5bf --- /dev/null +++ b/packages/design-system/lib/components/Subtitle/index.tsx @@ -0,0 +1,50 @@ +import { Slot } from '@radix-ui/react-slot' + +import { subtitleVariants } from './variants' + +import type { VariantProps } from 'class-variance-authority' +import { Children, ReactNode } from 'react' + +interface SubtitleProps + extends Omit, 'color'>, + VariantProps { + asChild?: boolean +} + +/** + * @deprecated Use `Typography` instead. + */ +export default function Subtitle({ + asChild = false, + className = '', + color, + textAlign, + textTransform, + type, + ...props +}: SubtitleProps) { + if (checkForEmptyChildren(props.children) === 0) { + return null + } + const Comp = asChild ? Slot : 'p' + const classNames = subtitleVariants({ + className, + color, + textAlign, + textTransform, + type, + }) + return +} + +function checkForEmptyChildren(children: ReactNode) { + return Children.toArray(children).filter((child) => { + if (child === '') { + return false + } else if (child == null) { + return false + } else { + return true + } + }).length +} diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/subtitle.module.css b/packages/design-system/lib/components/Subtitle/subtitle.module.css similarity index 100% rename from apps/scandic-web/components/TempDesignSystem/Text/Subtitle/subtitle.module.css rename to packages/design-system/lib/components/Subtitle/subtitle.module.css diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/variants.ts b/packages/design-system/lib/components/Subtitle/variants.ts similarity index 82% rename from apps/scandic-web/components/TempDesignSystem/Text/Subtitle/variants.ts rename to packages/design-system/lib/components/Subtitle/variants.ts index 8f5bc72dd..ea4c68c0f 100644 --- a/apps/scandic-web/components/TempDesignSystem/Text/Subtitle/variants.ts +++ b/packages/design-system/lib/components/Subtitle/variants.ts @@ -1,6 +1,6 @@ -import { cva } from "class-variance-authority" +import { cva } from 'class-variance-authority' -import styles from "./subtitle.module.css" +import styles from './subtitle.module.css' const config = { variants: { @@ -32,10 +32,10 @@ const config = { }, }, defaultVariants: { - color: "black", - textAlign: "left", - textTransform: "regular", - type: "one", + color: 'black', + textAlign: 'left', + textTransform: 'regular', + type: 'one', }, } as const diff --git a/packages/design-system/lib/components/Title/index.tsx b/packages/design-system/lib/components/Title/index.tsx new file mode 100644 index 000000000..161d92361 --- /dev/null +++ b/packages/design-system/lib/components/Title/index.tsx @@ -0,0 +1,63 @@ +import { Children, ReactNode } from 'react' +import { headingVariants } from './variants' + +import type { VariantProps } from 'class-variance-authority' + +type HeadingLevel = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' + +export interface HeadingProps + extends Omit, 'color'>, + VariantProps { + as?: HeadingLevel + level?: HeadingLevel +} + +/** + * @deprecated Use `Typography` instead. + */ +export default function Title({ + /** + * What styling to use, based on heading level. If not provided `level` + * will determine the styling. + */ + as, + children, + className = '', + color, + /** + * What HTML tag to use. Defaults to h1. + */ + level = 'h1', + textAlign, + textTransform, + ...rest +}: HeadingProps) { + if (checkForEmptyChildren(children) === 0) { + return null + } + const Hx = level + const classNames = headingVariants({ + className, + color, + textAlign, + textTransform, + type: as ?? level, + }) + return ( + + {children} + + ) +} + +function checkForEmptyChildren(children: ReactNode) { + return Children.toArray(children).filter((child) => { + if (child === '') { + return false + } else if (child == null) { + return false + } else { + return true + } + }).length +} diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Title/title.module.css b/packages/design-system/lib/components/Title/title.module.css similarity index 100% rename from apps/scandic-web/components/TempDesignSystem/Text/Title/title.module.css rename to packages/design-system/lib/components/Title/title.module.css diff --git a/apps/scandic-web/components/TempDesignSystem/Text/Title/variants.ts b/packages/design-system/lib/components/Title/variants.ts similarity index 83% rename from apps/scandic-web/components/TempDesignSystem/Text/Title/variants.ts rename to packages/design-system/lib/components/Title/variants.ts index 0c8ef8686..98a2adaf4 100644 --- a/apps/scandic-web/components/TempDesignSystem/Text/Title/variants.ts +++ b/packages/design-system/lib/components/Title/variants.ts @@ -1,6 +1,6 @@ -import { cva } from "class-variance-authority" +import { cva } from 'class-variance-authority' -import styles from "./title.module.css" +import styles from './title.module.css' const config = { variants: { @@ -37,10 +37,10 @@ const config = { }, }, defaultVariants: { - color: "burgundy", - textAlign: "left", - textTransform: "uppercase", - type: "h1", + color: 'burgundy', + textAlign: 'left', + textTransform: 'uppercase', + type: 'h1', }, } as const diff --git a/packages/design-system/package.json b/packages/design-system/package.json index ea915cc7a..d195446c2 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -18,6 +18,8 @@ "./Label": "./dist/components/Label/index.js", "./Select": "./dist/components/Select/index.js", "./SkeletonShimmer": "./dist/components/SkeletonShimmer/index.js", + "./Subtitle": "./dist/components/Subtitle/index.js", + "./Title": "./dist/components/Title/index.js", "./Tooltip": "./dist/components/Tooltip/index.js", "./Typography": "./dist/components/Typography/index.js", "./RegularRateCard": "./dist/components/RateCard/Regular/index.js",