flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 3.44 kB
Source Map (JSON)
{"version":3,"file":"Timeline.mjs","sources":["../../../../src/components/Timeline/Timeline.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentProps, FC } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { mergeDeep } from \"../../helpers/merge-deep\";\nimport { getTheme } from \"../../theme-store\";\nimport type { DeepPartial } from \"../../types\";\nimport { TimelineBody } from \"./TimelineBody\";\nimport { TimelineContent } from \"./TimelineContent\";\nimport { TimelineContext } from \"./TimelineContext\";\nimport { TimelineItem, type FlowbiteTimelineItemTheme } from \"./TimelineItem\";\nimport { TimelinePoint } from \"./TimelinePoint\";\nimport { TimelineTime } from \"./TimelineTime\";\nimport { TimelineTitle } from \"./TimelineTitle\";\n\nexport interface FlowbiteTimelineTheme {\n root: {\n direction: {\n horizontal: string;\n vertical: string;\n };\n };\n item: FlowbiteTimelineItemTheme;\n}\n\nexport interface TimelineProps extends ComponentProps<\"ol\"> {\n horizontal?: boolean;\n theme?: DeepPartial<FlowbiteTimelineTheme>;\n}\n\nconst TimelineComponent: FC<TimelineProps> = ({\n children,\n className,\n horizontal,\n theme: customTheme = {},\n ...props\n}) => {\n const theme = mergeDeep(getTheme().timeline, customTheme);\n\n return (\n <TimelineContext.Provider value={{ theme, horizontal }}>\n <ol\n data-testid=\"timeline-component\"\n className={twMerge(\n horizontal && theme.root.direction.horizontal,\n !horizontal && theme.root.direction.vertical,\n className,\n )}\n {...props}\n >\n {children}\n </ol>\n </TimelineContext.Provider>\n );\n};\n\nTimelineComponent.displayName = \"Timeline\";\nTimelineItem.displayName = \"Timeline.Item\";\nTimelinePoint.displayName = \"Timeline.Point\";\nTimelineContent.displayName = \"Timeline.Content\";\nTimelineTime.displayName = \"Timeline.Time\";\nTimelineTitle.displayName = \"Timeline.Title\";\nTimelineBody.displayName = \"Timeline.Body\";\n\nexport const Timeline = Object.assign(TimelineComponent, {\n Item: TimelineIt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