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 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"
|
||||
|
||||
@@ -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 { 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<HTMLInputElement> {
|
||||
name: string
|
||||
registerOptions?: RegisterOptions
|
||||
}
|
||||
|
||||
export default function Switch({
|
||||
className,
|
||||
@@ -17,7 +17,7 @@
|
||||
display: block;
|
||||
|
||||
&:before {
|
||||
content: "";
|
||||
content: '';
|
||||
display: block;
|
||||
margin: 2px;
|
||||
width: 16px;
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user