feat: refactor of my stay
This commit is contained in:
committed by
Simon.Emanuelsson
parent
b5deb84b33
commit
ec087a3d15
@@ -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%;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import styles from "./body.module.css"
|
||||
|
||||
export default function Body({ children }: React.PropsWithChildren) {
|
||||
return <div className={styles.content}>{children}</div>
|
||||
}
|
||||
@@ -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%;
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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
|
||||
@@ -0,0 +1,4 @@
|
||||
.container {
|
||||
display: grid;
|
||||
gap: var(--Space-x3);
|
||||
}
|
||||
Reference in New Issue
Block a user