{"version":3,"file":"Icon-BTI7SNs4.js","sources":["../../../app/javascript/lib/classNames.tsx","../../../app/javascript/hardcover-ui/theme/components/icon.ts","../../../app/javascript/hardcover-ui/components/Icon.tsx"],"sourcesContent":["export default function classNames(...classes) {\n return classes.filter(Boolean).join(\" \");\n}\n","export type IconThemeProps = {\n size: \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\" | \"2xl\";\n variant: \"normal\";\n};\n\n// 1x => lg\n// 2x => 2xl\n\nexport const iconTheme = {\n variant: {\n normal: \"fill-current inline\",\n },\n size: {\n xs: \"icon-xs w-3 h-3\",\n sm: \"icon-sm w-3 h-3\",\n md: \"icon-md w-4 h-4\",\n lg: \"icon-lg w-5 h-5\",\n xl: \"icon-1x w-6 h-6\",\n \"2xl\": \"icon-2x w-8 h-8\",\n },\n};\n","/* eslint-disable react/jsx-props-no-spreading */\nimport classNames from \"lib/classNames\";\nimport { iconTheme, IconThemeProps } from \"hardcover-ui/theme/components/icon\";\nimport { forwardRef, HTMLAttributes, PropsWithChildren } from \"react\";\n\ntype Props = {\n icon: any;\n variant?: IconThemeProps[\"variant\"];\n size?: IconThemeProps[\"size\"];\n} & Partial>;\n\nconst Icon = forwardRef>(\n ({ icon, size = \"md\", variant = \"normal\", className = \"\", ...rest }, ref) => {\n const finalClassName = classNames(\n iconTheme.size?.[size],\n iconTheme.variant?.[variant],\n className\n );\n\n const props = {\n ref,\n className: finalClassName,\n ...rest,\n };\n const SvgIcon = icon;\n\n return ;\n }\n);\n\nexport default Icon;\n"],"names":["classNames","classes","iconTheme","Icon","forwardRef","icon","size","variant","className","rest","ref","finalClassName","_a","_b","props","SvgIcon","jsx"],"mappings":"gDAAA,SAAwBA,KAAcC,EAAS,CAC7C,OAAOA,EAAQ,OAAO,OAAO,EAAE,KAAK,GAAG,CACzC,CCMO,MAAMC,EAAY,CACvB,QAAS,CACP,OAAQ,qBACV,EACA,KAAM,CACJ,GAAI,kBACJ,GAAI,kBACJ,GAAI,kBACJ,GAAI,kBACJ,GAAI,kBACJ,MAAO,iBACT,CACF,ECTMC,EAAOC,EAAA,WACX,CAAC,CAAE,KAAAC,EAAM,KAAAC,EAAO,KAAM,QAAAC,EAAU,SAAU,UAAAC,EAAY,GAAI,GAAGC,CAAK,EAAGC,IAAQ,SAC3E,MAAMC,EAAiBX,GACrBY,EAAAV,EAAU,OAAV,YAAAU,EAAiBN,IACjBO,EAAAX,EAAU,UAAV,YAAAW,EAAoBN,GACpBC,CAAA,EAGIM,EAAQ,CACZ,IAAAJ,EACA,UAAWC,EACX,GAAGF,CAAA,EAECM,EAAUV,EAET,OAAAW,EAAA,IAACD,EAAS,CAAA,GAAGD,CAAO,CAAA,CAC7B,CACF"}