Card compact and expanded template

This commit is contained in:
adilallo
2026-02-11 22:02:10 -07:00
parent f60df15c2b
commit b2ed1d438c
44 changed files with 1920 additions and 48 deletions
@@ -0,0 +1,10 @@
import type { ReactNode } from "react";
export interface ScrollbarProps {
/** Content to scroll. */
children: ReactNode;
/** Optional class name merged with scrollbar-design. */
className?: string;
/** Vertical scroll only, horizontal only, or both. @default "vertical" */
orientation?: "vertical" | "horizontal" | "both";
}
@@ -0,0 +1,23 @@
"use client";
import type { ScrollbarProps } from "./Scrollbar.types";
const overflowClass = {
vertical: "overflow-x-clip overflow-y-auto",
horizontal: "overflow-y-clip overflow-x-auto",
both: "overflow-auto",
} as const;
export function ScrollbarView({
children,
className = "",
orientation = "vertical",
}: ScrollbarProps) {
return (
<div
className={`scrollbar-design ${overflowClass[orientation]} ${className}`.trim()}
>
{children}
</div>
);
}
@@ -0,0 +1,5 @@
export { ScrollbarView as default } from "./Scrollbar.view";
export type { ScrollbarProps } from "./Scrollbar.types";
/** Class name to apply the design system scrollbar to any scrollable element (e.g. textarea, div). */
export const SCROLLBAR_DESIGN_CLASS = "scrollbar-design";