{"version":3,"file":"web-4Pe_TPb8.mjs","names":["ReactNode","Ref","Collapsible","CollapsibleContent","Card","SectionHeaderRow","cn","ControlSizeProvider","SectionCardVariant","HEADER_HEIGHT","SectionCardProps","variant","title","icon","actions","open","onOpenChange","defaultOpen","className","ref","HTMLElement","children","SectionCard","t0","$","_c","t1","undefined","inspector","t2","t3","t4","t5","t6","t7","t8","header","t10","t9","Symbol","for","bb0","frame","content","t11","t12","_c","HEADER_HEIGHT","$","c","t1","t0","inspector","t2","t3","cn","t4","t5","children","t6","actions","ControlSizeProvider","t7","icon","open","t8","title","SectionHeaderRow","header","t10","t9","className","defaultOpen","onOpenChange","ref","content","Card","t11","CollapsibleContent","t12","Collapsible","web_default"],"sources":["../../../../../__A__/dev/singularity/.claude/worktrees/att-1794515063-e6dm4h/plugins/primitives/plugins/section-card/web/internal/section-card.tsx","../../../../../__A__/dev/singularity/.claude/worktrees/att-1794515063-e6dm4h/plugins/primitives/plugins/section-card/web/index.ts"],"sourcesContent":["import type { ReactNode, Ref } from \"react\";\nimport {\n Collapsible,\n CollapsibleContent,\n} from \"@plugins/primitives/plugins/collapsible/web\";\nimport { Card } from \"@plugins/primitives/plugins/css/plugins/card/web\";\nimport { SectionHeaderRow } from \"@plugins/primitives/plugins/css/plugins/row/web\";\nimport {\n cn,\n ControlSizeProvider,\n} from \"@plugins/primitives/plugins/css/plugins/ui-kit/web\";\n\n/**\n * The chrome a section wears — a closed pair, both painted here, so a stack's\n * sections are uniform whichever one their pane picked.\n *\n * - **`card`** (default) — a bordered, rounded `Card` with a leading chevron:\n * the detail-pane look, where each section is an object of its own.\n * - **`inspector`** — a flat `
` closed by a 1px rule, its header a\n * full-width row that fills on hover: the collapsed title is muted, the open\n * one reads at full strength with its icon in the primary colour, and a quiet\n * chevron sits at the row's far end (`SectionHeaderRow`'s\n * `disclosure=\"end\"`). For a\n * side-panel inspector, where the sections are one continuous column and a\n * card per section would box it into tiles. Its stack carries no gap and no\n * inset: the rules divide it, and the headers' hover runs edge to edge.\n */\nexport type SectionCardVariant = \"card\" | \"inspector\";\n\n/**\n * The header's one height: an `sm` control (what its `actions` are drawn at)\n * plus `py-sm` above and below, as a floor on the padded row (border-box) —\n * so a title-only header is exactly as tall as one holding a button, a chip\n * or a switch, in every app's density.\n */\nconst HEADER_HEIGHT =\n \"py-sm min-h-[calc(var(--control-height-sm)+2*var(--space-sm))]\";\n\nexport interface SectionCardProps {\n /** The chrome — see {@link SectionCardVariant}. Default `\"card\"`. */\n variant?: SectionCardVariant;\n /** The card's identity, and its click target: clicking it toggles the body. */\n title: string;\n /**\n * Leading icon, rendered between the chevron and the title. Pass the raw icon\n * element — the header row owns its size (`icon-auto`) and color.\n */\n icon?: ReactNode;\n /**\n * Header-right controls, laid out as a SIBLING of the title button (never a\n * nested interactive), so they keep their own click and stay reachable while\n * the card is collapsed. Rendered at `sm` control density — a header affordance\n * is chrome, not body content.\n */\n actions?: ReactNode;\n /** Controlled open state. Pair with `onOpenChange`. */\n open?: boolean;\n onOpenChange?: (open: boolean) => void;\n /** Uncontrolled initial state. Default: collapsed. */\n defaultOpen?: boolean;\n className?: string;\n /**\n * The card's outer element — for a host that scrolls a section into view\n * (`detail-sections`' reveal). Never needed to style or size it.\n */\n ref?: Ref;\n /**\n * The collapsible body. Unmounted while collapsed.\n *\n * **Omit it** for a card whose whole content is one line: with no body there\n * is nothing to expand, so the card renders as a single STATIC row — no\n * chevron, no toggle — with the line's content in `actions`. The disclosure\n * affordance is therefore derived, never declared: a chevron exists exactly\n * when a body exists, so a card that opens onto nothing is unrepresentable.\n */\n children?: ReactNode;\n}\n\n/**\n * A titled, collapsible card: `Card` chrome around a `SectionHeaderRow` trigger\n * and a `CollapsibleContent` body. Collapsed, it is exactly one row — chevron,\n * icon, title, and whatever header actions the caller keeps reachable. With no\n * `children` it is that one row permanently, and drops the chevron with it.\n *\n * This is the sanctioned home for the \"card whose title expands it\" shape. It\n * exists so a stack of such cards is uniform BY CONSTRUCTION: the caller supplies\n * a title and a body, never the chrome, so no two cards can drift on padding,\n * radius, title typography, or chevron placement.\n *\n * The body is genuinely unmounted while collapsed (`CollapsibleContent`), so a\n * heavy panel costs nothing until opened. Anything that must keep running while\n * the card is shut (persistence, subscriptions) does not belong in the body —\n * lift it into a headless always-mounted component.\n */\nexport function SectionCard({\n variant = \"card\",\n title,\n icon,\n actions,\n open,\n onOpenChange,\n defaultOpen,\n className,\n ref,\n children,\n}: SectionCardProps) {\n // ONE header expression for both shapes, with `collapsible` DERIVED from the\n // body's presence — so the two can never drift into \"a chevron over nothing\"\n // or \"a body with no way to open it\".\n //\n // The row reads `open` / `toggle` / `contentId` off the Collapsible context,\n // so the chevron, the aria wiring, and the actions-as-sibling split (no\n // nested