Merged in chore/SW-3145-move-button (pull request #2527)
chore: SW-3145 Moved tempdesign button to design-system * chore: SW-3145 Moved tempdesign button to design-system Approved-by: Anton Gunnarsson
This commit is contained in:
53
packages/design-system/lib/components/OldDSButton/index.tsx
Normal file
53
packages/design-system/lib/components/OldDSButton/index.tsx
Normal file
@@ -0,0 +1,53 @@
|
||||
'use client'
|
||||
|
||||
import { Slot } from '@radix-ui/react-slot'
|
||||
import { Button as ButtonRAC } from 'react-aria-components'
|
||||
|
||||
import { buttonVariants } from './variants'
|
||||
|
||||
import type { ButtonProps } from './button'
|
||||
|
||||
/**
|
||||
* @deprecated Use `@scandic-hotels/design-system/Button` instead.
|
||||
*/
|
||||
export function OldDSButton(props: ButtonProps) {
|
||||
const {
|
||||
className,
|
||||
clean,
|
||||
intent,
|
||||
size,
|
||||
theme,
|
||||
fullWidth,
|
||||
wrapping,
|
||||
variant,
|
||||
...restProps
|
||||
} = props
|
||||
|
||||
const classNames = buttonVariants({
|
||||
className,
|
||||
clean,
|
||||
intent,
|
||||
size,
|
||||
theme,
|
||||
fullWidth,
|
||||
wrapping,
|
||||
variant,
|
||||
})
|
||||
|
||||
if (restProps.asChild) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { asChild, ...slotProps } = restProps
|
||||
return <Slot className={classNames} {...slotProps} />
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { asChild, onClick, disabled, ...racProps } = restProps
|
||||
return (
|
||||
<ButtonRAC
|
||||
className={classNames}
|
||||
isDisabled={disabled}
|
||||
onPress={onClick}
|
||||
{...racProps}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user