flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 3.12 kB
Source Map (JSON)
{"version":3,"file":"FooterIcon.cjs","sources":["../../../src/components/Footer/FooterIcon.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type ComponentProps, type FC } from \"react\";\nimport { get } from \"../../helpers/get\";\nimport { resolveProps } from \"../../helpers/resolve-props\";\nimport { useResolveTheme } from \"../../helpers/resolve-theme\";\nimport { twMerge } from \"../../helpers/tailwind-merge\";\nimport { useThemeProvider } from \"../../theme/provider\";\nimport type { ThemingProps } from \"../../types\";\nimport { footerTheme } from \"./theme\";\n\nexport interface FooterIconTheme {\n base: string;\n size: string;\n}\n\ntype GenericLinkSvgProps = ComponentProps<\"a\"> & ComponentProps<\"svg\">;\n\nexport interface FooterIconProps extends GenericLinkSvgProps, ThemingProps<FooterIconTheme> {\n ariaLabel?: string;\n icon: FC<ComponentProps<\"svg\">>;\n}\n\nexport const FooterIcon = forwardRef<HTMLDivElement, FooterIconProps>((props, ref) => {\n const provider = useThemeProvider();\n const theme = useResolveTheme(\n [footerTheme.icon, provider.theme?.footer?.icon, props.theme],\n [get(provider.clearTheme, \"footer.icon\"), props.clearTheme],\n [get(provider.applyTheme, \"footer.icon\"), props.applyTheme],\n );\n\n const { ariaLabel, className, href, icon: Icon, ...restProps } = resolveProps(props, provider.props?.footerIcon);\n\n return (\n <div ref={ref}>\n {href ? (\n <a\n aria-label={ariaLabel}\n data-testid=\"flowbite-footer-icon\"\n href={href}\n className={twMerge(theme.base, className)}\n {...restProps}\n >\n <Icon className={theme.size} />\n </a>\n ) : (\n <Icon data-testid=\"flowbite-footer-icon\" className={theme.size} {...restProps} />\n )}\n </div>\n );\n});\n\nFooterIcon.displayName = \"FooterIcon\";\n"],"names":["forwardRef","provider","useThemeProvider","theme","useResolveTheme","footerTheme","get","resolveProps","jsx","twMerge"],"mappings":";;;;;;;;;;;AAUY,MAAC,UAAU,GAAGA,gBAAU,CAAC,CAAC,KAAK,EAA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