{"version":3,"sources":["../src/components/AccordionPanel/AccordionPanel.context.ts","../src/components/AccordionPanel/AccordionPanel.Section.tsx","../src/components/AccordionPanel/AccordionPanel.Trigger.tsx","../src/components/AccordionPanel/AccordionPanel.Content.tsx","../src/components/AccordionPanel/AccordionPanel.tsx"],"names":["createContext","useContext","useEffect","useMemo","jsx","cn","useControllableState","useCallback","useState","useRef"],"mappings":";;;;;;;AAgBO,IAAM,qBAAA,GACXA,oBAAiD,IAAI,CAAA;AAEhD,SAAS,iBAAA,GAAgD;AAC9D,EAAA,MAAM,GAAA,GAAMC,iBAAW,qBAAqB,CAAA;AAC5C,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT;AAYO,IAAM,uBAAA,GACXD,oBAAmD,IAAI,CAAA;AAElD,SAAS,mBAAA,GAAoD;AAClE,EAAA,MAAM,GAAA,GAAMC,iBAAW,uBAAuB,CAAA;AAC9C,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA,EACF;AACA,EAAA,OAAO,GAAA;AACT;AChCO,SAAS,qBAAA,CAAsB;AAAA,EACpC,EAAA;AAAA,EACA,MAAA,GAAS,KAAA;AAAA,EACT,SAAA;AAAA,EACA,aAAA;AAAA,EACA,eAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF,CAAA,EAA+B;AAC7B,EAAA,MAAM,QAAQ,iBAAA,EAAkB;AAChC,EAAA,MAAM,EAAE,WAAA,EAAa,MAAA,EAAQ,MAAA,EAAQ,iBAAgB,GAAI,KAAA;AAEzD,EAAAC,eAAA,CAAU,MAAM,eAAA,CAAgB,EAAE,GAAG,CAAC,EAAA,EAAI,eAAe,CAAC,CAAA;AAE1D,EAAA,MAAM,IAAA,GAAO,MAAA,IAAU,MAAA,CAAO,EAAE,CAAA;AAEhC,EAAA,MAAM,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V,OAAO;AAAA,MACL,WAAA;AAAA,MACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,IAAA;AAAA,MACA,KAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA,KACF,CAAA;AAAA,IACA,CAAC,WAAA,EAAa,MAAA,EAAQ,QAAQ,IAAA,EAAM,KAAA,EAAO,YAAY,eAAe;AAAA,GACxE;AAEA,EAAA,uBACEC,cAAAA,CAAC,qBAAA,CAAsB,UAAtB,EAA+B,KAAA,EAAO,KACrC,QAAA,kBAAAA,cAAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,kCAAA,EAAiC,EAAA;AAAA,MACjC,kBAAA,EAAkB,WAAA;AAAA,MAClB,SAAA,EAAWC,oBAAA;AAAA,QACT,2BAAA;AAAA,QACA,WAAA,KAAgB,eAAe,UAAA,GAAa,UAAA;AAAA,QAC5C;AAAA,OACF;AAAA,MAEC;AAAA;AAAA,GACH,EACF,CAAA;AAEJ;AAEA,kBAAA,CAAmB,WAAA,GAAc,gBAAA;AAU1B,IAAM,cAAA,GAAiB;AAC9B,cAAA,CAAe,OAAA,GAAU,qBAAA;AACzB,cAAA,CAAe,OAAA,GAAU,qBAAA;AACzB,cAAA,CAAe,OAAA,GAAU,qBAAA","file":"chunk-ZTC3EQFZ.cjs","sourcesContent":["import { createContext, useContext } from \"react\";\nimport type { AccordionOrientation } from \"./AccordionPanel.types\";\n\n// ── Panel-level context ─────────────────────────────────────────────────\n\nexport interface AccordionPanelContextValue {\n  orientation: AccordionOrientation;\n  isOpen: (id: string) => boolean;\n  toggle: (id: string) => void;\n  open: (id: string) => void;\n  close: (id: string) => void;\n  /** Ordered list of all section ids registered in this panel */\n  sectionIds: string[];\n  registerSection: (id: string) => () => void;\n}\n\nexport const AccordionPanelContext =\n  createContext<AccordionPanelContextValue | null>(null);\n\nexport function useAccordionPanel(): AccordionPanelContextValue {\n  const ctx = useContext(AccordionPanelContext);\n  if (!ctx) {\n    throw new Error(\n      \"AccordionPanel components must be used inside <AccordionPanel>\",\n    );\n  }\n  return ctx;\n}\n\n// ── Section-level context ───────────────────────────────────────────────\n\nexport interface AccordionSectionContextValue {\n  id: string;\n  open: boolean;\n  pinned: boolean;\n  orientation: AccordionOrientation;\n  toggle: () => void;\n}\n\nexport const AccordionSectionContext =\n  createContext<AccordionSectionContextValue | null>(null);\n\nexport function useAccordionSection(): AccordionSectionContextValue {\n  const ctx = useContext(AccordionSectionContext);\n  if (!ctx) {\n    throw new Error(\n      \"<AccordionPanel.Trigger> must be rendered inside <AccordionPanel.Section>\",\n    );\n  }\n  return ctx;\n}\n","import { useEffect, useMemo } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport {\n  AccordionSectionContext,\n  useAccordionPanel,\n} from \"./AccordionPanel.context\";\nimport type { AccordionPanelSectionProps } from \"./AccordionPanel.types\";\n\n/**\n * One collapsible section inside an AccordionPanel.\n *\n * Compose with `<AccordionPanel.Trigger>` and `<AccordionPanel.Content>`\n * children — Content renders only when open, Trigger always renders and\n * adapts its look by state. Children that are not Trigger/Content are\n * rendered as-is, regardless of state, so static decorations stay put.\n *\n * Pinned sections never collapse and don't need a Trigger.\n */\nexport function AccordionPanelSection({\n  id,\n  pinned = false,\n  className,\n  openClassName,\n  closedClassName,\n  unstyled,\n  children,\n}: AccordionPanelSectionProps) {\n  const panel = useAccordionPanel();\n  const { orientation, isOpen, toggle, registerSection } = panel;\n\n  useEffect(() => registerSection(id), [id, registerSection]);\n\n  const open = pinned || isOpen(id);\n\n  const sectionCtx = useMemo(\n    () => ({\n      id,\n      open,\n      pinned,\n      orientation,\n      toggle: () => toggle(id),\n    }),\n    [id, open, pinned, orientation, toggle],\n  );\n\n  return (\n    <AccordionSectionContext.Provider value={sectionCtx}>\n      <div\n        data-react-fancy-accordion-section=\"\"\n        data-state={open ? \"open\" : \"closed\"}\n        data-pinned={pinned ? \"\" : undefined}\n        data-orientation={orientation}\n        className={cn(\n          \"flex shrink-0\",\n          !unstyled && \"items-center gap-1\",\n          orientation === \"horizontal\" ? \"flex-row\" : \"flex-col\",\n          className,\n          open ? openClassName : closedClassName,\n        )}\n      >\n        {children}\n      </div>\n    </AccordionSectionContext.Provider>\n  );\n}\n\nAccordionPanelSection.displayName = \"AccordionPanelSection\";\n","import { cn } from \"../../utils/cn\";\nimport { useAccordionSection } from \"./AccordionPanel.context\";\nimport type {\n  AccordionPanelTriggerProps,\n  SectionRenderable,\n  SectionRenderState,\n} from \"./AccordionPanel.types\";\n\nfunction renderSlot(slot: SectionRenderable, state: SectionRenderState) {\n  return typeof slot === \"function\" ? slot(state) : slot;\n}\n\n/**\n * Trigger for an AccordionPanel.Section.\n *\n * Has two visual roles, picked automatically from section state:\n *\n *   - When the section is OPEN: renders as a thin divider on the section's\n *     trailing edge. Hovering reveals an inset chevron pointing toward the\n *     section so the user knows clicking will collapse it.\n *\n *   - When the section is CLOSED: renders as a standalone chevron button\n *     in place of the section content. Clicking re-expands the section.\n *\n * Supply `children` (node or render-prop) to fully replace the default\n * rendering. The render-prop receives `{ open, toggle, orientation, id }`.\n */\nexport function AccordionPanelTrigger({\n  children,\n  className,\n  \"aria-label\": ariaLabel,\n}: AccordionPanelTriggerProps) {\n  const { id, open, orientation, toggle } = useAccordionSection();\n  const state: SectionRenderState = { id, open, orientation, toggle };\n\n  // Custom render path — caller is in charge of look & feel.\n  if (children !== undefined) {\n    return (\n      <div\n        data-react-fancy-accordion-trigger=\"\"\n        data-state={open ? \"open\" : \"closed\"}\n        data-orientation={orientation}\n        className={className}\n      >\n        {renderSlot(children, state)}\n      </div>\n    );\n  }\n\n  // Default rendering ----------------------------------------------------\n\n  if (open) {\n    // Trailing-edge divider. The visible line is 1px (rendered via the\n    // ::before pseudo-element so it stays narrow); the button's actual\n    // hitbox is much wider (w-3 / h-3 = 12px) so users don't have to land\n    // pixel-perfect on the line. Hovering the hitbox highlights the line\n    // and reveals an inset chevron signalling \"click to collapse\".\n    return (\n      <button\n        type=\"button\"\n        onClick={toggle}\n        aria-label={ariaLabel ?? \"Collapse section\"}\n        data-react-fancy-accordion-trigger=\"\"\n        data-state=\"open\"\n        data-orientation={orientation}\n        className={cn(\n          \"group relative flex shrink-0 items-center justify-center cursor-pointer\",\n          \"text-zinc-500 dark:text-zinc-500\",\n          \"hover:text-zinc-900 dark:hover:text-zinc-100\",\n          // Wide hitbox + thin visible line (drawn via ::before).\n          orientation === \"horizontal\"\n            ? \"w-3 self-stretch\"\n            : \"h-3 self-stretch\",\n          \"before:absolute before:bg-zinc-200 dark:before:bg-zinc-700\",\n          \"before:transition-colors group-hover:before:bg-zinc-400 dark:group-hover:before:bg-zinc-500\",\n          orientation === \"horizontal\"\n            ? \"before:top-0 before:bottom-0 before:w-px before:left-1/2 before:-translate-x-1/2\"\n            : \"before:left-0 before:right-0 before:h-px before:top-1/2 before:-translate-y-1/2\",\n          \"transition-colors\",\n          className,\n        )}\n      >\n        <ChevronIcon\n          orientation={orientation}\n          purpose=\"collapse\"\n          className=\"relative opacity-0 group-hover:opacity-100 transition-opacity\"\n        />\n      </button>\n    );\n  }\n\n  // Closed: standalone chevron button. Click to re-expand.\n  return (\n    <button\n      type=\"button\"\n      onClick={toggle}\n      aria-label={ariaLabel ?? \"Expand section\"}\n      data-react-fancy-accordion-trigger=\"\"\n      data-state=\"closed\"\n      data-orientation={orientation}\n      className={cn(\n        \"flex shrink-0 items-center justify-center rounded-md\",\n        \"text-zinc-400 dark:text-zinc-500\",\n        \"hover:text-zinc-900 dark:hover:text-zinc-100\",\n        \"hover:bg-zinc-100 dark:hover:bg-zinc-800\",\n        \"transition-colors cursor-pointer\",\n        orientation === \"horizontal\" ? \"h-8 w-6 mx-0.5\" : \"w-8 h-6 my-0.5\",\n        className,\n      )}\n    >\n      <ChevronIcon orientation={orientation} purpose=\"expand\" />\n    </button>\n  );\n}\n\nAccordionPanelTrigger.displayName = \"AccordionPanelTrigger\";\n\n// ── Internal chevron ────────────────────────────────────────────────────\n\nfunction ChevronIcon({\n  orientation,\n  purpose,\n  className,\n}: {\n  orientation: \"horizontal\" | \"vertical\";\n  /** \"expand\" → closed section, click to open. \"collapse\" → open section, click to close. */\n  purpose: \"expand\" | \"collapse\";\n  className?: string;\n}) {\n  // For horizontal: both states use a left-pointing chevron (matches the\n  // screenshot convention — closed sections show ❮, open dividers reveal\n  // a ❮ on hover indicating the section will collapse leftward).\n  //\n  // For vertical: closed shows down ⌄ (click to expand below); open\n  // divider on hover shows up ⌃ (click to collapse upward).\n  const transform =\n    orientation === \"horizontal\"\n      ? \"rotate(180deg)\"\n      : purpose === \"expand\"\n        ? \"rotate(90deg)\"\n        : \"rotate(270deg)\";\n\n  return (\n    <svg\n      viewBox=\"0 0 16 16\"\n      width=\"12\"\n      height=\"12\"\n      fill=\"none\"\n      stroke=\"currentColor\"\n      strokeWidth=\"2\"\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      style={{ transform }}\n      className={className}\n      aria-hidden=\"true\"\n    >\n      <polyline points=\"6 4 10 8 6 12\" />\n    </svg>\n  );\n}\n","import type { ReactNode } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useAccordionSection } from \"./AccordionPanel.context\";\n\nexport interface AccordionPanelContentProps {\n  children: ReactNode;\n  className?: string;\n  /**\n   * Skip the default flex-row/flex-col + items-center + gap classes so the\n   * consumer can lay out the open-state content however they want (e.g. a\n   * full-height chat panel with header/scroll/input rows). The\n   * `data-react-fancy-accordion-content` attribute and conditional render\n   * (only when the section is open) are kept.\n   */\n  unstyled?: boolean;\n}\n\n/**\n * Wrapper for the open-state content of a Section. Renders its children\n * only when the parent Section is open; returns `null` otherwise.\n *\n * Use this so siblings of `<AccordionPanel.Trigger>` inside a section can\n * cleanly toggle in/out of the DOM.\n *\n * The default styling assumes an inline cluster — flex row (horizontal\n * orientation) or column (vertical), centered, with a small gap. For panel\n * use cases where the content needs full-bleed layout (chat panes, canvas\n * surfaces, etc.), pass `unstyled` and supply your own className.\n */\nexport function AccordionPanelContent({\n  children,\n  className,\n  unstyled,\n}: AccordionPanelContentProps) {\n  const { open, orientation } = useAccordionSection();\n  if (!open) return null;\n\n  return (\n    <div\n      data-react-fancy-accordion-content=\"\"\n      data-orientation={orientation}\n      className={cn(\n        !unstyled && \"flex items-center gap-1\",\n        !unstyled && (orientation === \"horizontal\" ? \"flex-row\" : \"flex-col\"),\n        className,\n      )}\n    >\n      {children}\n    </div>\n  );\n}\n\nAccordionPanelContent.displayName = \"AccordionPanelContent\";\n","import { useCallback, useMemo, useRef, useState } from \"react\";\nimport { cn } from \"../../utils/cn\";\nimport { useControllableState } from \"../../hooks/use-controllable-state\";\nimport { AccordionPanelContext } from \"./AccordionPanel.context\";\nimport { AccordionPanelSection } from \"./AccordionPanel.Section\";\nimport { AccordionPanelTrigger } from \"./AccordionPanel.Trigger\";\nimport { AccordionPanelContent } from \"./AccordionPanel.Content\";\nimport type { AccordionPanelProps } from \"./AccordionPanel.types\";\n\n/**\n * Horizontal or vertical accordion of collapsible sections.\n *\n * Use the compound parts:\n *   <AccordionPanel orientation=\"horizontal\" defaultValue={[\"wishlist\"]}>\n *     <AccordionPanel.Section id=\"home\" pinned>\n *       <Button icon=\"home\" />\n *     </AccordionPanel.Section>\n *     <AccordionPanel.Section id=\"wishlist\">\n *       <Button icon=\"list\">Wishlist</Button>\n *     </AccordionPanel.Section>\n *   </AccordionPanel>\n *\n * Each non-pinned section renders a trigger (default chevron-divider) that\n * collapses/expands. Pass a custom `trigger` prop on a Section, or use the\n * exported `AccordionPanel.Trigger` directly to compose your own.\n */\nfunction AccordionPanelRoot({\n  orientation = \"horizontal\",\n  value: controlledValue,\n  defaultValue,\n  onValueChange,\n  className,\n  children,\n}: AccordionPanelProps) {\n  const [openIds, setOpenIds] = useControllableState<string[]>(\n    controlledValue,\n    defaultValue ?? [],\n    onValueChange,\n  );\n\n  const openSet = useMemo(() => new Set(openIds), [openIds]);\n\n  const isOpen = useCallback((id: string) => openSet.has(id), [openSet]);\n\n  const open = useCallback(\n    (id: string) => {\n      setOpenIds(openSet.has(id) ? (openIds ?? []) : [...(openIds ?? []), id]);\n    },\n    [openSet, openIds, setOpenIds],\n  );\n\n  const close = useCallback(\n    (id: string) => {\n      setOpenIds((openIds ?? []).filter((x) => x !== id));\n    },\n    [openIds, setOpenIds],\n  );\n\n  const toggle = useCallback(\n    (id: string) => {\n      setOpenIds(\n        openSet.has(id)\n          ? (openIds ?? []).filter((x) => x !== id)\n          : [...(openIds ?? []), id],\n      );\n    },\n    [openSet, openIds, setOpenIds],\n  );\n\n  // Track section order for downstream consumers (e.g. trigger direction\n  // heuristics that need to know neighbors).\n  const [sectionIds, setSectionIds] = useState<string[]>([]);\n  const orderRef = useRef<string[]>([]);\n\n  const registerSection = useCallback((id: string) => {\n    if (!orderRef.current.includes(id)) {\n      orderRef.current = [...orderRef.current, id];\n      setSectionIds(orderRef.current);\n    }\n    return () => {\n      orderRef.current = orderRef.current.filter((x) => x !== id);\n      setSectionIds(orderRef.current);\n    };\n  }, []);\n\n  const ctx = useMemo(\n    () => ({\n      orientation,\n      isOpen,\n      toggle,\n      open,\n      close,\n      sectionIds,\n      registerSection,\n    }),\n    [orientation, isOpen, toggle, open, close, sectionIds, registerSection],\n  );\n\n  return (\n    <AccordionPanelContext.Provider value={ctx}>\n      <div\n        data-react-fancy-accordion-panel=\"\"\n        data-orientation={orientation}\n        className={cn(\n          \"inline-flex items-stretch\",\n          orientation === \"horizontal\" ? \"flex-row\" : \"flex-col\",\n          className,\n        )}\n      >\n        {children}\n      </div>\n    </AccordionPanelContext.Provider>\n  );\n}\n\nAccordionPanelRoot.displayName = \"AccordionPanel\";\n\n// ── Compound exports ────────────────────────────────────────────────────\n\ntype AccordionPanelType = typeof AccordionPanelRoot & {\n  Section: typeof AccordionPanelSection;\n  Trigger: typeof AccordionPanelTrigger;\n  Content: typeof AccordionPanelContent;\n};\n\nexport const AccordionPanel = AccordionPanelRoot as AccordionPanelType;\nAccordionPanel.Section = AccordionPanelSection;\nAccordionPanel.Trigger = AccordionPanelTrigger;\nAccordionPanel.Content = AccordionPanelContent;\n"]}