flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 2.16 kB
Source Map (JSON)
{"version":3,"file":"TimelineItem.mjs","sources":["../../../../src/components/Timeline/TimelineItem.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 { FlowbiteTimelineContentTheme } from \"./TimelineContent\";\nimport { useTimelineContext } from \"./TimelineContext\";\nimport { TimelineItemContext } from \"./TimelineItemContext\";\nimport type { FlowbiteTimelinePointTheme } from \"./TimelinePoint\";\n\nexport interface FlowbiteTimelineItemTheme {\n root: {\n horizontal: string;\n vertical: string;\n };\n content: FlowbiteTimelineContentTheme;\n point: FlowbiteTimelinePointTheme;\n}\n\nexport interface TimelineItemProps extends ComponentProps<\"li\"> {\n theme?: DeepPartial<FlowbiteTimelineItemTheme>;\n}\n\nexport const TimelineItem: FC<TimelineItemProps> = ({ children, className, theme: customTheme = {}, ...props }) => {\n const { theme: rootTheme, horizontal } = useTimelineContext();\n\n const theme = mergeDeep(rootTheme.item, customTheme);\n\n return (\n <TimelineItemContext.Provider value={{ theme }}>\n <li\n data-testid=\"timeline-item\"\n className={twMerge(horizontal && theme.root.horizontal, !horizontal && theme.root.vertical, className)}\n {...props}\n >\n {children}\n </li>\n </TimelineItemContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;AAOY,MAAC,YAAY,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,KAAK;AAC5F,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,kBAAkB,EAAE,CAAC;AAChE,EAAE,MAAM,KAAK,GAAG,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACvD,EAAE,uBAAuB,GAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,QAAQ,kBAAkB,GAAG;AAC5G,IAAI,IAAI;AACR,IAAI;AACJ,MAAM,aAAa,EAAE,eAAe;AACpC,MAAM,SAAS,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,CAAC,QAAQ,EAAE,SAAS,CAAC;AAC5G,MAAM,GAAG,KAAK;AACd,MAAM,QAAQ;AACd,KAAK;AACL,GAAG,EAAE,CAAC,CAAC;AACP;;;;"}