Merged in chore/sw-3145-move-switch (pull request #2521)
Move Switch to design-system * Move Switch to design-system * Fix Icon import * Fix Caption import... Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -8,6 +8,7 @@ import Body from "@scandic-hotels/design-system/Body"
|
|||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
import Caption from "@scandic-hotels/design-system/Caption"
|
||||||
import Checkbox from "@scandic-hotels/design-system/Form/Checkbox"
|
import Checkbox from "@scandic-hotels/design-system/Form/Checkbox"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
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 { Typography } from "@scandic-hotels/design-system/Typography"
|
||||||
import { SEARCH_TYPE_REDEMPTION } from "@scandic-hotels/trpc/constants/booking"
|
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 Button from "@/components/TempDesignSystem/Button"
|
||||||
import Input from "@/components/TempDesignSystem/Form/Input"
|
import Input from "@/components/TempDesignSystem/Form/Input"
|
||||||
import { getErrorMessage } from "@/components/TempDesignSystem/Form/Input/errors"
|
import { getErrorMessage } from "@/components/TempDesignSystem/Form/Input/errors"
|
||||||
import Switch from "@/components/TempDesignSystem/Form/Switch"
|
|
||||||
|
|
||||||
import { Input as BookingWidgetInput } from "../Input"
|
import { Input as BookingWidgetInput } from "../Input"
|
||||||
import { isMultiRoomError } from "../utils"
|
import { isMultiRoomError } from "../utils"
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
import type { RegisterOptions } from "react-hook-form"
|
|
||||||
|
|
||||||
export interface SwitchProps
|
|
||||||
extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
||||||
name: string
|
|
||||||
registerOptions?: RegisterOptions
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,16 @@
|
|||||||
"use client"
|
'use client'
|
||||||
|
|
||||||
import { Switch as AriaSwitch } from "react-aria-components"
|
import { Switch as AriaSwitch } from 'react-aria-components'
|
||||||
import { useController, useFormContext } from "react-hook-form"
|
import { RegisterOptions, useController, useFormContext } from 'react-hook-form'
|
||||||
|
|
||||||
import Caption from "@scandic-hotels/design-system/Caption"
|
import styles from './switch.module.css'
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from '../Icons/MaterialIcon'
|
||||||
|
import Caption from '../Caption'
|
||||||
|
|
||||||
import styles from "./switch.module.css"
|
interface SwitchProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
||||||
|
name: string
|
||||||
import type { SwitchProps } from "@/types/components/switch"
|
registerOptions?: RegisterOptions
|
||||||
|
}
|
||||||
|
|
||||||
export default function Switch({
|
export default function Switch({
|
||||||
className,
|
className,
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
display: block;
|
display: block;
|
||||||
|
|
||||||
&:before {
|
&:before {
|
||||||
content: "";
|
content: '';
|
||||||
display: block;
|
display: block;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
"./Select": "./dist/components/Select/index.js",
|
"./Select": "./dist/components/Select/index.js",
|
||||||
"./SkeletonShimmer": "./dist/components/SkeletonShimmer/index.js",
|
"./SkeletonShimmer": "./dist/components/SkeletonShimmer/index.js",
|
||||||
"./Subtitle": "./dist/components/Subtitle/index.js",
|
"./Subtitle": "./dist/components/Subtitle/index.js",
|
||||||
|
"./Switch": "./dist/components/Switch/index.js",
|
||||||
"./Title": "./dist/components/Title/index.js",
|
"./Title": "./dist/components/Title/index.js",
|
||||||
"./Tooltip": "./dist/components/Tooltip/index.js",
|
"./Tooltip": "./dist/components/Tooltip/index.js",
|
||||||
"./Typography": "./dist/components/Typography/index.js",
|
"./Typography": "./dist/components/Typography/index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user