feat: refactor NewDates, clean up legacy code

This reverts commit 0c7836fa59.
This commit is contained in:
Simon Emanuelsson
2025-05-03 19:33:04 +02:00
parent c6a0b4ee30
commit db289b80b1
96 changed files with 1603 additions and 1500 deletions

View File

@@ -0,0 +1,15 @@
.content {
display: flex;
flex-direction: column;
gap: var(--Spacing-x3);
max-height: 70vh;
overflow-y: auto;
width: 100%;
}
@media screen and (min-width: 768px) {
.content {
width: 640px;
max-width: 100%;
}
}

View File

@@ -0,0 +1,5 @@
import styles from "./body.module.css"
export default function Body({ children }: React.PropsWithChildren) {
return <div className={styles.content}>{children}</div>
}

View File

@@ -0,0 +1,7 @@
.footer {
border-top: 1px solid var(--Base-Border-Subtle);
display: flex;
justify-content: space-between;
padding-top: var(--Spacing-x3);
width: 100%;
}

View File

@@ -0,0 +1,64 @@
import Button from "@/components/TempDesignSystem/Button"
import styles from "./footer.module.css"
import type { ButtonHTMLAttributes, PropsWithChildren } from "react"
import type { ButtonProps as ReactAriaButtonProps } from "react-aria-components"
import type { ButtonProps as _ButtonProps } from "@/components/TempDesignSystem/Button/button"
export default function Footer({ children }: PropsWithChildren) {
return <footer className={styles.footer}>{children}</footer>
}
interface ButtonProps extends PropsWithChildren {
intent?: _ButtonProps["intent"]
onClick?: ReactAriaButtonProps["onPress"]
type?: ButtonHTMLAttributes<HTMLButtonElement>["type"]
}
interface PrimaryButtonProps extends ButtonProps {
disabled?: boolean
form?: string
}
Footer.Primary = function PrimaryButton({
children,
disabled = false,
form,
intent = "primary",
onClick,
type = "button",
}: PrimaryButtonProps) {
return (
<Button
disabled={disabled}
form={form}
intent={intent}
onClick={onClick}
theme="base"
type={type}
>
{children}
</Button>
)
}
Footer.Secondary = function SecondaryButton({
children,
intent = "text",
onClick,
type = "button",
}: ButtonProps) {
return (
<Button
color="burgundy"
intent={intent}
onClick={onClick}
theme="base"
type={type}
>
{children}
</Button>
)
}

View File

@@ -0,0 +1,15 @@
.header {
display: grid;
gap: var(--Space-x05) var(--Space-x2);
grid-template-columns: 1fr auto;
}
.close {
align-items: center;
background: none;
border: none;
cursor: pointer;
display: flex;
justify-content: center;
padding: 0;
}

View File

@@ -0,0 +1,24 @@
import { Button as ButtonRAC } from "react-aria-components"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import styles from "./header.module.css"
interface HeaderProps extends React.PropsWithChildren {
handleClose: () => void
title: string
}
export default function Header({ children, handleClose, title }: HeaderProps) {
return (
<header className={styles.header}>
<Subtitle>{title}</Subtitle>
<ButtonRAC className={styles.close} onPress={handleClose}>
<MaterialIcon icon="close" color="Icon/Interactive/Placeholder" />
</ButtonRAC>
{children}
</header>
)
}

View File

@@ -0,0 +1,15 @@
import Body from "./Body"
import Footer from "./Footer"
import Header from "./Header"
import styles from "./modalContent.module.css"
import type { PropsWithChildren } from "react"
export default function ModalContent({ children }: PropsWithChildren) {
return <div className={styles.container}>{children}</div>
}
ModalContent.Body = Body
ModalContent.Footer = Footer
ModalContent.Header = Header

View File

@@ -0,0 +1,6 @@
.container {
display: grid;
gap: var(--Space-x3);
grid-template-rows: auto 1fr auto;
height: 100%;
}