diff --git a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx index 6958293c6..dc9da3e62 100644 --- a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx +++ b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx @@ -8,6 +8,7 @@ import Body from "@scandic-hotels/design-system/Body" import Caption from "@scandic-hotels/design-system/Caption" import Checkbox from "@scandic-hotels/design-system/Form/Checkbox" import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import Switch from "@scandic-hotels/design-system/Switch" import { Typography } from "@scandic-hotels/design-system/Typography" import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking" @@ -15,7 +16,6 @@ import Modal from "@/components/Modal" import Button from "@/components/TempDesignSystem/Button" import Input from "@/components/TempDesignSystem/Form/Input" import { getErrorMessage } from "@/components/TempDesignSystem/Form/Input/errors" -import Switch from "@/components/TempDesignSystem/Form/Switch" import { Input as BookingWidgetInput } from "../Input" import { isMultiRoomError } from "../utils" diff --git a/apps/scandic-web/types/components/switch/index.ts b/apps/scandic-web/types/components/switch/index.ts deleted file mode 100644 index f3d56f6bb..000000000 --- a/apps/scandic-web/types/components/switch/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -import type { RegisterOptions } from "react-hook-form" - -export interface SwitchProps - extends React.InputHTMLAttributes { - name: string - registerOptions?: RegisterOptions -} diff --git a/apps/scandic-web/components/TempDesignSystem/Form/Switch/index.tsx b/packages/design-system/lib/components/Switch/index.tsx similarity index 67% rename from apps/scandic-web/components/TempDesignSystem/Form/Switch/index.tsx rename to packages/design-system/lib/components/Switch/index.tsx index 795b4ddfd..a5491bc92 100644 --- a/apps/scandic-web/components/TempDesignSystem/Form/Switch/index.tsx +++ b/packages/design-system/lib/components/Switch/index.tsx @@ -1,14 +1,16 @@ -"use client" +'use client' -import { Switch as AriaSwitch } from "react-aria-components" -import { useController, useFormContext } from "react-hook-form" +import { Switch as AriaSwitch } from 'react-aria-components' +import { RegisterOptions, useController, useFormContext } from 'react-hook-form' -import Caption from "@scandic-hotels/design-system/Caption" -import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon" +import styles from './switch.module.css' +import { MaterialIcon } from '../Icons/MaterialIcon' +import Caption from '../Caption' -import styles from "./switch.module.css" - -import type { SwitchProps } from "@/types/components/switch" +interface SwitchProps extends React.InputHTMLAttributes { + name: string + registerOptions?: RegisterOptions +} export default function Switch({ className, diff --git a/apps/scandic-web/components/TempDesignSystem/Form/Switch/switch.module.css b/packages/design-system/lib/components/Switch/switch.module.css similarity index 98% rename from apps/scandic-web/components/TempDesignSystem/Form/Switch/switch.module.css rename to packages/design-system/lib/components/Switch/switch.module.css index 4c1f2e491..031bd9ca0 100644 --- a/apps/scandic-web/components/TempDesignSystem/Form/Switch/switch.module.css +++ b/packages/design-system/lib/components/Switch/switch.module.css @@ -17,7 +17,7 @@ display: block; &:before { - content: ""; + content: ''; display: block; margin: 2px; width: 16px; diff --git a/packages/design-system/package.json b/packages/design-system/package.json index ea4dbb26a..15d5e9843 100644 --- a/packages/design-system/package.json +++ b/packages/design-system/package.json @@ -20,6 +20,7 @@ "./Select": "./dist/components/Select/index.js", "./SkeletonShimmer": "./dist/components/SkeletonShimmer/index.js", "./Subtitle": "./dist/components/Subtitle/index.js", + "./Switch": "./dist/components/Switch/index.js", "./Title": "./dist/components/Title/index.js", "./Tooltip": "./dist/components/Tooltip/index.js", "./Typography": "./dist/components/Typography/index.js",