@vercel/geistdocs 1.4.1 → 1.6.0
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.
- package/dist/assets/logos/logo-ai-elements.d.ts +0 -3
- package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -1
- package/dist/assets/logos/logo-ai-elements.js +0 -3
- package/dist/assets/logos/logo-ai-sdk.d.ts +0 -3
- package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -1
- package/dist/assets/logos/logo-ai-sdk.js +0 -3
- package/dist/assets/logos/logo-chat-sdk.d.ts +0 -3
- package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -1
- package/dist/assets/logos/logo-chat-sdk.js +0 -3
- package/dist/assets/logos/logo-flags-sdk.d.ts +0 -3
- package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -1
- package/dist/assets/logos/logo-flags-sdk.js +0 -3
- package/dist/assets/logos/logo-icon-vercel.d.ts +0 -4
- package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -1
- package/dist/assets/logos/logo-icon-vercel.js +0 -4
- package/dist/assets/logos/logo-nextjs.d.ts +0 -3
- package/dist/assets/logos/logo-nextjs.d.ts.map +1 -1
- package/dist/assets/logos/logo-nextjs.js +5 -4
- package/dist/assets/logos/logo-streamdown.d.ts +0 -3
- package/dist/assets/logos/logo-streamdown.d.ts.map +1 -1
- package/dist/assets/logos/logo-streamdown.js +0 -3
- package/dist/assets/logos/logo-svelte-kit.d.ts.map +1 -1
- package/dist/assets/logos/logo-svelte-kit.js +1 -1
- package/dist/assets/logos/logo-vercel-oss.d.ts +0 -3
- package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -1
- package/dist/assets/logos/logo-vercel-oss.js +0 -3
- package/dist/assets/logos/logo-workflow-sdk.d.ts +0 -3
- package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -1
- package/dist/assets/logos/logo-workflow-sdk.js +0 -3
- package/dist/cli/index.js +1 -1
- package/dist/components/badge.d.ts +11 -0
- package/dist/components/badge.d.ts.map +1 -0
- package/dist/components/badge.js +22 -0
- package/dist/components/code-block.d.ts.map +1 -1
- package/dist/components/code-block.js +32 -3
- package/dist/components/command-prompt.d.ts +33 -0
- package/dist/components/command-prompt.d.ts.map +1 -0
- package/dist/components/command-prompt.js +217 -0
- package/dist/controls.d.ts.map +1 -1
- package/dist/controls.js +3 -3
- package/dist/versions.js +1 -1
- package/docs/agents.md +1 -1
- package/docs/llms.txt +27 -1
- package/docs/manifest.json +1 -1
- package/docs/pages/syntax.md +26 -0
- package/package.json +9 -1
- package/template/app/[lang]/(home)/components/hero.tsx +1 -1
- package/template/app/[lang]/(home)/page.tsx +2 -2
- package/template/content/docs/syntax.mdx +26 -0
- package/template/package.json +1 -1
- package/template/components/ui/badge.tsx +0 -46
- package/template/components/ui/command-prompt.tsx +0 -488
|
@@ -1,488 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
|
|
4
|
-
import {
|
|
5
|
-
Children,
|
|
6
|
-
type ComponentPropsWithoutRef,
|
|
7
|
-
createContext,
|
|
8
|
-
isValidElement,
|
|
9
|
-
type JSX,
|
|
10
|
-
type ReactNode,
|
|
11
|
-
useContext,
|
|
12
|
-
useEffect,
|
|
13
|
-
useLayoutEffect,
|
|
14
|
-
useRef,
|
|
15
|
-
useState,
|
|
16
|
-
} from "react";
|
|
17
|
-
import { IconCheck } from "@vercel/geistdocs/assets/icons/icon-check";
|
|
18
|
-
import { IconCopy } from "@vercel/geistdocs/assets/icons/icon-copy";
|
|
19
|
-
import { cn } from "@/lib/utils";
|
|
20
|
-
|
|
21
|
-
type CommandPromptContextValue = {
|
|
22
|
-
value: string;
|
|
23
|
-
setValue: (value: string) => void;
|
|
24
|
-
copied: boolean;
|
|
25
|
-
copyActiveValue: () => void;
|
|
26
|
-
activeCopyValue: string;
|
|
27
|
-
setActiveCopyValue: (value: string) => void;
|
|
28
|
-
commandWidth?: number;
|
|
29
|
-
setCommandWidth: (value: number | undefined) => void;
|
|
30
|
-
isOverflowing: boolean;
|
|
31
|
-
setIsOverflowing: (value: boolean) => void;
|
|
32
|
-
canShowGradient: boolean;
|
|
33
|
-
setCanShowGradient: (value: boolean) => void;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const CommandPromptContext = createContext<CommandPromptContextValue | null>(
|
|
37
|
-
null
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
function useCommandPromptContext(component: string) {
|
|
41
|
-
const context = useContext(CommandPromptContext);
|
|
42
|
-
|
|
43
|
-
if (!context) {
|
|
44
|
-
throw new Error(`${component} must be used within CommandPrompt.Root`);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return context;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
type CommandPromptRootProps = Omit<
|
|
51
|
-
ComponentPropsWithoutRef<"div">,
|
|
52
|
-
"onChange"
|
|
53
|
-
> & {
|
|
54
|
-
value?: string;
|
|
55
|
-
defaultValue?: string;
|
|
56
|
-
onValueChange?: (value: string) => void;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
export function CommandPromptRoot({
|
|
60
|
-
value: valueProp,
|
|
61
|
-
defaultValue,
|
|
62
|
-
onValueChange,
|
|
63
|
-
className,
|
|
64
|
-
children,
|
|
65
|
-
...props
|
|
66
|
-
}: CommandPromptRootProps): JSX.Element {
|
|
67
|
-
const [uncontrolledValue, setUncontrolledValue] = useState(
|
|
68
|
-
defaultValue ?? ""
|
|
69
|
-
);
|
|
70
|
-
const [copied, setCopied] = useState(false);
|
|
71
|
-
const [activeCopyValue, setActiveCopyValue] = useState("");
|
|
72
|
-
const [commandWidth, setCommandWidth] = useState<number>();
|
|
73
|
-
const [isOverflowing, setIsOverflowing] = useState(false);
|
|
74
|
-
const [canShowGradient, setCanShowGradient] = useState(true);
|
|
75
|
-
const timeoutRef = useRef<ReturnType<typeof setTimeout>>(null);
|
|
76
|
-
const value = valueProp ?? uncontrolledValue;
|
|
77
|
-
|
|
78
|
-
useEffect(() => {
|
|
79
|
-
return () => {
|
|
80
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
81
|
-
};
|
|
82
|
-
}, []);
|
|
83
|
-
|
|
84
|
-
function resetCopiedState() {
|
|
85
|
-
setCopied(false);
|
|
86
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function setValue(nextValue: string) {
|
|
90
|
-
if (valueProp === undefined) {
|
|
91
|
-
setUncontrolledValue(nextValue);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
resetCopiedState();
|
|
95
|
-
onValueChange?.(nextValue);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function copyActiveValue() {
|
|
99
|
-
if (!activeCopyValue) return;
|
|
100
|
-
|
|
101
|
-
void navigator.clipboard.writeText(activeCopyValue);
|
|
102
|
-
setCopied(true);
|
|
103
|
-
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
104
|
-
timeoutRef.current = setTimeout(() => setCopied(false), 1000);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
return (
|
|
108
|
-
<CommandPromptContext.Provider
|
|
109
|
-
value={{
|
|
110
|
-
value,
|
|
111
|
-
setValue,
|
|
112
|
-
copied,
|
|
113
|
-
copyActiveValue,
|
|
114
|
-
activeCopyValue,
|
|
115
|
-
setActiveCopyValue,
|
|
116
|
-
commandWidth,
|
|
117
|
-
setCommandWidth,
|
|
118
|
-
isOverflowing,
|
|
119
|
-
setIsOverflowing,
|
|
120
|
-
canShowGradient,
|
|
121
|
-
setCanShowGradient,
|
|
122
|
-
}}
|
|
123
|
-
>
|
|
124
|
-
<div
|
|
125
|
-
className={cn("w-full flex items-center flex-col gap-2", className)}
|
|
126
|
-
{...props}
|
|
127
|
-
>
|
|
128
|
-
{children}
|
|
129
|
-
</div>
|
|
130
|
-
</CommandPromptContext.Provider>
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export function CommandPromptList({
|
|
135
|
-
className,
|
|
136
|
-
...props
|
|
137
|
-
}: ComponentPropsWithoutRef<"div">): JSX.Element {
|
|
138
|
-
return <div className={cn("flex items-center", className)} {...props} />;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
type CommandPromptTriggerProps = ComponentPropsWithoutRef<"button"> & {
|
|
142
|
-
value: string;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
export function CommandPromptTrigger({
|
|
146
|
-
value,
|
|
147
|
-
className,
|
|
148
|
-
onClick,
|
|
149
|
-
children,
|
|
150
|
-
...props
|
|
151
|
-
}: CommandPromptTriggerProps): JSX.Element {
|
|
152
|
-
const context = useCommandPromptContext("CommandPrompt.Trigger");
|
|
153
|
-
const active = context.value === value;
|
|
154
|
-
|
|
155
|
-
return (
|
|
156
|
-
<button
|
|
157
|
-
aria-pressed={active}
|
|
158
|
-
className={cn(
|
|
159
|
-
"cursor-pointer text-gray-900 hover:text-gray-1000 px-3 py-2",
|
|
160
|
-
"text-label-13! font-medium! touch-manipulation border-none bg-transparent rounded-sm",
|
|
161
|
-
"outline outline-2 outline-offset-2 outline-transparent focus-visible:outline-[var(--ds-focus-color)]",
|
|
162
|
-
"text-gray-900 data-[active]:text-gray-1000 data-[active]:font-medium",
|
|
163
|
-
"flex gap-1.5 items-center whitespace-nowrap",
|
|
164
|
-
className
|
|
165
|
-
)}
|
|
166
|
-
data-active={active ? "" : undefined}
|
|
167
|
-
onClick={(event) => {
|
|
168
|
-
onClick?.(event);
|
|
169
|
-
if (event.defaultPrevented) return;
|
|
170
|
-
context.setValue(value);
|
|
171
|
-
}}
|
|
172
|
-
type="button"
|
|
173
|
-
{...props}
|
|
174
|
-
>
|
|
175
|
-
{children}
|
|
176
|
-
</button>
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export function CommandPromptTriggerDivider({
|
|
181
|
-
className,
|
|
182
|
-
...props
|
|
183
|
-
}: ComponentPropsWithoutRef<"div">): JSX.Element {
|
|
184
|
-
return (
|
|
185
|
-
<div
|
|
186
|
-
aria-hidden
|
|
187
|
-
className={cn("w-px h-3 bg-gray-400", className)}
|
|
188
|
-
{...props}
|
|
189
|
-
/>
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
export function CommandPromptSurface({
|
|
194
|
-
className,
|
|
195
|
-
onClick,
|
|
196
|
-
children,
|
|
197
|
-
}: {
|
|
198
|
-
className?: string;
|
|
199
|
-
children: ReactNode;
|
|
200
|
-
onClick?: ComponentPropsWithoutRef<"div">["onClick"];
|
|
201
|
-
}): JSX.Element {
|
|
202
|
-
const context = useCommandPromptContext("CommandPrompt.Surface");
|
|
203
|
-
const shouldReduceMotion = useReducedMotion();
|
|
204
|
-
|
|
205
|
-
return (
|
|
206
|
-
<motion.div
|
|
207
|
-
className={cn(
|
|
208
|
-
"relative flex items-center group gap-1 material-small transition-colors pl-5 py-2 pr-3 max-w-[calc(100vw-48px)] rounded-full",
|
|
209
|
-
className
|
|
210
|
-
)}
|
|
211
|
-
layout
|
|
212
|
-
onClick={(event) => {
|
|
213
|
-
onClick?.(event);
|
|
214
|
-
if (event.defaultPrevented) return;
|
|
215
|
-
if (window.getSelection()?.toString()) return;
|
|
216
|
-
context.copyActiveValue();
|
|
217
|
-
}}
|
|
218
|
-
transition={
|
|
219
|
-
shouldReduceMotion
|
|
220
|
-
? { duration: 0 }
|
|
221
|
-
: { type: "spring", bounce: 0, duration: 0.4 }
|
|
222
|
-
}
|
|
223
|
-
>
|
|
224
|
-
{children}
|
|
225
|
-
</motion.div>
|
|
226
|
-
);
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
export function CommandPromptPrefix({
|
|
230
|
-
className,
|
|
231
|
-
...props
|
|
232
|
-
}: ComponentPropsWithoutRef<"span">): JSX.Element {
|
|
233
|
-
return (
|
|
234
|
-
<span
|
|
235
|
-
className={cn("block text-label-16-mono! text-gray-500 pr-1", className)}
|
|
236
|
-
{...props}
|
|
237
|
-
/>
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
type CommandPromptContentProps = {
|
|
242
|
-
value: string;
|
|
243
|
-
copyValue?: string;
|
|
244
|
-
className?: string;
|
|
245
|
-
children: ReactNode;
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
export function CommandPromptViewport({
|
|
249
|
-
className,
|
|
250
|
-
children,
|
|
251
|
-
}: {
|
|
252
|
-
className?: string;
|
|
253
|
-
children: ReactNode;
|
|
254
|
-
}): JSX.Element {
|
|
255
|
-
const context = useCommandPromptContext("CommandPrompt.Viewport");
|
|
256
|
-
const shouldReduceMotion = useReducedMotion();
|
|
257
|
-
const {
|
|
258
|
-
commandWidth,
|
|
259
|
-
canShowGradient,
|
|
260
|
-
isOverflowing,
|
|
261
|
-
setActiveCopyValue,
|
|
262
|
-
setCanShowGradient,
|
|
263
|
-
setCommandWidth,
|
|
264
|
-
setIsOverflowing,
|
|
265
|
-
} = context;
|
|
266
|
-
const measureRef = useRef<HTMLSpanElement>(null);
|
|
267
|
-
const scrollObserverCleanup = useRef<(() => void) | null>(null);
|
|
268
|
-
const items = Children.toArray(children)
|
|
269
|
-
.filter((child): child is React.ReactElement<CommandPromptContentProps> =>
|
|
270
|
-
isValidElement<CommandPromptContentProps>(child)
|
|
271
|
-
)
|
|
272
|
-
.map((child) => child.props);
|
|
273
|
-
const activeItem = items.find((item) => item.value === context.value);
|
|
274
|
-
const command = activeItem?.children ?? null;
|
|
275
|
-
const fallbackCopyValue =
|
|
276
|
-
typeof command === "string" || typeof command === "number"
|
|
277
|
-
? String(command)
|
|
278
|
-
: Children.toArray(command)
|
|
279
|
-
.filter(
|
|
280
|
-
(child): child is string | number =>
|
|
281
|
-
typeof child === "string" || typeof child === "number"
|
|
282
|
-
)
|
|
283
|
-
.join("");
|
|
284
|
-
const copyValue = activeItem?.copyValue ?? fallbackCopyValue;
|
|
285
|
-
|
|
286
|
-
useLayoutEffect(() => {
|
|
287
|
-
setIsOverflowing(false);
|
|
288
|
-
setCanShowGradient(Boolean(shouldReduceMotion));
|
|
289
|
-
}, [copyValue, setCanShowGradient, setIsOverflowing, shouldReduceMotion]);
|
|
290
|
-
|
|
291
|
-
useEffect(() => {
|
|
292
|
-
setActiveCopyValue(copyValue);
|
|
293
|
-
|
|
294
|
-
return () => {
|
|
295
|
-
setIsOverflowing(false);
|
|
296
|
-
scrollObserverCleanup.current?.();
|
|
297
|
-
scrollObserverCleanup.current = null;
|
|
298
|
-
};
|
|
299
|
-
}, [copyValue, setActiveCopyValue, setIsOverflowing]);
|
|
300
|
-
|
|
301
|
-
useLayoutEffect(() => {
|
|
302
|
-
if (!measureRef.current) return;
|
|
303
|
-
|
|
304
|
-
setCommandWidth(measureRef.current.getBoundingClientRect().width);
|
|
305
|
-
}, [command, copyValue, setCommandWidth]);
|
|
306
|
-
|
|
307
|
-
return (
|
|
308
|
-
<motion.span
|
|
309
|
-
animate={
|
|
310
|
-
commandWidth === undefined
|
|
311
|
-
? undefined
|
|
312
|
-
: { width: shouldReduceMotion ? "auto" : commandWidth }
|
|
313
|
-
}
|
|
314
|
-
className={cn(
|
|
315
|
-
"relative block min-w-0 overflow-hidden text-label-14-mono! text-gray-1000",
|
|
316
|
-
className
|
|
317
|
-
)}
|
|
318
|
-
initial={false}
|
|
319
|
-
onAnimationComplete={() => {
|
|
320
|
-
setCanShowGradient(true);
|
|
321
|
-
}}
|
|
322
|
-
transition={
|
|
323
|
-
shouldReduceMotion
|
|
324
|
-
? { duration: 0 }
|
|
325
|
-
: { type: "spring", bounce: 0, duration: 0.4 }
|
|
326
|
-
}
|
|
327
|
-
>
|
|
328
|
-
<span
|
|
329
|
-
aria-hidden
|
|
330
|
-
className="pointer-events-none invisible absolute whitespace-nowrap"
|
|
331
|
-
ref={measureRef}
|
|
332
|
-
>
|
|
333
|
-
{command}
|
|
334
|
-
</span>
|
|
335
|
-
<AnimatePresence initial={false} mode="wait">
|
|
336
|
-
{Children.toArray(children).map((child) => {
|
|
337
|
-
if (!isValidElement<CommandPromptContentProps>(child)) return null;
|
|
338
|
-
if (child.props.value !== context.value) return null;
|
|
339
|
-
|
|
340
|
-
return (
|
|
341
|
-
<motion.span
|
|
342
|
-
animate={{ opacity: 1, filter: "blur(0px)" }}
|
|
343
|
-
className={cn(
|
|
344
|
-
"block whitespace-nowrap min-w-0 py-2",
|
|
345
|
-
canShowGradient && isOverflowing
|
|
346
|
-
? "overflow-x-auto"
|
|
347
|
-
: "overflow-x-hidden",
|
|
348
|
-
child.props.className
|
|
349
|
-
)}
|
|
350
|
-
exit={{ opacity: 0, filter: "blur(1px)" }}
|
|
351
|
-
initial={{ opacity: 0, filter: "blur(1px)" }}
|
|
352
|
-
key={copyValue}
|
|
353
|
-
ref={(element) => {
|
|
354
|
-
scrollObserverCleanup.current?.();
|
|
355
|
-
scrollObserverCleanup.current = null;
|
|
356
|
-
if (!element) return;
|
|
357
|
-
|
|
358
|
-
const checkOverflow = () => {
|
|
359
|
-
setIsOverflowing(element.scrollWidth > element.clientWidth);
|
|
360
|
-
};
|
|
361
|
-
|
|
362
|
-
checkOverflow();
|
|
363
|
-
const observer = new ResizeObserver(checkOverflow);
|
|
364
|
-
observer.observe(element);
|
|
365
|
-
scrollObserverCleanup.current = () => observer.disconnect();
|
|
366
|
-
}}
|
|
367
|
-
transition={
|
|
368
|
-
shouldReduceMotion ? { duration: 0 } : { duration: 0.15 }
|
|
369
|
-
}
|
|
370
|
-
>
|
|
371
|
-
{child.props.children}
|
|
372
|
-
</motion.span>
|
|
373
|
-
);
|
|
374
|
-
})}
|
|
375
|
-
</AnimatePresence>
|
|
376
|
-
<AnimatePresence>
|
|
377
|
-
{canShowGradient && isOverflowing && (
|
|
378
|
-
<motion.span
|
|
379
|
-
animate={{ opacity: 1 }}
|
|
380
|
-
aria-hidden
|
|
381
|
-
className="pointer-events-none block z-10 absolute right-0 bg-gradient-to-r from-transparent to-background-100 top-0 bottom-0 w-4"
|
|
382
|
-
exit={{ opacity: 0 }}
|
|
383
|
-
initial={{ opacity: 0 }}
|
|
384
|
-
transition={
|
|
385
|
-
shouldReduceMotion ? { duration: 0 } : { duration: 0.2 }
|
|
386
|
-
}
|
|
387
|
-
/>
|
|
388
|
-
)}
|
|
389
|
-
</AnimatePresence>
|
|
390
|
-
</motion.span>
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
export function CommandPromptContent(
|
|
395
|
-
_props: CommandPromptContentProps
|
|
396
|
-
): JSX.Element | null {
|
|
397
|
-
return null;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
export function CommandPromptCopy({
|
|
401
|
-
className,
|
|
402
|
-
onClick,
|
|
403
|
-
...props
|
|
404
|
-
}: ComponentPropsWithoutRef<"button">): JSX.Element {
|
|
405
|
-
const context = useCommandPromptContext("CommandPrompt.Copy");
|
|
406
|
-
const shouldReduceMotion = useReducedMotion();
|
|
407
|
-
|
|
408
|
-
return (
|
|
409
|
-
<button
|
|
410
|
-
aria-label={context.copied ? "Copied" : "Copy command"}
|
|
411
|
-
className={cn(
|
|
412
|
-
"text-gray-1000 rounded-full border-none bg-transparent shrink-0 cursor-pointer relative size-8 flex items-center justify-center translate-x-0.5",
|
|
413
|
-
"group-hover:bg-gray-alpha-100 hover:!bg-gray-alpha-200 transition-colors touch-manipulation",
|
|
414
|
-
"outline-2 outline-offset-2 outline-transparent focus-visible:outline-[var(--ds-focus-color)]",
|
|
415
|
-
className
|
|
416
|
-
)}
|
|
417
|
-
onClick={(event) => {
|
|
418
|
-
onClick?.(event);
|
|
419
|
-
if (event.defaultPrevented) return;
|
|
420
|
-
event.stopPropagation();
|
|
421
|
-
context.copyActiveValue();
|
|
422
|
-
}}
|
|
423
|
-
type="button"
|
|
424
|
-
{...props}
|
|
425
|
-
>
|
|
426
|
-
<AnimatePresence initial={false}>
|
|
427
|
-
{!context.copied && (
|
|
428
|
-
<motion.span
|
|
429
|
-
animate={{
|
|
430
|
-
opacity: 1,
|
|
431
|
-
transform: "scale(1)",
|
|
432
|
-
filter: "blur(0px)",
|
|
433
|
-
}}
|
|
434
|
-
className="absolute inset-0 flex items-center justify-center"
|
|
435
|
-
exit={{
|
|
436
|
-
opacity: 0,
|
|
437
|
-
transform: "scale(0.5)",
|
|
438
|
-
filter: "blur(1px)",
|
|
439
|
-
}}
|
|
440
|
-
initial={{
|
|
441
|
-
opacity: 0,
|
|
442
|
-
transform: "scale(0.5)",
|
|
443
|
-
filter: "blur(1px)",
|
|
444
|
-
}}
|
|
445
|
-
key="copy"
|
|
446
|
-
transition={
|
|
447
|
-
shouldReduceMotion
|
|
448
|
-
? { duration: 0 }
|
|
449
|
-
: { duration: 0.2, ease: [0.23, 1, 0.32, 1] }
|
|
450
|
-
}
|
|
451
|
-
>
|
|
452
|
-
<IconCopy className="block" size={16} />
|
|
453
|
-
</motion.span>
|
|
454
|
-
)}
|
|
455
|
-
</AnimatePresence>
|
|
456
|
-
<AnimatePresence initial={false}>
|
|
457
|
-
{context.copied && (
|
|
458
|
-
<motion.span
|
|
459
|
-
animate={{
|
|
460
|
-
opacity: 1,
|
|
461
|
-
transform: "scale(1)",
|
|
462
|
-
filter: "blur(0px)",
|
|
463
|
-
}}
|
|
464
|
-
className="absolute inset-0 flex items-center justify-center"
|
|
465
|
-
exit={{
|
|
466
|
-
opacity: 0,
|
|
467
|
-
transform: "scale(0.5)",
|
|
468
|
-
filter: "blur(1px)",
|
|
469
|
-
}}
|
|
470
|
-
initial={{
|
|
471
|
-
opacity: 0,
|
|
472
|
-
transform: "scale(0.5)",
|
|
473
|
-
filter: "blur(1px)",
|
|
474
|
-
}}
|
|
475
|
-
key="check"
|
|
476
|
-
transition={
|
|
477
|
-
shouldReduceMotion
|
|
478
|
-
? { duration: 0 }
|
|
479
|
-
: { duration: 0.2, ease: [0.23, 1, 0.32, 1] }
|
|
480
|
-
}
|
|
481
|
-
>
|
|
482
|
-
<IconCheck className="block" size={16} />
|
|
483
|
-
</motion.span>
|
|
484
|
-
)}
|
|
485
|
-
</AnimatePresence>
|
|
486
|
-
</button>
|
|
487
|
-
);
|
|
488
|
-
}
|