forked from koshikraj/ottopus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathink-hold.tsx
More file actions
84 lines (78 loc) · 2.53 KB
/
Copy pathink-hold.tsx
File metadata and controls
84 lines (78 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
'use client'
import { OttoBadge } from '@/components/brand'
import { cn } from '@/lib/cn'
export interface InkHoldProps {
title: string
/** Mono, because it is usually a count and an estimate. */
detail?: string
/**
* The escape. The design says always offer one — a screen someone cannot
* leave is a screen that gets reloaded.
*/
onEscape?: () => void
escapeLabel?: string
className?: string
}
/**
* L6 · Ink hold — for a wait you cannot cancel but can leave.
*
* Navy ground, and the only dark loader in the system: it signals that the
* thing is settled elsewhere now, on a chain, out of the app's hands. Always
* offer the way out — a screen someone cannot leave is a screen that has to be
* reloaded.
*/
export function InkHold({
title,
detail,
onEscape,
escapeLabel = 'Run in background',
className,
}: InkHoldProps) {
return (
<div
role="status"
className={cn(
'relative flex flex-col items-center justify-center gap-[14px] overflow-hidden',
'rounded-[14px] bg-[var(--ot-navy)] px-6 py-10 text-[var(--ot-cream)]',
className,
)}
>
{[0, 1.4].map((delay) => (
<span
key={delay}
aria-hidden
className="ot-ink-ripple absolute h-[74px] w-[74px] rounded-full"
style={{
background: 'rgba(255,240,220,.10)',
top: 'calc(50% - 68px)',
animationDelay: `${delay}s`,
}}
/>
))}
<div className="ot-ink-pulse relative">
<OttoBadge mono monoColor="var(--ot-cream)" size={52} animate="idle" />
</div>
<div className="relative flex flex-col items-center gap-[6px] text-center">
<p className="font-display m-0 text-[17px] font-bold">{title}</p>
{detail ? (
<p className="m-0 font-mono text-[12px] text-[rgba(255,240,220,.62)]">{detail}</p>
) : null}
</div>
{onEscape ? (
// Styled here rather than passed in: this is the one dark surface in
// the system, and every button variant we have assumes a light ground.
<button
type="button"
onClick={onEscape}
className={
'relative cursor-pointer rounded-[var(--ot-radius-pill)] border border-[rgba(255,240,220,0.3)] ' +
'px-[15px] py-[7px] text-[13px] font-semibold text-[var(--ot-cream)] ' +
'transition-colors duration-[var(--ot-dur-fast)] hover:bg-[rgba(255,240,220,0.08)]'
}
>
{escapeLabel}
</button>
) : null}
</div>
)
}