{"version":3,"file":"Timeline.cjs","names":[],"sources":["../../../src/components/Timeline/Timeline.tsx"],"sourcesContent":["import type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport styles from \"./Timeline.module.css\";\n\nexport type TimelineMarker = \"primary\" | \"success\" | \"warning\" | \"danger\" | \"neutral\";\n\nexport interface TimelineItem {\n    /** Stable identifier (used as React key). */\n    id: string;\n    /** Title rendered as the entry headline. */\n    title: ReactNode;\n    /** Optional subtitle / description below the title. */\n    description?: ReactNode;\n    /** Right-aligned meta column (timestamps, durations). */\n    meta?: ReactNode;\n    /** Optional custom icon rendered inside the marker. */\n    icon?: ReactNode;\n    /** Marker color. Default `\"primary\"`. */\n    marker?: TimelineMarker;\n}\n\nexport interface TimelineProps extends HTMLAttributes<HTMLOListElement> {\n    items: TimelineItem[];\n    /** Show the connecting line between markers. Default `true`. */\n    connector?: boolean;\n}\n\n/**\n * Vertical event timeline — activity feeds, order trackers, audit logs.\n * Each entry has a marker (color or custom icon), title, optional\n * description and right-aligned meta column.\n *\n * @example\n * <Timeline items={[\n *     { id: \"1\", title: \"Pedido criado\", meta: \"10:24\", marker: \"primary\" },\n *     { id: \"2\", title: \"Aprovação\", meta: \"10:25\", marker: \"success\" },\n *     { id: \"3\", title: \"Saiu pra entrega\", meta: \"11:00\", marker: \"warning\" },\n * ]} />\n */\nexport function Timeline({ items, connector = true, className, ...props }: TimelineProps) {\n    return (\n        <ol className={cn(styles.timeline, connector && styles.connector, className)} {...props}>\n            {items.map((item, index) => {\n                const isLast = index === items.length - 1;\n                return (\n                    <li key={item.id} className={styles.item}>\n                        <div className={styles.markerColumn}>\n                            <span\n                                className={cn(\n                                    styles.marker,\n                                    styles[`marker-${item.marker ?? \"primary\"}`],\n                                )}\n                                aria-hidden=\"true\"\n                            >\n                                {item.icon}\n                            </span>\n                            {connector && !isLast && (\n                                <span className={styles.line} aria-hidden=\"true\" />\n                            )}\n                        </div>\n                        <div className={styles.body}>\n                            <div className={styles.row}>\n                                <span className={styles.title}>{item.title}</span>\n                                {item.meta && <span className={styles.meta}>{item.meta}</span>}\n                            </div>\n                            {item.description && (\n                                <p className={styles.description}>{item.description}</p>\n                            )}\n                        </div>\n                    </li>\n                );\n            })}\n        </ol>\n    );\n}\n"],"mappings":"4GAuCA,SAAgB,EAAS,CAAE,QAAO,YAAY,GAAM,YAAW,GAAG,GAAwB,CACtF,OACI,EAAA,EAAA,IAAA,CAAC,KAAD,CAAI,UAAW,EAAA,GAAG,EAAA,QAAO,SAAU,GAAa,EAAA,QAAO,UAAW,CAAS,EAAG,GAAI,EAC7E,SAAA,EAAM,KAAK,EAAM,IAAU,CACxB,IAAM,EAAS,IAAU,EAAM,OAAS,EACxC,OACI,EAAA,EAAA,KAAA,CAAC,KAAD,CAAkB,UAAW,EAAA,QAAO,KAApC,SAAA,EACI,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,aAAvB,SAAA,EACI,EAAA,EAAA,IAAA,CAAC,OAAD,CACI,UAAW,EAAA,GACP,EAAA,QAAO,OACP,EAAA,QAAO,UAAU,EAAK,QAAU,YACpC,EACA,cAAY,OAEX,SAAA,EAAK,IACJ,CAAA,EACL,GAAa,CAAC,IACX,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAM,cAAY,MAAQ,CAAA,CAErD,CACL,CAAA,GAAA,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,KAAvB,SAAA,EACI,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,IAAvB,SAAA,EACI,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAA,QAAO,MAAQ,SAAA,EAAK,KAAY,CAAA,EAChD,EAAK,OAAQ,EAAA,EAAA,IAAA,CAAC,OAAD,CAAM,UAAW,EAAA,QAAO,KAAO,SAAA,EAAK,IAAW,CAAA,CAC5D,CACJ,CAAA,EAAA,EAAK,cACF,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAW,EAAA,QAAO,YAAc,SAAA,EAAK,WAAe,CAAA,CAE1D,CACL,CAAA,CAAA,CAxBK,EAAA,EAAK,EAwBV,CAEZ,CAAC,CACD,CAAA,CAEZ"}