Merged in chore/remove-unused-code (pull request #2229)
Remove unused code * Remove unused scandic-web files * Remove unused exports Approved-by: Joakim Jäderberg
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
import Chip from "./_Chip"
|
||||
|
||||
import type { FilterChipCheckboxProps } from "@/types/components/form/filterChip"
|
||||
|
||||
export default function CheckboxChip(props: FilterChipCheckboxProps) {
|
||||
return <Chip {...props} type="checkbox" />
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
.label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--Spacing-x-half);
|
||||
padding: calc(var(--Spacing-x1) - 2px) var(--Spacing-x-one-and-half);
|
||||
border: 1px solid var(--Base-Border-Subtle);
|
||||
border-radius: var(--Corner-radius-sm);
|
||||
background-color: var(--Base-Surface-Secondary-light-Normal);
|
||||
cursor: pointer;
|
||||
height: 32px;
|
||||
background-color: var(--Base-Surface-Secondary-light-Normal);
|
||||
}
|
||||
|
||||
.label[data-selected="true"],
|
||||
.label[data-selected="true"]:hover {
|
||||
background-color: var(--Primary-Light-Surface-Normal);
|
||||
border-color: var(--Base-Border-Hover);
|
||||
}
|
||||
|
||||
.label:hover {
|
||||
background-color: var(--Base-Surface-Primary-light-Hover-alt);
|
||||
border-color: var(--Base-Border-Subtle);
|
||||
}
|
||||
|
||||
.label[data-disabled="true"] {
|
||||
background-color: var(--UI-Input-Controls-Surface-Disabled);
|
||||
border-color: var(--UI-Input-Controls-Border-Disabled);
|
||||
color: var(--Base-Text-Disabled);
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.caption {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.caption {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
import { useMemo } from "react"
|
||||
import { useFormContext } from "react-hook-form"
|
||||
|
||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
|
||||
import styles from "./chip.module.css"
|
||||
|
||||
import type { FilterChipProps } from "@/types/components/form/filterChip"
|
||||
|
||||
export default function FilterChip({
|
||||
Icon = () => <MaterialIcon icon="favorite" />,
|
||||
iconHeight = 20,
|
||||
iconWidth = 20,
|
||||
id,
|
||||
name,
|
||||
label,
|
||||
type,
|
||||
value,
|
||||
selected,
|
||||
disabled,
|
||||
hasTooltip,
|
||||
}: FilterChipProps) {
|
||||
const { register } = useFormContext()
|
||||
|
||||
const captionColor = useMemo(() => {
|
||||
if (selected) return "burgundy"
|
||||
if (disabled) return "disabled"
|
||||
return "uiTextPlaceholder"
|
||||
}, [selected, disabled])
|
||||
|
||||
const iconColor = useMemo(() => {
|
||||
if (selected) return "Icon/Interactive/Default"
|
||||
if (disabled) return "Icon/Interactive/Disabled"
|
||||
return "Icon/Interactive/Placeholder"
|
||||
}, [selected, disabled])
|
||||
|
||||
return (
|
||||
<label
|
||||
className={styles.label}
|
||||
data-selected={selected}
|
||||
data-disabled={disabled}
|
||||
>
|
||||
<Icon
|
||||
className={styles.icon}
|
||||
color={captionColor}
|
||||
height={iconHeight}
|
||||
width={iconWidth}
|
||||
/>
|
||||
<Caption type="bold" color={captionColor} className={styles.caption}>
|
||||
{label}
|
||||
</Caption>
|
||||
|
||||
{hasTooltip && (
|
||||
<MaterialIcon icon="info" color={iconColor} size={iconHeight} />
|
||||
)}
|
||||
|
||||
<input
|
||||
aria-hidden
|
||||
id={id || name}
|
||||
hidden
|
||||
type={type}
|
||||
value={value}
|
||||
disabled={disabled}
|
||||
{...register(name)}
|
||||
/>
|
||||
</label>
|
||||
)
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
export type SidePeekProps = {
|
||||
activeContent: string | null
|
||||
onClose: (isOpen: boolean) => void
|
||||
}
|
||||
|
||||
export type SidePeekContentProps = {
|
||||
title?: string
|
||||
contentKey: string
|
||||
isActive?: boolean
|
||||
onClose?: () => void
|
||||
}
|
||||
@@ -1,11 +0,0 @@
|
||||
export type SidePeekProps = {
|
||||
activeContent: string | null
|
||||
onClose: (isOpen: boolean) => void
|
||||
}
|
||||
|
||||
export type SidePeekContentProps = {
|
||||
title?: string
|
||||
contentKey: string
|
||||
isActive?: boolean
|
||||
onClose?: () => void
|
||||
}
|
||||
Reference in New Issue
Block a user