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 { useId } from 'react';
|
|
|
|
|
|
|
|
|
|
import { FlexBox } from '../../atoms/flex-box';
|
|
|
|
|
import { Typography } from '../../atoms/typography';
|
2026-10-05 15:00:21 +00:00
|
|
|
import { Dialog } from '../../atoms/dialog';
|
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 { Element } from '../../primitives/element';
|
|
|
|
|
import { cn } from '../../tools/cn';
|
|
|
|
|
import { SheetHead } from './components/SheetHead';
|
|
|
|
|
import { SheetPopover } from './components/SheetPopover';
|
|
|
|
|
import type { SheetProps } from './types';
|
|
|
|
|
import { sheetLayerVariants, sheetPanelVariants } from './variants';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* One surface in three placements: `bottom` for every mobile dialog, `side` for desktop detail
|
|
|
|
|
* panels, `popover` for desktop share and support. Render the same content in the mobile and
|
|
|
|
|
* desktop placement. Bottom and side panels take focus when they open; focus returns to the
|
|
|
|
|
* trigger when they close.
|
|
|
|
|
*/
|
|
|
|
|
export function Sheet({
|
|
|
|
|
placement = 'bottom',
|
|
|
|
|
open,
|
|
|
|
|
title,
|
|
|
|
|
icon,
|
|
|
|
|
children,
|
|
|
|
|
footer,
|
|
|
|
|
onClose,
|
feat(island,tools): form pieces for the profile step
- Atoms: Chip (toggle with aria-pressed), Checkbox, FieldError (alert line
under a group), LinkButton (a button that looks like a link; SupportLink now
uses it), RowButton (56px choice row for sheets), and a 96px Avatar size.
- Molecules: ChipGroup (named fieldset of chips with its error), FormSection
(titled form part with an optional marker and hint), AvatarField (photo
pick, change, remove, upload progress, failed state with retry).
- Dialog, Sheet and Modal take `onExited`, called once the dialog has left
the top layer. The page is inert until then, so focus moves there.
- tools/format: `time()` for a time of day in Tehran (`14:05`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:32:43 +00:00
|
|
|
onExited,
|
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
|
|
|
closeLabel,
|
|
|
|
|
dismissible = true,
|
|
|
|
|
alert,
|
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
|
|
|
popoverWidth,
|
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
|
|
|
className,
|
|
|
|
|
}: SheetProps) {
|
|
|
|
|
const titleId = useId();
|
|
|
|
|
|
|
|
|
|
if (placement === 'popover') {
|
|
|
|
|
return (
|
|
|
|
|
<SheetPopover
|
|
|
|
|
open={open}
|
|
|
|
|
title={title}
|
|
|
|
|
icon={icon}
|
|
|
|
|
footer={footer}
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
closeLabel={closeLabel}
|
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
|
|
|
width={popoverWidth}
|
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
|
|
|
className={className}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</SheetPopover>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Dialog
|
|
|
|
|
open={open}
|
|
|
|
|
onClose={onClose}
|
feat(island,tools): form pieces for the profile step
- Atoms: Chip (toggle with aria-pressed), Checkbox, FieldError (alert line
under a group), LinkButton (a button that looks like a link; SupportLink now
uses it), RowButton (56px choice row for sheets), and a 96px Avatar size.
- Molecules: ChipGroup (named fieldset of chips with its error), FormSection
(titled form part with an optional marker and hint), AvatarField (photo
pick, change, remove, upload progress, failed state with retry).
- Dialog, Sheet and Modal take `onExited`, called once the dialog has left
the top layer. The page is inert until then, so focus moves there.
- tools/format: `time()` for a time of day in Tehran (`14:05`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 18:32:43 +00:00
|
|
|
onExited={onExited}
|
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
|
|
|
dismissible={dismissible}
|
|
|
|
|
alert={alert}
|
|
|
|
|
labelledBy={titleId}
|
|
|
|
|
className={sheetLayerVariants({ placement })}
|
|
|
|
|
>
|
|
|
|
|
<FlexBox
|
|
|
|
|
data-dialog-panel=""
|
|
|
|
|
tabIndex={-1}
|
|
|
|
|
direction="flex-col"
|
|
|
|
|
className={cn(sheetPanelVariants({ placement }), className)}
|
|
|
|
|
>
|
|
|
|
|
{placement === 'bottom' && (
|
|
|
|
|
<Element
|
|
|
|
|
tag="span"
|
|
|
|
|
aria-hidden
|
|
|
|
|
className="mx-auto mb-2 h-1 w-9 flex-none rounded-full bg-border-strong"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
{icon && <Element className="mb-3">{icon}</Element>}
|
|
|
|
|
<SheetHead
|
|
|
|
|
title={title}
|
|
|
|
|
titleId={titleId}
|
|
|
|
|
onClose={onClose}
|
|
|
|
|
closeLabel={dismissible ? closeLabel : undefined}
|
|
|
|
|
/>
|
|
|
|
|
{children != null && (
|
|
|
|
|
// As Modal's body, so the same content reads the same on mobile and desktop.
|
|
|
|
|
<Typography tag="div" variant="body-md" className="[&>p]:mb-3">
|
|
|
|
|
{children}
|
|
|
|
|
</Typography>
|
|
|
|
|
)}
|
|
|
|
|
{footer && (
|
|
|
|
|
<FlexBox direction="flex-col" gap="gap-2" className="mt-5">
|
|
|
|
|
{footer}
|
|
|
|
|
</FlexBox>
|
|
|
|
|
)}
|
|
|
|
|
</FlexBox>
|
|
|
|
|
</Dialog>
|
|
|
|
|
);
|
|
|
|
|
}
|