import { jsx, jsxs } from "react/jsx-runtime";
import * as React from "react";
import * as AccordionPrimitive from "@radix-ui/react-accordion";
import { ChevronDown } from "lucide-react";
import { cn } from "../../lib/utils.js";
const Accordion = AccordionPrimitive.Root;
const AccordionItem = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
  AccordionPrimitive.Item,
  {
    ref,
    className: cn("border-b border-divider", className),
    ...props
  }
));
AccordionItem.displayName = "AccordionItem";
const AccordionTrigger = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(AccordionPrimitive.Header, { className: "flex", children: /* @__PURE__ */ jsxs(
  AccordionPrimitive.Trigger,
  {
    ref,
    className: cn(
      "flex flex-1 items-center justify-between gap-2",
      "py-4 text-body font-medium text-foreground text-left",
      "transition-colors hover:text-fg-secondary",
      "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
      // AccordionTrigger 單一 text-style 列 → semantic `text-fg-disabled`(非 opacity);Button canonical 對齊
      "disabled:text-fg-disabled disabled:pointer-events-none",
      // 2026-05-31 M24:disabled 時 chevron(icon 載體)亦降 text-fg-disabled,不停留 text-fg-muted
      //（muted=neutral-7 比 disabled=neutral-6 深 → 層級顛倒)。覆寫 chevron 自身 text-fg-muted。
      "disabled:[&>svg]:text-fg-disabled",
      "[&[data-state=open]>svg]:rotate-180",
      className
    ),
    ...props,
    children: [
      children,
      /* @__PURE__ */ jsx(
        ChevronDown,
        {
          size: 16,
          className: "shrink-0 text-fg-muted transition-transform duration-200",
          "aria-hidden": true
        }
      )
    ]
  }
) }));
AccordionTrigger.displayName = "AccordionTrigger";
const AccordionContent = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
  AccordionPrimitive.Content,
  {
    ref,
    className: cn(
      "overflow-hidden text-body text-fg-secondary",
      "data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
    ),
    ...props,
    children: /* @__PURE__ */ jsx("div", { className: cn("pb-4", className), children })
  }
));
AccordionContent.displayName = "AccordionContent";
const accordionMeta = {
  component: "Accordion",
  family: null,
  // non-family composite / overlay / layout
  variants: {},
  sizes: {},
  states: ["default", "hover", "active", "focus-visible", "disabled"],
  tokens: {
    bg: [],
    fg: ["text-fg-disabled", "text-fg-muted", "text-fg-secondary", "text-foreground"],
    ring: ["ring-ring"]
  }
};
export {
  Accordion,
  AccordionContent,
  AccordionItem,
  AccordionTrigger,
  accordionMeta
};
//# sourceMappingURL=accordion.js.map
