{"version":3,"sources":["../../src/components/skiplink.tsx"],"sourcesContent":["// eslint-disable-next-line  @typescript-eslint/no-unused-vars\nimport React, { ComponentProps, forwardRef, ReactNode } from \"react\";\nimport { clx } from \"../utils\";\nimport { Button } from \"./button\";\n\n/**\n * Props for Skiplink component. A skiplink is an accessibility feature that allows keyboard users\n * to quickly navigate to the main content of a page.\n * @typedef SkiplinkProps\n * @property {string} href - The target URL or anchor ID that the skiplink navigates to\n * @property {ReactNode} children - The content to be displayed in the skiplink\n * @property {string} [className] - Optional CSS class names to apply to the anchor element\n */\n\ninterface SkiplinkProps extends ComponentProps<\"a\"> {\n  href: string; // Only redefining href to make it required\n}\n\nconst Skiplink = forwardRef<HTMLAnchorElement, SkiplinkProps>(\n  ({ children, href, className, ...props }, ref) => {\n    return (\n      <Button asChild variant=\"primary-outline\" size={\"small\"}>\n        <a\n          ref={ref}\n          className={clx(\n            // to hide the element\n            \"shadow-context-menu\",\n            \"absolute z-[99] size-[1px]\",\n            \"overflow-hidden\",\n            \"whitespace-nowrap\",\n            \"[clip-path:inset(50%)]\",\n            // Focus state (visible)\n            \"focus:h-auto focus:w-auto\",\n            \"focus:left-4 focus:top-11\",\n            \"focus:[clip-path:none]\",\n            \"transition-all duration-500 ease-in-out\",\n            \"opacity-0 focus:opacity-100\",\n            className,\n          )}\n          href={href}\n          {...props}\n        >\n          {children}\n        </a>\n      </Button>\n    );\n  },\n);\nSkiplink.displayName = \"Skiplink\";\n\nexport { Skiplink };\n"],"mappings":"uIACA,OAAgC,cAAAA,MAA6B,QAqBrD,cAAAC,MAAA,oBAJR,IAAMC,EAAWC,EACf,CAACC,EAAyCC,IAAQ,CAAjD,IAAAC,EAAAF,EAAE,UAAAG,EAAU,KAAAC,EAAM,UAAAC,CAnBrB,EAmBGH,EAAgCI,EAAAC,EAAhCL,EAAgC,CAA9B,WAAU,OAAM,cACjB,OACEL,EAACW,EAAA,CAAO,QAAO,GAAC,QAAQ,kBAAkB,KAAM,QAC9C,SAAAX,EAAC,IAAAY,EAAAC,EAAA,CACC,IAAKT,EACL,UAAWU,EAET,sBACA,6BACA,kBACA,oBACA,yBAEA,4BACA,4BACA,yBACA,0CACA,8BACAN,CACF,EACA,KAAMD,GACFE,GAlBL,CAoBE,SAAAH,GACH,EACF,CAEJ,CACF,EACAL,EAAS,YAAc","names":["forwardRef","jsx","Skiplink","forwardRef","_a","ref","_b","children","href","className","props","__objRest","Button","__spreadProps","__spreadValues","clx"]}