Merged in chore/cleanup-scandic-web (pull request #2831)

chore: Cleanup scandic-web

* Remove unused files

* Remove unused and add missing packages

* Remove unused exports


Approved-by: Linus Flood
This commit is contained in:
Anton Gunnarsson
2025-09-18 15:33:00 +00:00
parent cc99f26727
commit 08804e8675
113 changed files with 45 additions and 2891 deletions

View File

@@ -17,7 +17,7 @@ import { debounce } from "@scandic-hotels/common/utils/debounce"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { Typography } from "@scandic-hotels/design-system/Typography"
import { Arrow } from "../Popover/Arrow"
import { Arrow } from "./Arrow"
import { Breadcrumb } from "./Breadcrumb"
import { splitBreadcrumbs } from "./utils"
import { breadcrumbsVariants } from "./variants"

View File

@@ -4,11 +4,11 @@ import type { TypenameInterface } from "@/types/requests/utils/typename"
export type Order = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
export type ColSpan = 2 | 3 | 4 | 6 | 8
type ColSpan = 2 | 3 | 4 | 6 | 8
export type RowSpan = 1 | 2 | 3 | 6
// TODO: Extend query and fix type accordingly
export interface Row extends TypenameInterface<"Card"> {
interface Row extends TypenameInterface<"Card"> {
title: string
}
@@ -19,7 +19,7 @@ type Column = {
}[]
}
export interface Grid {
interface Grid {
columns: Column[]
}

View File

@@ -1,51 +0,0 @@
import {
Button,
Dialog,
DialogTrigger,
OverlayArrow,
Popover as RAPopover,
} from "react-aria-components"
import useSetOverFlowVisibleOnRA from "@scandic-hotels/common/hooks/useSetOverflowVisibleOnRA"
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
import { Arrow } from "./Arrow"
import styles from "./popover.module.css"
import type { PopoverProps } from "./popover"
export default function Popover({
triggerContent,
children,
...props
}: PopoverProps) {
const setOverflowVisible = useSetOverFlowVisibleOnRA()
return (
<DialogTrigger onOpenChange={setOverflowVisible}>
<Button className={styles.trigger}>{triggerContent}</Button>
<RAPopover
{...props}
offset={16}
crossOffset={-24}
className={styles.root}
>
<OverlayArrow>
<Arrow />
</OverlayArrow>
<Dialog>
{({ close }) => (
<>
<Button className={styles.closeButton} onPress={close}>
<MaterialIcon icon="close" size={20} />
</Button>
{children}
</>
)}
</Dialog>
</RAPopover>
</DialogTrigger>
)
}

View File

@@ -1,28 +0,0 @@
.root {
background-color: var(--Base-Surface-Primary-light-Normal);
border-radius: var(--Corner-radius-md);
box-shadow: var(--popup-box-shadow);
padding: var(--Spacing-x2);
max-width: calc(360px + var(--Spacing-x2) * 2);
overflow-y: auto;
}
.root section:focus-visible {
outline: none;
}
.trigger {
background: none;
border: none;
padding: 0;
cursor: pointer;
}
.closeButton {
position: absolute;
top: 8px;
right: 8px;
background: none;
border: none;
cursor: pointer;
padding: 0;
}

View File

@@ -1,6 +0,0 @@
import type { PopoverProps as RAPopoverProps } from "react-aria-components"
export interface PopoverProps extends Omit<RAPopoverProps, "children"> {
triggerContent: React.ReactNode
children: React.ReactNode
}

View File

@@ -1,12 +0,0 @@
import styles from "./progressbar.module.css"
import type { ProgressbarProps } from "./progressbar"
export default function ProgressBar({ className, progress }: ProgressbarProps) {
className = className ?? ""
return (
<div className={`${className} ${styles.bar}`}>
<div className={styles.progress} style={{ width: `${progress}%` }} />
</div>
)
}

View File

@@ -1,12 +0,0 @@
.bar {
background-color: var(--Main-Grey-White);
border-radius: 40px;
height: 20px;
width: 100%;
}
.progress {
background-color: var(--UI-Opacity-Almost-Black-100);
border-radius: 40px;
height: 20px;
}

View File

@@ -1,3 +0,0 @@
export interface ProgressbarProps extends React.HTMLAttributes<HTMLDivElement> {
progress: number
}