Merged in chore/sw-3145-move-deprecated-select (pull request #2518)
chore(SW-3145): Move DeprecatedSelect to design-system * Move DeprecatedSelect to design-system Approved-by: Linus Flood
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
import { useController, useFormContext } from "react-hook-form"
|
||||
|
||||
import DeprecatedSelect from "@/components/TempDesignSystem/DeprecatedSelect"
|
||||
import DeprecatedSelect from "@scandic-hotels/design-system/DeprecatedSelect"
|
||||
|
||||
import type { SelectProps } from "./select"
|
||||
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
import type { ReactElement } from "react"
|
||||
import type { Key } from "react-aria-components"
|
||||
import type { RegisterOptions } from "react-hook-form"
|
||||
|
||||
import type { SelectProps as ReactAriaSelectProps } from "@/components/TempDesignSystem/DeprecatedSelect/select"
|
||||
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
|
||||
optionsIcon?: ReactElement<any>
|
||||
}
|
||||
|
||||
export interface SelectProps
|
||||
extends Omit<
|
||||
React.SelectHTMLAttributes<HTMLSelectElement>,
|
||||
"name" | "onSelect" | "placeholder"
|
||||
>,
|
||||
Omit<ReactAriaSelectProps, "onSelect" | "ref" | "value"> {
|
||||
Omit<ReactAriaSelectProps, "ref" | "value"> {
|
||||
registerOptions?: RegisterOptions
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
.chevron {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
div[data-rac][data-open="true"] .chevron {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { type IconProps } from "@scandic-hotels/design-system/Icons"
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import styles from "./chevron.module.css"
|
||||
|
||||
export default function SelectChevron(props: IconProps) {
|
||||
return (
|
||||
<span aria-hidden="true" className={styles.chevron}>
|
||||
<MaterialIcon
|
||||
icon="keyboard_arrow_down"
|
||||
color={props.color ?? "Icon/Default"}
|
||||
size={20}
|
||||
/>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user