flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 3.06 kB
Source Map (JSON)
{"version":3,"file":"TimelinePoint.mjs","sources":["../../../../src/components/Timeline/TimelinePoint.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps, FC } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { mergeDeep } from \"../../helpers/merge-deep\";\nimport type { DeepPartial } from \"../../types\";\nimport { useTimelineContext } from \"./TimelineContext\";\nimport { useTimelineItemContext } from \"./TimelineItemContext\";\n\nexport interface FlowbiteTimelinePointTheme {\n horizontal: string;\n line: string;\n marker: {\n base: {\n horizontal: string;\n vertical: string;\n };\n icon: {\n base: string;\n wrapper: string;\n };\n };\n vertical: string;\n}\n\nexport interface TimelnePointProps extends ComponentProps<\"div\"> {\n icon?: FC<ComponentProps<\"svg\">>;\n theme?: DeepPartial<FlowbiteTimelinePointTheme>;\n}\n\nexport const TimelinePoint: FC<TimelnePointProps> = ({\n children,\n className,\n icon: Icon,\n theme: customTheme = {},\n ...props\n}) => {\n const { horizontal } = useTimelineContext();\n const { theme: itemTheme } = useTimelineItemContext();\n\n const theme = mergeDeep(itemTheme.point, customTheme);\n\n return (\n <div\n data-testid=\"timeline-point\"\n className={twMerge(horizontal && theme.horizontal, !horizontal && theme.vertical, className)}\n {...props}\n >\n {children}\n {Icon ? (\n <span className={twMerge(theme.marker.icon.wrapper)}>\n <Icon aria-hidden className={twMerge(theme.marker.icon.base)} />\n </span>\n ) : (\n <div\n className={twMerge(horizontal && theme.marker.base.horizontal, !horizontal && theme.marker.base.vertical)}\n />\n )}\n {horizontal && <div className={twMerge(theme.line)} />}\n </div>\n );\n};\n"],"names":[],"mappings":";;;;;;AAOY,MAAC,aAAa,GAAG,CAAC;AAC9B,EAAE,QAAQ;AACV,EAAE,SAAS;AACX,EAAE,IAAI,EAAE,IAAI;AACZ,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE;AACzB,EAAE,GAAG,KAAK;AACV,CAAC,KA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