feat(island): sync components with the Lumina design system
New components:
- Lightbox, NetworkStatus (+ useOnline), TierOption, SkeletonPreset
Rebuilt to the design system:
- PredictionCard: range bar, open KPIs, closed hero, price ladder, horizon progress, seal, locked veil
- CreatorStats: form curve, outcome split, KPI tiles, insights and streak; null renders nothing
- PostCard, LockedTeaser, MediaCarousel: owner action rules, expanded variant, viewer CTA, locked order
- SubscriptionCard: active/suspended/expired/refunded, compact density, amount and support rows
- Countdown, ResendCode, OtpInput: absolute end times, DS wording and thresholds, WebOTP
Fixes:
- Dialog: waits only for finite exit animations, keeps non-dismissible halts open, focuses the
panel, closes on scrim presses only, mounts the panel only while open
- Toaster: moves its region into the open dialog so toasts show and stay tappable over sheets
- Button: blocked submit, frozen cursor, loading links; TextInput focus border; Card, Banner,
ChoiceCard, StepProgress, ErrorState, Amount and Avatar details
- Tokens: muted status tracks, inverse controls, scrim chip, inverse and lightbox focus rings;
the spinner keeps turning under reduced motion
Adds sonner and svgo; island gets the icons target and the hooks subpath.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:23:59 +00:00
|
|
|
import { Typography } from '../../../atoms/typography';
|
|
|
|
|
import type { PredictionBodyProps } from '../types';
|
|
|
|
|
import {
|
|
|
|
|
nowTime,
|
|
|
|
|
predictionMath,
|
|
|
|
|
resolveOutcome,
|
|
|
|
|
resolveStatus,
|
|
|
|
|
toTime,
|
|
|
|
|
} from '../utils';
|
|
|
|
|
import { ClosedHero } from './ClosedHero';
|
|
|
|
|
import { HorizonProgress } from './HorizonProgress';
|
|
|
|
|
import { OpenKpis } from './OpenKpis';
|
|
|
|
|
import { PredictionBadges } from './PredictionBadges';
|
|
|
|
|
import { PredictionHead } from './PredictionHead';
|
|
|
|
|
import { PredictionLadder } from './PredictionLadder';
|
|
|
|
|
import { PredictionLevels } from './PredictionLevels';
|
|
|
|
|
import { PredictionMeta } from './PredictionMeta';
|
2026-10-10 09:29:48 +00:00
|
|
|
import { PendingCloseRow } from './PendingCloseRow';
|
feat(island): sync components with the Lumina design system
New components:
- Lightbox, NetworkStatus (+ useOnline), TierOption, SkeletonPreset
Rebuilt to the design system:
- PredictionCard: range bar, open KPIs, closed hero, price ladder, horizon progress, seal, locked veil
- CreatorStats: form curve, outcome split, KPI tiles, insights and streak; null renders nothing
- PostCard, LockedTeaser, MediaCarousel: owner action rules, expanded variant, viewer CTA, locked order
- SubscriptionCard: active/suspended/expired/refunded, compact density, amount and support rows
- Countdown, ResendCode, OtpInput: absolute end times, DS wording and thresholds, WebOTP
Fixes:
- Dialog: waits only for finite exit animations, keeps non-dismissible halts open, focuses the
panel, closes on scrim presses only, mounts the panel only while open
- Toaster: moves its region into the open dialog so toasts show and stay tappable over sheets
- Button: blocked submit, frozen cursor, loading links; TextInput focus border; Card, Banner,
ChoiceCard, StepProgress, ErrorState, Amount and Avatar details
- Tokens: muted status tracks, inverse controls, scrim chip, inverse and lightbox focus rings;
the spinner keeps turning under reduced motion
Adds sonner and svgo; island gets the icons target and the hooks subpath.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:23:59 +00:00
|
|
|
import { PredictionRange } from './PredictionRange';
|
|
|
|
|
|
|
|
|
|
/** Header, hero, range bar, then the levels (compact) or the ladder, progress and caption (expanded). */
|
|
|
|
|
export function PredictionBody({
|
|
|
|
|
prediction: data,
|
2026-10-10 09:29:48 +00:00
|
|
|
pendingClose,
|
feat(island,tools): share popover, 360 sheet popover, form section and avatar field options, switch frozen track, prediction card link, select, list row, tab links and info tip options, body-compact and stat type tokens, button document reload, list formatting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:34:24 +00:00
|
|
|
href,
|
feat(island): sync components with the Lumina design system
New components:
- Lightbox, NetworkStatus (+ useOnline), TierOption, SkeletonPreset
Rebuilt to the design system:
- PredictionCard: range bar, open KPIs, closed hero, price ladder, horizon progress, seal, locked veil
- CreatorStats: form curve, outcome split, KPI tiles, insights and streak; null renders nothing
- PostCard, LockedTeaser, MediaCarousel: owner action rules, expanded variant, viewer CTA, locked order
- SubscriptionCard: active/suspended/expired/refunded, compact density, amount and support rows
- Countdown, ResendCode, OtpInput: absolute end times, DS wording and thresholds, WebOTP
Fixes:
- Dialog: waits only for finite exit animations, keeps non-dismissible halts open, focuses the
panel, closes on scrim presses only, mounts the panel only while open
- Toaster: moves its region into the open dialog so toasts show and stay tappable over sheets
- Button: blocked submit, frozen cursor, loading links; TextInput focus border; Card, Banner,
ChoiceCard, StepProgress, ErrorState, Amount and Avatar details
- Tokens: muted status tracks, inverse controls, scrim chip, inverse and lightbox focus rings;
the spinner keeps turning under reduced motion
Adds sonner and svgo; island gets the icons target and the hooks subpath.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:23:59 +00:00
|
|
|
expanded,
|
|
|
|
|
premium,
|
|
|
|
|
caption,
|
|
|
|
|
publishedAt,
|
|
|
|
|
now,
|
|
|
|
|
labels,
|
|
|
|
|
}: PredictionBodyProps) {
|
|
|
|
|
const math = predictionMath(data);
|
|
|
|
|
const isOpen = resolveStatus(data) === 'open';
|
|
|
|
|
const prediction = { ...data, outcome: resolveOutcome(data, math.roi) };
|
|
|
|
|
const { symbol, market, expiresAt, closedAt, outcome } = prediction;
|
|
|
|
|
const nowMs = nowTime(now);
|
|
|
|
|
const secondsLeft =
|
|
|
|
|
isOpen && expiresAt != null ? (toTime(expiresAt) - nowMs) / 1000 : 0;
|
|
|
|
|
const part = { prediction, math, labels };
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
<PredictionHead
|
feat(island,tools): share popover, 360 sheet popover, form section and avatar field options, switch frozen track, prediction card link, select, list row, tab links and info tip options, body-compact and stat type tokens, button document reload, list formatting
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 15:34:24 +00:00
|
|
|
href={href}
|
feat(island): sync components with the Lumina design system
New components:
- Lightbox, NetworkStatus (+ useOnline), TierOption, SkeletonPreset
Rebuilt to the design system:
- PredictionCard: range bar, open KPIs, closed hero, price ladder, horizon progress, seal, locked veil
- CreatorStats: form curve, outcome split, KPI tiles, insights and streak; null renders nothing
- PostCard, LockedTeaser, MediaCarousel: owner action rules, expanded variant, viewer CTA, locked order
- SubscriptionCard: active/suspended/expired/refunded, compact density, amount and support rows
- Countdown, ResendCode, OtpInput: absolute end times, DS wording and thresholds, WebOTP
Fixes:
- Dialog: waits only for finite exit animations, keeps non-dismissible halts open, focuses the
panel, closes on scrim presses only, mounts the panel only while open
- Toaster: moves its region into the open dialog so toasts show and stay tappable over sheets
- Button: blocked submit, frozen cursor, loading links; TextInput focus border; Card, Banner,
ChoiceCard, StepProgress, ErrorState, Amount and Avatar details
- Tokens: muted status tracks, inverse controls, scrim chip, inverse and lightbox focus rings;
the spinner keeps turning under reduced motion
Adds sonner and svgo; island gets the icons target and the hooks subpath.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:23:59 +00:00
|
|
|
title={
|
|
|
|
|
<>
|
|
|
|
|
<Typography
|
|
|
|
|
tag="bdi"
|
|
|
|
|
dir="ltr"
|
|
|
|
|
variant={expanded ? 'heading-md' : 'heading-sm'}
|
|
|
|
|
className="font-bold tracking-[0.01em]"
|
|
|
|
|
>
|
|
|
|
|
{symbol}
|
|
|
|
|
</Typography>
|
|
|
|
|
{market != null && (
|
|
|
|
|
<Typography tag="span" variant="caption" color="secondary">
|
|
|
|
|
{market}
|
|
|
|
|
</Typography>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
meta={
|
|
|
|
|
<PredictionMeta
|
|
|
|
|
prediction={prediction}
|
|
|
|
|
secondsLeft={secondsLeft > 0 ? secondsLeft : null}
|
|
|
|
|
labels={labels}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
badges={
|
|
|
|
|
<PredictionBadges
|
|
|
|
|
status={isOpen ? 'open' : 'closed'}
|
|
|
|
|
outcome={outcome}
|
|
|
|
|
premium={premium}
|
|
|
|
|
labels={labels}
|
|
|
|
|
/>
|
|
|
|
|
}
|
|
|
|
|
/>
|
2026-10-10 09:29:48 +00:00
|
|
|
{isOpen && pendingClose != null && labels.pendingClose != null && (
|
|
|
|
|
<PendingCloseRow title={labels.pendingClose}>
|
|
|
|
|
{pendingClose}
|
|
|
|
|
</PendingCloseRow>
|
|
|
|
|
)}
|
feat(island): sync components with the Lumina design system
New components:
- Lightbox, NetworkStatus (+ useOnline), TierOption, SkeletonPreset
Rebuilt to the design system:
- PredictionCard: range bar, open KPIs, closed hero, price ladder, horizon progress, seal, locked veil
- CreatorStats: form curve, outcome split, KPI tiles, insights and streak; null renders nothing
- PostCard, LockedTeaser, MediaCarousel: owner action rules, expanded variant, viewer CTA, locked order
- SubscriptionCard: active/suspended/expired/refunded, compact density, amount and support rows
- Countdown, ResendCode, OtpInput: absolute end times, DS wording and thresholds, WebOTP
Fixes:
- Dialog: waits only for finite exit animations, keeps non-dismissible halts open, focuses the
panel, closes on scrim presses only, mounts the panel only while open
- Toaster: moves its region into the open dialog so toasts show and stay tappable over sheets
- Button: blocked submit, frozen cursor, loading links; TextInput focus border; Card, Banner,
ChoiceCard, StepProgress, ErrorState, Amount and Avatar details
- Tokens: muted status tracks, inverse controls, scrim chip, inverse and lightbox focus rings;
the spinner keeps turning under reduced motion
Adds sonner and svgo; island gets the icons target and the hooks subpath.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 13:23:59 +00:00
|
|
|
{!isOpen && math.roi != null ? (
|
|
|
|
|
<ClosedHero
|
|
|
|
|
{...part}
|
|
|
|
|
expanded={expanded}
|
|
|
|
|
heldMs={
|
|
|
|
|
closedAt != null ? toTime(closedAt) - toTime(publishedAt) : null
|
|
|
|
|
}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
|
|
|
|
<OpenKpis {...part} />
|
|
|
|
|
)}
|
|
|
|
|
<PredictionRange {...part} expanded={expanded} />
|
|
|
|
|
{expanded ? (
|
|
|
|
|
<PredictionLadder {...part} />
|
|
|
|
|
) : (
|
|
|
|
|
<PredictionLevels {...part} />
|
|
|
|
|
)}
|
|
|
|
|
{expanded && isOpen && expiresAt != null && (
|
|
|
|
|
<HorizonProgress
|
|
|
|
|
publishedAt={publishedAt}
|
|
|
|
|
expiresAt={expiresAt}
|
|
|
|
|
nowMs={nowMs}
|
|
|
|
|
labels={labels}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
{expanded && caption != null && (
|
|
|
|
|
<Typography
|
|
|
|
|
tag="div"
|
|
|
|
|
className="rounded-md bg-surface-sunken px-4 py-3 break-words whitespace-pre-wrap"
|
|
|
|
|
>
|
|
|
|
|
{caption}
|
|
|
|
|
</Typography>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
}
|