UNPKG

flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

1 lines 2.72 kB
{"version":3,"file":"HRText.cjs","sources":["../../../src/components/HR/HRText.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps } 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 { useThemeProvider } from \"../../theme/provider\";\nimport type { ThemingProps } from \"../../types\";\nimport { hrTheme } from \"./theme\";\n\nexport interface HRTextTheme {\n base: string;\n hrLine: string;\n text: string;\n}\n\nexport interface HRTextProps extends Omit<ComponentProps<\"hr\">, \"ref\">, ThemingProps<HRTextTheme> {\n text: string;\n}\n\nexport const HRText = forwardRef<HTMLHRElement, HRTextProps>((props, ref) => {\n const provider = useThemeProvider();\n const theme = useResolveTheme(\n [hrTheme.text, provider.theme?.hr?.text, props.theme],\n [get(provider.clearTheme, \"hr.text\"), props.clearTheme],\n [get(provider.applyTheme, \"hr.text\"), props.applyTheme],\n );\n\n const { className, text, ...restProps } = resolveProps(props, provider.props?.hrText);\n\n return (\n <div className={theme.base}>\n <hr\n ref={ref}\n className={twMerge(theme.hrLine, className)}\n data-testid=\"flowbite-hr-text\"\n role=\"separator\"\n {...restProps}\n />\n <span className={theme.text}>{text}</span>\n </div>\n );\n});\n\nHRText.displayName = \"HRText\";\n"],"names":["forwardRef","provider","useThemeProvider","theme","useResolveTheme","hrTheme","get","resolveProps","jsxs","jsx","twMerge"],"mappings":";;;;;;;;;;;AAUY,MAAC,MAAM,GAAGA,gBAAU,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK;AACjD,EAAE,MAAMC,UAAQ,GAAGC,yBAAgB,EAAE;AACrC,EAAE,MAAMC,OAAK,GAAGC,4BAAe;AAC/B,IAAI,CAACC,aAAO,CAAC,IAAI,EAAEJ,UAAQ,CAAC,KAAK,EA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