Merged in chore/remove-unused-files (pull request #3483)
chore: Remove unused files * Remove unused files Approved-by: Matilda Landström
This commit is contained in:
@@ -1,40 +0,0 @@
|
|||||||
"use client"
|
|
||||||
import { useController, useFormContext } from "react-hook-form"
|
|
||||||
|
|
||||||
import DeprecatedSelect from "@scandic-hotels/design-system/DeprecatedSelect"
|
|
||||||
|
|
||||||
import type { SelectProps } from "./select"
|
|
||||||
|
|
||||||
export default function Select({
|
|
||||||
className,
|
|
||||||
items,
|
|
||||||
label,
|
|
||||||
disabled,
|
|
||||||
name,
|
|
||||||
isNestedInModal = false,
|
|
||||||
registerOptions = {},
|
|
||||||
}: SelectProps) {
|
|
||||||
const { control } = useFormContext()
|
|
||||||
const { field } = useController({
|
|
||||||
control,
|
|
||||||
name,
|
|
||||||
rules: registerOptions,
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
|
||||||
<DeprecatedSelect
|
|
||||||
className={className}
|
|
||||||
defaultSelectedKey={field.value}
|
|
||||||
disabled={disabled || field.disabled}
|
|
||||||
items={items}
|
|
||||||
label={label}
|
|
||||||
aria-label={label}
|
|
||||||
name={field.name}
|
|
||||||
onBlur={field.onBlur}
|
|
||||||
onSelect={field.onChange}
|
|
||||||
value={field.value}
|
|
||||||
data-testid={name}
|
|
||||||
isNestedInModal={isNestedInModal}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
import type { ReactElement } from "react"
|
|
||||||
import type { Key } from "react-aria-components"
|
|
||||||
import type { RegisterOptions } from "react-hook-form"
|
|
||||||
|
|
||||||
interface ReactAriaSelectProps
|
|
||||||
extends Omit<
|
|
||||||
React.SelectHTMLAttributes<HTMLSelectElement>,
|
|
||||||
"onSelect" | "value"
|
|
||||||
> {
|
|
||||||
defaultSelectedKey?: Key
|
|
||||||
items: { label: string; value: Key }[]
|
|
||||||
label: string
|
|
||||||
name: string
|
|
||||||
maxHeight?: number
|
|
||||||
showRadioButton?: boolean
|
|
||||||
discreet?: boolean
|
|
||||||
isNestedInModal?: boolean
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
optionsIcon?: ReactElement<any>
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface SelectProps
|
|
||||||
extends Omit<
|
|
||||||
React.SelectHTMLAttributes<HTMLSelectElement>,
|
|
||||||
"name" | "onSelect" | "placeholder"
|
|
||||||
>,
|
|
||||||
Omit<ReactAriaSelectProps, "ref" | "value"> {
|
|
||||||
registerOptions?: RegisterOptions
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import type { FocalPoint } from "@scandic-hotels/common/utils/imageVault"
|
|
||||||
|
|
||||||
interface Dimensions {
|
|
||||||
width: number
|
|
||||||
height: number
|
|
||||||
aspectRatio: number
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Meta {
|
|
||||||
alt: string | undefined | null
|
|
||||||
caption: string | undefined | null
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ApiImage {
|
|
||||||
id: string
|
|
||||||
url: string
|
|
||||||
title: string
|
|
||||||
meta: Meta
|
|
||||||
dimensions?: Dimensions
|
|
||||||
focalPoint?: FocalPoint
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
export type ShowMoreButtonParams = {
|
|
||||||
disabled?: boolean
|
|
||||||
loadMoreData: () => void
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { mergeRefs } from "./mergeRefs"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export { Loading } from "./Loading"
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
import { cva } from "class-variance-authority"
|
|
||||||
|
|
||||||
import styles from "./progress.module.css"
|
|
||||||
|
|
||||||
export const config = {
|
|
||||||
variants: {},
|
|
||||||
defaultVariants: {},
|
|
||||||
} as const
|
|
||||||
|
|
||||||
export const variants = cva(styles.progress, config)
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
export * from "./tokens/index"
|
|
||||||
Reference in New Issue
Block a user