Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com
Open History to see the last commit

controls.tsx

59 lines1.7 KB

1import type { ComponentProps, ReactNode } from "react";
2​
3import { cn } from "@/lib/utils";
4​
5/** The round, slightly raised toolbar buttons of macOS 26. */
6export function MacCircleButton({ className, ...props }: ComponentProps<"button">) {
7 return (
8 <button
9 type="button"
10 className={cn(
11 "grid size-[34px] shrink-0 place-items-center rounded-full border border-mac-control-border bg-mac-control text-mac-icon shadow-[0_1px_1px_rgb(0_0_0/0.03)] transition-colors hover:text-mac-text [&_svg]:size-[17px] [&_svg]:stroke-[1.6]",
12 className,
13 )}
14 {...props}
15 />
16 );
18​
19/** A capsule that groups several toolbar buttons. */
20export function MacPill({ className, children }: { className?: string; children: ReactNode }) {
21 return (
22 <div
23 className={cn(
24 "flex h-[34px] shrink-0 items-center rounded-full border border-mac-control-border bg-mac-control px-1 text-mac-icon shadow-[0_1px_1px_rgb(0_0_0/0.03)]",
25 className,
26 )}
27 >
28 {children}
29 </div>
30 );
32​
33export function MacPillButton({ className, ...props }: ComponentProps<"button">) {
34 return (
35 <button
36 type="button"
37 className={cn(
38 "grid h-[28px] w-[32px] place-items-center rounded-full transition-colors hover:text-mac-text [&_svg]:size-[17px] [&_svg]:stroke-[1.6]",
39 className,
40 )}
41 {...props}
42 />
43 );
45​
46/** Header row at the top of each column; together they form the window toolbar. */
47export function MacColumnHeader({
48 className,
49 children,
50}: {
51 className?: string;
52 children: ReactNode;
53}) {
54 return (
55 <div className={cn("flex h-[52px] shrink-0 items-center gap-2 px-3", className)}>
56 {children}
57 </div>
58 );