{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ds-footer-menu",
  "title": "Footer Menu",
  "description": "A responsive footer navigation that displays in columns on desktop and as an accordion on mobile.",
  "dependencies": [
    "lucide-react",
    "class-variance-authority"
  ],
  "registryDependencies": [
    "@lema-ds/accordion",
    "@lema-ds/ui-i18n",
    "@lema-ds/ds-locale-provider",
    "@lema-ds/ds-link-provider"
  ],
  "files": [
    {
      "path": "components/ds/ds-footer-menu.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { DSLink } from \"@/components/ui/ds-link-provider\"\nimport { ChevronDown } from \"lucide-react\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type { HTMLAttributes } from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { UI_I18N, type UILocale } from \"@/lib/ui-i18n\"\nimport { useUILocale } from \"@/components/ui/ds-locale-provider\"\nimport {\n  Accordion,\n  AccordionItem,\n  AccordionContent,\n  AccordionTrigger,\n} from \"@/components/ui/accordion\"\n\n// ── Types ──────────────────────────────────────────────────────────────────\n\nexport interface FooterOptionData {\n  name: string\n  url: string\n  target?: string\n}\n\nexport interface FooterGroupData {\n  title: string\n  options: FooterOptionData[]\n}\n\nexport interface FooterMenuProps\n  extends\n    Omit<HTMLAttributes<HTMLElement>, \"children\">,\n    VariantProps<typeof footerMenuVariants> {\n  data: FooterGroupData[]\n  /** @default false */\n  upper?: boolean\n  locale?: UILocale\n  size?: \"sm\" | \"md\" | \"lg\"\n}\n\nexport type FooterMenuVariants = VariantProps<typeof footerMenuVariants>\n\n// ── Variants ───────────────────────────────────────────────────────────────\n\nexport const footerMenuVariants = cva(\n  \"flex w-full flex-col gap-8 lg:flex-row lg:justify-between lg:gap-12\"\n)\n\nexport const footerGroupVariants = cva(\"flex w-full flex-col !border-b-0 py-0\")\n\nexport const footerHeaderVariants = cva([\n  \"flex w-full cursor-pointer items-center justify-between py-4\",\n  \"bg-transparent transition-all outline-none\",\n  \"focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2\",\n  \"hover:bg-accent/50 lg:mb-4 lg:cursor-default lg:border-b-0 lg:py-0 lg:hover:bg-transparent\",\n  \"lg:pointer-events-none\",\n])\n\nexport const footerTitleVariants = cva(\n  \"flex justify-start text-left font-medium text-footer-heading\",\n  {\n    variants: {\n      size: {\n        sm: \"text-sm\",\n        md: \"text-base\",\n        lg: \"text-lg\",\n      },\n      upper: {\n        true: \"tracking-wider uppercase\",\n        false: \"\",\n      },\n    },\n    defaultVariants: { size: \"md\", upper: false },\n  }\n)\n\nexport const footerContentVariants = cva([\n  \"m-0 list-none p-0\",\n  \"lg:visible lg:block lg:h-auto lg:opacity-100\",\n])\n\nexport const footerLinkVariants = cva(\n  [\n    \"inline-block cursor-pointer py-1 text-footer-link transition-all hover:text-footer-link-hover hover:underline\",\n    \"rounded-sm focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 focus-visible:outline-none\",\n  ],\n  {\n    variants: {\n      size: {\n        sm: \"text-xs\",\n        md: \"text-sm\",\n        lg: \"text-base\",\n      },\n    },\n    defaultVariants: { size: \"md\" },\n  }\n)\n\nexport const footerNavIconVariants = cva(\n  \"size-4 text-footer-link transition-transform duration-200 lg:hidden\"\n)\n\n// ── FooterMenu ─────────────────────────────────────────────────────────────\n\nexport const FooterMenu = React.forwardRef<HTMLElement, FooterMenuProps>(\n  (\n    {\n      data,\n      upper = false,\n      size = \"md\",\n      locale: localeProp,\n      className,\n      ...props\n    },\n    ref\n  ) => {\n    const locale = useUILocale(localeProp)\n    if (!data || data.length === 0) return null\n\n    return (\n      <nav\n        ref={ref}\n        data-slot=\"footer-menu\"\n        className={cn(footerMenuVariants(), className)}\n        aria-label={UI_I18N[locale].footerMenu.label}\n        {...props}\n      >\n        {/* Mobile: Accordion */}\n        <Accordion\n          data-slot=\"footer-menu-accordion\"\n          type=\"single\"\n          collapsible\n          className=\"radius-none flex w-full flex-col rounded-none border-none lg:hidden\"\n        >\n          {data.map((group: FooterGroupData, i: number) => (\n            <AccordionItem\n              data-slot=\"footer-menu-group\"\n              key={`mobile-${i}`}\n              value={`item-${i}`}\n              className={footerGroupVariants()}\n            >\n              <AccordionTrigger\n                data-slot=\"footer-menu-group-header\"\n                className={cn(\n                  footerHeaderVariants(),\n                  \"hover:no-underline\",\n                  \"**:data-[slot=accordion-trigger-icon]:hidden\"\n                )}\n              >\n                <span className={cn(footerTitleVariants({ size, upper }))}>\n                  {group.title}\n                </span>\n                <ChevronDown\n                  className={cn(\n                    footerNavIconVariants(),\n                    \"transition-transform duration-200 group-data-[state=open]/accordion-trigger:rotate-180\"\n                  )}\n                  aria-hidden=\"true\"\n                />\n              </AccordionTrigger>\n\n              <AccordionContent className=\"p-0 [&_a]:no-underline [&_a]:hover:text-footer-link-hover [&>div]:px-0 [&>div]:py-0\">\n                <ul\n                  className={cn(\n                    footerContentVariants(),\n                    \"flex flex-col gap-2 px-4 pt-4 pb-6\"\n                  )}\n                >\n                  {group.options.map((option: FooterOptionData, j: number) => (\n                    <li key={j}>\n                      <DSLink\n                        data-slot=\"footer-menu-link\"\n                        href={option.url}\n                        target={option.target}\n                        className={cn(footerLinkVariants({ size }))}\n                      >\n                        {option.name}\n                      </DSLink>\n                    </li>\n                  ))}\n                </ul>\n              </AccordionContent>\n            </AccordionItem>\n          ))}\n        </Accordion>\n\n        {/* Desktop: Static columns */}\n        <div\n          data-slot=\"footer-menu-desktop\"\n          className=\"hidden w-full gap-8 lg:flex lg:flex-row lg:justify-between lg:gap-12\"\n        >\n          {data.map((group: FooterGroupData, i: number) => (\n            <div\n              data-slot=\"footer-menu-group\"\n              key={`desktop-${i}`}\n              className=\"flex flex-1 flex-col\"\n            >\n              <h4\n                data-slot=\"footer-menu-group-header\"\n                className={cn(footerTitleVariants({ size, upper }), \"mb-4\")}\n              >\n                {group.title}\n              </h4>\n              <ul\n                className={cn(footerContentVariants(), \"flex flex-col gap-2\")}\n              >\n                {group.options.map((option: FooterOptionData, j: number) => (\n                  <li key={j}>\n                    <DSLink\n                      data-slot=\"footer-menu-link\"\n                      href={option.url}\n                      target={option.target}\n                      className={cn(footerLinkVariants({ size }))}\n                    >\n                      {option.name}\n                    </DSLink>\n                  </li>\n                ))}\n              </ul>\n            </div>\n          ))}\n        </div>\n      </nav>\n    )\n  }\n)\n\nFooterMenu.displayName = \"FooterMenu\"\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}
