diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx index 75e17ab3a..4b24faf4d 100644 --- a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CategoryMenu.tsx @@ -23,44 +23,40 @@ export const CategoryMenu = (props: Props) => { const toggleCategory = (id: string) => setCategories(toggle(categories, id)); - return ( -
No categories
- )} -No categories
; + } }; CategoryMenu.displayName = "CategoryMenu"; diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.module.css b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.module.css new file mode 100644 index 000000000..3004478a4 --- /dev/null +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.module.css @@ -0,0 +1,95 @@ +.root { + display: flex; + flex-direction: column; + font-size: var(--font-size--m); +} + +.header, +.empty { + padding: var(--space--8) var(--space--12); + font-weight: var(--font-weight-boldest); + font-size: var(--font-size--l); +} + +.header { + display: flex; + justify-content: space-between; +} + +.list { + list-style: none; +} + +.label { + display: flex; + gap: var(--gap--12); + align-items: center; + padding: var(--space--8) var(--space--12); + border-radius: var(--border-radius--8); + color: var(--color-text--secondary); + font-weight: var(--font-weight-bold); + cursor: pointer; + transition: var(--animation-length-xs); + user-select: none; + + --mark-color: var(--color-purple--6); +} + +.label:hover { + background-color: var(--color-surface--4); + + --mark-color: var(--color-purple--2); +} + +.checkbox { + width: var(--space--18); + height: var(--space--18); + border-radius: var(--border-radius--2); + background-color: var(--mark-color); + transition: ease-out var(--animation-length-xs); +} + +.label:hover .checkbox { --mark-color: #4343a3; } + +.label.include, +.label.include .checkbox { + color: var(--color-highlight); + + --mark-color: var(--color-highlight); +} + +.label.exclude, +.label.exclude .checkbox { + color: var(--color-danger); + + --mark-color: var(--color-danger); +} + +.icon { + height: var(--space--16); + color: var(--color-surface--0); +} + +.radio { + display: flex; + align-items: center; + justify-content: center; + width: var(--space--16); + height: var(--space--16); + border: var(--space--2) solid var(--color-surface--7); + border-radius: var(--border-radius--8); + background-color: transparent; + transition: ease-out var(--animation-length-xs); +} + +.radio.radioSelected { + border-color: var(--mark-color); +} + +.radioIndicator { + display: block; + width: var(--space--6); + height: var(--space--6); + border-radius: 50%; + background-color: var(--mark-color); +} diff --git a/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.tsx b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.tsx new file mode 100644 index 000000000..76e30be37 --- /dev/null +++ b/apps/cyberstorm-remix/app/commonComponents/PackageSearch/FilterMenus/CollapsibleMenu.tsx @@ -0,0 +1,31 @@ +import { PropsWithChildren } from "react"; +import { faCaretDown } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import styles from "./CollapsibleMenu.module.css"; +import { Icon } from "@thunderstore/cyberstorm"; + +interface Props extends PropsWithChildren { + headerTitle: string; + defaultOpen?: boolean; +} + +/** + * Wrapper for making a menu collapsible + */ +export const CollapsibleMenu = (props: Props) => { + const { headerTitle, defaultOpen, children } = props; + + return ( +