"use client"; /* * Documentation: * KanbanColumn — https://app.subframe.com/f023064a5ca0/library?component=KanbanColumn_bbc08458-14aa-4512-a807-e673a64315ab */ import React from "react"; import { FeatherChevronsLeft } from "@subframe/core"; import { FeatherChevronsRight } from "@subframe/core"; import { FeatherLock } from "@subframe/core"; import * as SubframeCore from "@subframe/core"; import * as SubframeUtils from "../../utils"; export interface KanbanColumnRootProps extends React.HTMLAttributes { collapsed?: boolean; name?: React.ReactNode; price?: React.ReactNode; icon?: React.ReactNode; badge?: React.ReactNode; cards?: React.ReactNode; sumMode?: "visible" | "locked" | "hidden"; lockedSumSlot?: React.ReactNode; twoColumn?: boolean; wrapAfter?: number; /** * Local adjustment: the export draws the collapsed head with `cursor-pointer` * and a chevron but wires nothing to it, so a collapsed column could never be * opened again. With this callback the collapsed head IS the expand control. */ onToggleCollapse?: () => void; /** Accessible name of that expand control — the caller owns the copy. */ expandLabel?: string; className?: string; } const KanbanColumnRoot = React.forwardRef< HTMLDivElement, KanbanColumnRootProps >(function KanbanColumnRoot( { collapsed = false, name, price, icon = , badge, cards, sumMode = "hidden", lockedSumSlot, twoColumn = false, wrapAfter = 6, onToggleCollapse, expandLabel, className, ...otherProps }: KanbanColumnRootProps, ref ) { // Only the collapsed head is interactive: expanded, the same row holds the // kebab menu, and a click target around it would swallow its clicks. const expandProps = collapsed && onToggleCollapse ? { role: "button" as const, tabIndex: 0, "aria-label": expandLabel, onClick: onToggleCollapse, onKeyDown: (event: React.KeyboardEvent) => { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); onToggleCollapse(); } }, } : {}; return (
{name ? ( {name} ) : null}
{name ? ( {name} ) : null} {badge ? (
{badge}
) : null}
{sumMode === "locked" && lockedSumSlot ? (
{lockedSumSlot}
) : null} {price ? ( {price} ) : null} {icon ? ( {icon} ) : null}
{cards ? (
{cards}
) : null}
); }); export const KanbanColumn = KanbanColumnRoot;