flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 2.4 kB
Source Map (JSON)
{"version":3,"file":"TimelineContent.cjs","sources":["../../../../src/components/Timeline/TimelineContent.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 type { FlowbiteTimelineBodyTheme } from \"./TimelineBody\";\nimport { TimelineContentContext } from \"./TimelineContentContext\";\nimport { useTimelineContext } from \"./TimelineContext\";\nimport { useTimelineItemContext } from \"./TimelineItemContext\";\nimport type { FlowbiteTimelineTimeTheme } from \"./TimelineTime\";\nimport type { FlowbiteTimelineTitleTheme } from \"./TimelineTitle\";\n\nexport interface FlowbiteTimelineContentTheme {\n root: {\n base: string;\n };\n time: FlowbiteTimelineTitleTheme;\n title: FlowbiteTimelineTimeTheme;\n body: FlowbiteTimelineBodyTheme;\n}\n\nexport interface TimelineContentProps extends ComponentProps<\"div\"> {\n theme?: DeepPartial<FlowbiteTimelineContentTheme>;\n}\n\nexport const TimelineContent: FC<TimelineContentProps> = ({\n children,\n className,\n theme: customTheme = {},\n ...props\n}) => {\n const { horizontal } = useTimelineContext();\n const { theme: itemTheme } = useTimelineItemContext();\n\n const theme = mergeDeep(itemTheme.content, customTheme);\n\n return (\n <TimelineContentContext.Provider value={{ theme }}>\n <div data-testid=\"timeline-content\" className={twMerge(horizontal && theme.root.base, className)} {...props}>\n {children}\n </div>\n </TimelineContentContext.Provider>\n );\n};\n"],"names":["useTimelineContext","useTimelineItemContext","mergeDeep","jsx","TimelineContentContext","twMerge"],"mappings":";;;;;;;;;AAQY,MAAC,eAAe,GAAG,CAAC;AAChC,EAAE,QAAQ;AACV,EAAE,SAAS;AACX,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE;AACzB,EAAE,GAAG,KAAK;AACV,CAAC,KAAK;AACN,EAAE,MAAM,EAAE,UAAU,EAAE,GAAGA,kCAAkB,EAAE,CAAC;AAC9C,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAGC,0CAAsB,EAAE,CAAC;AACxD,EAAE,MAAM,KAAK,GAAGC,mBAAS,CAAC,SAAS,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;AAC1D,EAAE,uBAAuBC,cAAG,CAACC,6CAAsB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,kBAAkBD,cAAG,CAAC,KAAK,EAAE,EAAE,aAAa,EAAE,kBAAkB,EAAE,SAAS,EAAEE,qBAAO,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC;AACnP;;;;"}