UNPKG

flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

1 lines 2.16 kB
{"version":3,"file":"FooterIcon.mjs","sources":["../../../../src/components/Footer/FooterIcon.tsx"],"sourcesContent":["import type { ComponentProps, FC, PropsWithChildren } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { mergeDeep } from \"../../helpers/merge-deep\";\nimport { getTheme } from \"../../theme-store\";\nimport type { DeepPartial } from \"../../types\";\n\nexport interface FlowbiteFooterIconTheme {\n base: string;\n size: string;\n}\n\nexport interface FooterIconProps extends PropsWithChildren {\n ariaLabel?: string;\n className?: string;\n href?: string;\n icon: FC<ComponentProps<\"svg\">>;\n theme?: DeepPartial<FlowbiteFooterIconTheme>;\n}\n\nexport const FooterIcon: FC<FooterIconProps & ComponentProps<\"a\"> & ComponentProps<\"svg\">> = ({\n ariaLabel,\n className,\n href,\n icon: Icon,\n theme: customTheme = {},\n ...props\n}) => {\n const theme = mergeDeep(getTheme().footer.icon, customTheme);\n\n return (\n <div>\n {href ? (\n <a\n aria-label={ariaLabel}\n data-testid=\"flowbite-footer-icon\"\n href={href}\n className={twMerge(theme.base, className)}\n {...props}\n >\n <Icon className={theme.size} />\n </a>\n ) : (\n <Icon data-testid=\"flowbite-footer-icon\" className={theme.size} {...props} />\n )}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;AAKY,MAAC,UAAU,GAAG,CAAC;AAC3B,EAAE,SAAS;AACX,EAAE,SAAS;AACX,EAAE,IAAI;AACN,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE;AACzB,EAAE,GAAG,KAAK;AACV,CAAC,KAAK;AACN,EAAE,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AAC/D,EAAE,uBAAuB,GAAG,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,mBAAmB,GAAG;AAC1E,IAAI,GAAG;AACP,IAAI;AACJ,MAAM,YAAY,EAAE,SAAS;AAC7B,MAAM,aAAa,EAAE,sBAAsB;AAC3C,MAAM,IAAI;AACV,MAAM,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC;AAC/C,MAAM,GAAG,KAAK;AACd,MAAM,QAAQ,kBAAkB,GAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;AACpE,KAAK;AACL,GAAG,mBAAmB,GAAG,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,sBAAsB,EAAE,SAAS,EAAE,KAAK,CAAC,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AAC/G;;;;"}