mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 05:05:38 -04:00
- Stack title-hero poster/metadata vertically on mobile (flex-col md:flex-row), switch backdrop tall breakpoint from sm to md - Extract bio expand/collapse logic into reusable ExpandableText component; use it in PersonHero and TitleHero - Fix ContinueWatchingCard image to use fill + sizes instead of fixed width/height to avoid layout shift - Add fade-out gradient on genre chip scrollbar edge on mobile - Show scaled-down ambient glow on mobile instead of hiding it entirely - Humanize knownForDepartment labels (Acting→Actor, Directing→Director, etc.) - Change cast member name from truncate to line-clamp-2 for wrapping - Hide tooltip arrow via [&>:last-child]:hidden instead of color-matching it - Apply safe-area-inset padding to HeroBanner content on notched devices
88 lines
2.5 KiB
TypeScript
88 lines
2.5 KiB
TypeScript
import { mergeProps } from "@base-ui/react/merge-props";
|
|
import { useRender } from "@base-ui/react/use-render";
|
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
import { Separator } from "@/components/ui/separator";
|
|
import { cn } from "@/lib/utils";
|
|
|
|
const buttonGroupVariants = cva(
|
|
"flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
{
|
|
variants: {
|
|
orientation: {
|
|
horizontal:
|
|
"*:data-slot:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-md! [&>[data-slot]~[data-slot]]:rounded-l-none [&>[data-slot]~[data-slot]]:border-l-0",
|
|
vertical:
|
|
"flex-col *:data-slot:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-md! [&>[data-slot]~[data-slot]]:rounded-t-none [&>[data-slot]~[data-slot]]:border-t-0",
|
|
},
|
|
},
|
|
defaultVariants: {
|
|
orientation: "horizontal",
|
|
},
|
|
},
|
|
);
|
|
|
|
function ButtonGroup({
|
|
className,
|
|
orientation,
|
|
...props
|
|
}: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
|
|
return (
|
|
// biome-ignore lint/a11y/useSemanticElements: shadcn generated
|
|
<div
|
|
role="group"
|
|
data-slot="button-group"
|
|
data-orientation={orientation}
|
|
className={cn(buttonGroupVariants({ orientation }), className)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function ButtonGroupText({
|
|
className,
|
|
render,
|
|
...props
|
|
}: useRender.ComponentProps<"div">) {
|
|
return useRender({
|
|
defaultTagName: "div",
|
|
props: mergeProps<"div">(
|
|
{
|
|
className: cn(
|
|
"flex items-center gap-2 rounded-md border bg-muted px-2.5 font-medium text-xs/relaxed [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none",
|
|
className,
|
|
),
|
|
},
|
|
props,
|
|
),
|
|
render,
|
|
state: {
|
|
slot: "button-group-text",
|
|
},
|
|
});
|
|
}
|
|
|
|
function ButtonGroupSeparator({
|
|
className,
|
|
orientation = "vertical",
|
|
...props
|
|
}: React.ComponentProps<typeof Separator>) {
|
|
return (
|
|
<Separator
|
|
data-slot="button-group-separator"
|
|
orientation={orientation}
|
|
className={cn(
|
|
"relative self-stretch bg-input data-horizontal:mx-px data-vertical:my-px data-vertical:h-auto data-horizontal:w-auto",
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|
|
|
|
export {
|
|
ButtonGroup,
|
|
ButtonGroupSeparator,
|
|
ButtonGroupText,
|
|
buttonGroupVariants,
|
|
};
|