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
|
||||
}
|
||||
Reference in New Issue
Block a user