cistack 6.0.0 → 6.2.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/.github/dependabot.yml +42 -0
- package/.github/workflows/ci.yml +2 -1
- package/.github/workflows/pipeline.yml +250 -0
- package/README.md +4 -0
- package/package.json +7 -2
- package/product-site/.github/dependabot.yml +27 -0
- package/product-site/.github/workflows/pipeline.yml +215 -0
- package/product-site/.lighthouserc.json +22 -0
- package/product-site/README.md +1 -0
- package/product-site/app/[lang]/layout.tsx +95 -0
- package/product-site/app/[lang]/page.tsx +19 -0
- package/product-site/app/favicon.ico +0 -0
- package/product-site/app/globals.css +228 -0
- package/product-site/app/manifest.ts +20 -0
- package/product-site/app/robots.ts +12 -0
- package/product-site/app/sitemap.ts +12 -0
- package/product-site/components/CanvasText.tsx +219 -0
- package/product-site/components/CopyButton.tsx +101 -0
- package/product-site/components/HomeClient.tsx +664 -0
- package/product-site/components/InstallToggle.tsx +123 -0
- package/product-site/components/MotionRevealClient.tsx +53 -0
- package/product-site/components/TerminalCard.tsx +65 -0
- package/product-site/components/TerminalCardMotion.tsx +324 -0
- package/product-site/components/site-motion.tsx +229 -0
- package/product-site/components/ui/accordion.tsx +74 -0
- package/product-site/components/ui/badge.tsx +52 -0
- package/product-site/components/ui/button.tsx +60 -0
- package/product-site/components/ui/card.tsx +103 -0
- package/product-site/components/ui/checkbox.tsx +29 -0
- package/product-site/components/ui/separator.tsx +25 -0
- package/product-site/components/ui/table.tsx +116 -0
- package/product-site/components/ui/tabs.tsx +82 -0
- package/product-site/components.json +25 -0
- package/product-site/dictionaries/br.json +276 -0
- package/product-site/dictionaries/cn.json +276 -0
- package/product-site/dictionaries/de.json +276 -0
- package/product-site/dictionaries/en.json +274 -0
- package/product-site/dictionaries/es.json +276 -0
- package/product-site/dictionaries/fr.json +276 -0
- package/product-site/dictionaries/pt.json +276 -0
- package/product-site/eslint.config.mjs +18 -0
- package/product-site/lib/dictionaries.ts +18 -0
- package/product-site/lib/dictionary-types.ts +3 -0
- package/product-site/lib/utils.ts +6 -0
- package/product-site/middleware.ts +39 -0
- package/product-site/next.config.mjs +14 -0
- package/product-site/package-lock.json +14201 -0
- package/product-site/package.json +42 -0
- package/product-site/postcss.config.mjs +7 -0
- package/product-site/public/file.svg +1 -0
- package/product-site/public/globe.svg +1 -0
- package/product-site/public/next.svg +1 -0
- package/product-site/public/og-image.png +0 -0
- package/product-site/public/vercel.svg +1 -0
- package/product-site/public/window.svg +1 -0
- package/product-site/scripts/sync-i18n.mjs +58 -0
- package/product-site/scripts/validate-i18n.mjs +45 -0
- package/product-site/tsconfig.json +34 -0
- package/product-site/types/negotiator.d.ts +14 -0
- package/product-site/vercel.json +5 -0
- package/src/index.js +12 -13
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { AnimatePresence, m, useReducedMotion } from "framer-motion";
|
|
4
|
+
import { Check, Copy } from "lucide-react";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
|
|
7
|
+
const iconClass = "h-4 w-4 shrink-0";
|
|
8
|
+
|
|
9
|
+
interface CopyButtonProps {
|
|
10
|
+
text: string;
|
|
11
|
+
className?: string;
|
|
12
|
+
idleLabel?: string;
|
|
13
|
+
successLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default function CopyButton({
|
|
17
|
+
text,
|
|
18
|
+
className = "",
|
|
19
|
+
idleLabel = "Copy",
|
|
20
|
+
successLabel = "Copied",
|
|
21
|
+
}: CopyButtonProps) {
|
|
22
|
+
const [copied, setCopied] = useState(false);
|
|
23
|
+
const timeoutRef = useRef<number | null>(null);
|
|
24
|
+
const reduce = useReducedMotion();
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
return () => {
|
|
28
|
+
if (timeoutRef.current !== null) {
|
|
29
|
+
window.clearTimeout(timeoutRef.current);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
|
|
34
|
+
const handleCopy = async () => {
|
|
35
|
+
try {
|
|
36
|
+
await navigator.clipboard.writeText(text);
|
|
37
|
+
setCopied(true);
|
|
38
|
+
if (timeoutRef.current !== null) {
|
|
39
|
+
window.clearTimeout(timeoutRef.current);
|
|
40
|
+
}
|
|
41
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
42
|
+
setCopied(false);
|
|
43
|
+
}, 2000);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error("Unable to copy text", error);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const label = copied ? successLabel : idleLabel;
|
|
50
|
+
const tap = reduce ? {} : { scale: 0.92 };
|
|
51
|
+
const hover = reduce ? {} : { scale: 1.06 };
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<m.button
|
|
55
|
+
type="button"
|
|
56
|
+
onClick={handleCopy}
|
|
57
|
+
whileTap={tap}
|
|
58
|
+
whileHover={hover}
|
|
59
|
+
transition={{ type: "spring", stiffness: 520, damping: 28 }}
|
|
60
|
+
className={`flex h-9 w-9 shrink-0 items-center justify-center text-zinc-500 transition-colors hover:text-zinc-900 ${className}`}
|
|
61
|
+
aria-label={label}
|
|
62
|
+
title={label}
|
|
63
|
+
>
|
|
64
|
+
<span className="relative flex h-4 w-4 items-center justify-center">
|
|
65
|
+
{reduce ? (
|
|
66
|
+
copied ? (
|
|
67
|
+
<Check className={`${iconClass} text-emerald-600`} aria-hidden strokeWidth={2.25} />
|
|
68
|
+
) : (
|
|
69
|
+
<Copy className={iconClass} aria-hidden strokeWidth={2} />
|
|
70
|
+
)
|
|
71
|
+
) : (
|
|
72
|
+
<AnimatePresence mode="wait" initial={false}>
|
|
73
|
+
{copied ? (
|
|
74
|
+
<m.span
|
|
75
|
+
key="check"
|
|
76
|
+
initial={{ opacity: 0, scale: 0.35, rotate: -50 }}
|
|
77
|
+
animate={{ opacity: 1, scale: 1, rotate: 0 }}
|
|
78
|
+
exit={{ opacity: 0, scale: 0.75 }}
|
|
79
|
+
transition={{ type: "spring", stiffness: 420, damping: 22 }}
|
|
80
|
+
className="absolute inset-0 flex items-center justify-center text-emerald-600"
|
|
81
|
+
>
|
|
82
|
+
<Check className={iconClass} aria-hidden strokeWidth={2.25} />
|
|
83
|
+
</m.span>
|
|
84
|
+
) : (
|
|
85
|
+
<m.span
|
|
86
|
+
key="copy"
|
|
87
|
+
initial={{ opacity: 0, scale: 0.75 }}
|
|
88
|
+
animate={{ opacity: 1, scale: 1 }}
|
|
89
|
+
exit={{ opacity: 0, scale: 0.8 }}
|
|
90
|
+
transition={{ duration: 0.15, ease: [0.22, 1, 0.36, 1] }}
|
|
91
|
+
className="absolute inset-0 flex items-center justify-center"
|
|
92
|
+
>
|
|
93
|
+
<Copy className={iconClass} aria-hidden strokeWidth={2} />
|
|
94
|
+
</m.span>
|
|
95
|
+
)}
|
|
96
|
+
</AnimatePresence>
|
|
97
|
+
)}
|
|
98
|
+
</span>
|
|
99
|
+
</m.button>
|
|
100
|
+
);
|
|
101
|
+
}
|