flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 3.07 kB
Source Map (JSON)
{"version":3,"file":"HRIcon.cjs","sources":["../../../src/components/HR/HRIcon.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps, FC } from \"react\";\nimport { forwardRef } 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 { QuoteRightIcon } from \"../../icons/quote-right-icon\";\nimport { useThemeProvider } from \"../../theme/provider\";\nimport type { ThemingProps } from \"../../types\";\nimport { hrTheme } from \"./theme\";\n\nexport interface HRIconTheme {\n base: string;\n hrLine: string;\n icon: {\n base: string;\n icon: string;\n };\n}\n\nexport interface HRIconProps extends Omit<ComponentProps<\"hr\">, \"ref\">, ThemingProps<HRIconTheme> {\n icon?: FC<ComponentProps<\"svg\">>;\n}\n\nexport const HRIcon = forwardRef<HTMLHRElement, HRIconProps>((props, ref) => {\n const provider = useThemeProvider();\n const theme = useResolveTheme(\n [hrTheme.icon, provider.theme?.hr?.icon, props.theme],\n [get(provider.clearTheme, \"hr.icon\"), props.clearTheme],\n [get(provider.applyTheme, \"hr.icon\"), props.applyTheme],\n );\n\n const { icon: Icon = QuoteRightIcon, className, ...restProps } = resolveProps(props, provider.props?.hrIcon);\n\n return (\n <div className={theme.base}>\n <hr\n ref={ref}\n className={twMerge(theme.hrLine, className)}\n data-testid=\"flowbite-hr-icon\"\n role=\"separator\"\n {...restProps}\n />\n <div className={theme.icon.base}>\n <Icon aria-hidden className={theme.icon.icon} />\n </div>\n </div>\n );\n});\n\nHRIcon.displayName = \"HRIcon\";\n"],"names":["forwardRef","provider","useThemeProvider","theme","useResolveTheme","hrTheme","get","QuoteRightIcon","resolveProps","jsxs","jsx","twMerge"],"mappings":";;;;;;;;;;;;AAWY,MAAC,MAAM,GAAGA,gBAAU,CAAC,CAAC,KAAK,E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