@betterinternship/components 3.2.4 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,6 +5,12 @@ export declare const Timeline: ({ children, className }: {
|
|
|
5
5
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
interface TimelineItemProps {
|
|
7
7
|
number: number;
|
|
8
|
+
/**
|
|
9
|
+
* The step's state, shown in its circle: `done` is the green check (as
|
|
10
|
+
* `number={-1}`), `waiting` a yellow clock for the step it's currently
|
|
11
|
+
* waiting on. Otherwise the step's number.
|
|
12
|
+
*/
|
|
13
|
+
status?: 'done' | 'waiting';
|
|
8
14
|
title: string | React.ReactNode;
|
|
9
15
|
subtitle?: React.ReactNode;
|
|
10
16
|
isLast?: boolean;
|
|
@@ -13,5 +19,5 @@ interface TimelineItemProps {
|
|
|
13
19
|
isMe?: boolean;
|
|
14
20
|
className?: string;
|
|
15
21
|
}
|
|
16
|
-
export declare const TimelineItem: ({ number, title, subtitle, isLast, children, fromMe, isMe, className, }: TimelineItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const TimelineItem: ({ number, status, title, subtitle, isLast, children, fromMe, isMe, className, }: TimelineItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
23
|
export {};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { CheckIcon, MailWarningIcon } from 'lucide-react';
|
|
2
|
+
import { CheckIcon, ClockIcon, MailWarningIcon } from 'lucide-react';
|
|
3
3
|
import { Badge } from './badge.js';
|
|
4
4
|
import { cn } from '../utils.js';
|
|
5
5
|
|
|
6
6
|
const Timeline = ({ children, className }) => {
|
|
7
7
|
return jsx("div", { className: cn('w-full', className), children: children });
|
|
8
8
|
};
|
|
9
|
-
const TimelineItem = ({ number, title, subtitle, isLast = false, children, fromMe, isMe, className, }) => {
|
|
10
|
-
const isCheckmark = number === -1;
|
|
9
|
+
const TimelineItem = ({ number, status, title, subtitle, isLast = false, children, fromMe, isMe, className, }) => {
|
|
10
|
+
const isCheckmark = status === 'done' || number === -1;
|
|
11
|
+
const isWaiting = status === 'waiting' && !isCheckmark;
|
|
11
12
|
const isExclamation = fromMe;
|
|
12
|
-
return (jsxs("div", { className: cn('relative flex items-start gap-3', !isLast && 'pb-6', className), children: [jsxs("div", { className: "relative flex w-6 shrink-0 self-stretch justify-center", children: [isCheckmark ? (jsx("div", { className: "relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-supportive text-supportive-foreground", children: jsx(CheckIcon, { className: "size-3.5", "aria-hidden": "true" }) })) : isExclamation ? (jsx("div", { className: "relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-primary text-xs font-semibold text-primary-foreground", children: jsx(MailWarningIcon, { className: "size-3.5", "aria-hidden": "true" }) })) : (jsx("div", { className: "relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground", children: number })), !isLast && jsx("div", { "aria-hidden": "true", className: "absolute -bottom-5 top-7 w-px bg-border" })] }), jsxs("div", { className: "flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2", children: [jsxs("div", { className: "min-w-0 flex-1", children: [jsxs("div", { className: "flex min-h-6 flex-wrap items-center gap-2", children: [fromMe ? (jsx("div", { className: "text-sm font-semibold text-primary", children: title })) : (jsx("div", { className: "text-sm font-medium text-foreground", children: title })), isMe && (jsx(Badge, { variant: "solid", type: "secondary", children: "You" }))] }), subtitle && (jsx("div", { className: "
|
|
13
|
+
return (jsxs("div", { className: cn('relative flex items-start gap-3', !isLast && 'pb-6', className), children: [jsxs("div", { className: "relative flex w-6 shrink-0 self-stretch justify-center", children: [isCheckmark ? (jsx("div", { className: "relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-supportive text-supportive-foreground", children: jsx(CheckIcon, { className: "size-3.5", "aria-hidden": "true" }) })) : isWaiting ? (jsx("div", { className: "relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-warning text-warning-foreground", children: jsx(ClockIcon, { className: "size-3.5", "aria-hidden": "true" }) })) : isExclamation ? (jsx("div", { className: "relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-primary text-xs font-semibold text-primary-foreground", children: jsx(MailWarningIcon, { className: "size-3.5", "aria-hidden": "true" }) })) : (jsx("div", { className: "relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground", children: number })), !isLast && jsx("div", { "aria-hidden": "true", className: "absolute -bottom-5 top-7 w-px bg-border" })] }), jsxs("div", { className: "flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2", children: [jsxs("div", { className: "min-w-0 flex-1", children: [jsxs("div", { className: "flex min-h-6 flex-wrap items-center gap-2", children: [fromMe ? (jsx("div", { className: "text-sm font-semibold text-primary", children: title })) : (jsx("div", { className: "text-sm font-medium text-foreground", children: title })), isMe && (jsx(Badge, { variant: "solid", type: "secondary", children: "You" }))] }), subtitle && (jsx("div", { className: "text-sm leading-snug text-muted-foreground", children: subtitle }))] }), children && jsx("div", { className: "flex min-h-6 shrink-0 items-center", children: children })] })] }));
|
|
13
14
|
};
|
|
14
15
|
|
|
15
16
|
export { Timeline, TimelineItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.js","sources":["../../src/components/timeline.tsx"],"sourcesContent":["import React from \"react\";\nimport { CheckIcon, MailWarningIcon } from \"lucide-react\";\nimport { Badge } from './badge';\nimport { cn } from '@/utils';\n\nexport const Timeline = ({ children, className }: { children: React.ReactNode; className?: string }) => {\n return <div className={cn('w-full', className)}>{children}</div>;\n};\n\ninterface TimelineItemProps {\n number: number;\n title: string | React.ReactNode;\n subtitle?: React.ReactNode;\n isLast?: boolean;\n children?: React.ReactNode;\n fromMe?: boolean;\n isMe?: boolean;\n className?: string;\n}\n\nexport const TimelineItem = ({\n number,\n title,\n subtitle,\n isLast = false,\n children,\n fromMe,\n isMe,\n className,\n}: TimelineItemProps) => {\n const isCheckmark = number === -1;\n const isExclamation = fromMe;\n\n return (\n <div className={cn('relative flex items-start gap-3', !isLast && 'pb-6', className)}>\n <div className=\"relative flex w-6 shrink-0 self-stretch justify-center\">\n {isCheckmark ? (\n <div className=\"relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-supportive text-supportive-foreground\">\n <CheckIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </div>\n ) : isExclamation ? (\n <div className=\"relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-primary text-xs font-semibold text-primary-foreground\">\n <MailWarningIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </div>\n ) : (\n <div className=\"relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground\">\n {number}\n </div>\n )}\n {!isLast && <div aria-hidden=\"true\" className=\"absolute -bottom-5 top-7 w-px bg-border\" />}\n </div>\n\n {/* Content */}\n <div className=\"flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-h-6 flex-wrap items-center gap-2\">\n {fromMe ? (\n <div className=\"text-sm font-semibold text-primary\">{title}</div>\n ) : (\n <div className=\"text-sm font-medium text-foreground\">{title}</div>\n )}\n {isMe && (\n <Badge variant=\"solid\" type=\"secondary\">\n You\n </Badge>\n )}\n </div>\n {subtitle && (\n <div className=\"
|
|
1
|
+
{"version":3,"file":"timeline.js","sources":["../../src/components/timeline.tsx"],"sourcesContent":["import React from \"react\";\nimport { CheckIcon, ClockIcon, MailWarningIcon } from \"lucide-react\";\nimport { Badge } from './badge';\nimport { cn } from '@/utils';\n\nexport const Timeline = ({ children, className }: { children: React.ReactNode; className?: string }) => {\n return <div className={cn('w-full', className)}>{children}</div>;\n};\n\ninterface TimelineItemProps {\n number: number;\n /**\n * The step's state, shown in its circle: `done` is the green check (as\n * `number={-1}`), `waiting` a yellow clock for the step it's currently\n * waiting on. Otherwise the step's number.\n */\n status?: 'done' | 'waiting';\n title: string | React.ReactNode;\n subtitle?: React.ReactNode;\n isLast?: boolean;\n children?: React.ReactNode;\n fromMe?: boolean;\n isMe?: boolean;\n className?: string;\n}\n\nexport const TimelineItem = ({\n number,\n status,\n title,\n subtitle,\n isLast = false,\n children,\n fromMe,\n isMe,\n className,\n}: TimelineItemProps) => {\n const isCheckmark = status === 'done' || number === -1;\n const isWaiting = status === 'waiting' && !isCheckmark;\n const isExclamation = fromMe;\n\n return (\n <div className={cn('relative flex items-start gap-3', !isLast && 'pb-6', className)}>\n <div className=\"relative flex w-6 shrink-0 self-stretch justify-center\">\n {isCheckmark ? (\n <div className=\"relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-supportive text-supportive-foreground\">\n <CheckIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </div>\n ) : isWaiting ? (\n <div className=\"relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-warning text-warning-foreground\">\n <ClockIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </div>\n ) : isExclamation ? (\n <div className=\"relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full bg-primary text-xs font-semibold text-primary-foreground\">\n <MailWarningIcon className=\"size-3.5\" aria-hidden=\"true\" />\n </div>\n ) : (\n <div className=\"relative z-10 flex size-6 shrink-0 items-center justify-center rounded-full border border-input bg-muted text-xs font-semibold text-muted-foreground\">\n {number}\n </div>\n )}\n {!isLast && <div aria-hidden=\"true\" className=\"absolute -bottom-5 top-7 w-px bg-border\" />}\n </div>\n\n {/* Content */}\n <div className=\"flex min-w-0 flex-1 flex-wrap items-start justify-between gap-x-3 gap-y-2\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-h-6 flex-wrap items-center gap-2\">\n {fromMe ? (\n <div className=\"text-sm font-semibold text-primary\">{title}</div>\n ) : (\n <div className=\"text-sm font-medium text-foreground\">{title}</div>\n )}\n {isMe && (\n <Badge variant=\"solid\" type=\"secondary\">\n You\n </Badge>\n )}\n </div>\n {/* Snug under the title: a one-line detail (an email, a name), not\n prose, so it shouldn't float with prose leading. */}\n {subtitle && (\n <div className=\"text-sm leading-snug text-muted-foreground\">{subtitle}</div>\n )}\n </div>\n {children && <div className=\"flex min-h-6 shrink-0 items-center\">{children}</div>}\n </div>\n </div>\n );\n};\n"],"names":["_jsx","_jsxs"],"mappings":";;;;;AAKO,MAAM,QAAQ,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAqD,KAAI;AACrG,IAAA,OAAOA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO;AAClE;AAmBO,MAAM,YAAY,GAAG,CAAC,EAC3B,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,EACR,MAAM,GAAG,KAAK,EACd,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,SAAS,GACS,KAAI;IACtB,MAAM,WAAW,GAAG,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,EAAE;IACtD,MAAM,SAAS,GAAG,MAAM,KAAK,SAAS,IAAI,CAAC,WAAW;IACtD,MAAM,aAAa,GAAG,MAAM;IAE5B,QACEC,cAAK,SAAS,EAAE,EAAE,CAAC,iCAAiC,EAAE,CAAC,MAAM,IAAI,MAAM,EAAE,SAAS,CAAC,EAAA,QAAA,EAAA,CACjFA,cAAK,SAAS,EAAC,wDAAwD,EAAA,QAAA,EAAA,CACpE,WAAW,IACVD,aAAK,SAAS,EAAC,sHAAsH,EAAA,QAAA,EACnIA,GAAA,CAAC,SAAS,EAAA,EAAC,SAAS,EAAC,UAAU,EAAA,aAAA,EAAa,MAAM,EAAA,CAAG,EAAA,CACjD,IACJ,SAAS,IACXA,GAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,gHAAgH,YAC7HA,GAAA,CAAC,SAAS,IA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