UNPKG

@transkripid/flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS - Transkrip.id fork

1 lines 3.63 kB
{"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":["TimelinePoint","t0","$","_c","Icon","children","className","props","t1","icon","theme","t2","undefined","customTheme","horizontal","useTimelineContext","itemTheme","useTimelineItemContext","t3","point","mergeDeep","twMerge","vertical","jsx","marker","wrapper","base","line"],"mappings":";;;;;;AA8BO,MAAMA,IAAuCC,CAAAA,MAAA;AAAAC,QAAA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