@alkimi.org/ui-kit 0.1.20 → 0.1.21

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.
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as k}from"./chunk-S5TKCF6T.mjs";import S from"next/link";import w,{useState as b,useEffect as x,useRef as _,isValidElement as L,useMemo as A}from"react";import{Slot as T}from"@radix-ui/react-slot";import{jsx as r,jsxs as G}from"react/jsx-runtime";var q="!<>-_\\/[]{}\u2014=+*^?#________",C=({href:f,children:a,symbols:m=q,className:N,asChild:R=!1,duration:p=40,...E})=>{let[i,h]=b(!1),[g,c]=b(0),s=_(null),d=_([]),y=t=>{if(typeof t=="string"||typeof t=="number")return String(t);if(L(t)){let e=t.props.children;if(e)return y(e)}return""},o=A(()=>y(a),[a]),v=()=>{let t=[];for(let e=0;e<o.length;e++){let n=o[e],M=Math.floor(Math.random()*(p*.5)),F=M+Math.floor(Math.random()*(p*.5));t.push({to:n,start:M,end:F})}d.current=t,c(0)};x(()=>{if(i&&o){v();let t=()=>{c(e=>e+1),s.current=requestAnimationFrame(t)};s.current=requestAnimationFrame(t)}else s.current&&cancelAnimationFrame(s.current),c(0);return()=>{s.current&&cancelAnimationFrame(s.current)}},[i,o]);let u=()=>i?o.split("").map((t,e)=>{let n=d.current[e];return!n||g>=n.end?r("span",{children:t},e):g>=n.start?t===" "?r("span",{children:" "},e):((!n.char||Math.random()<.28)&&(n.char=m[Math.floor(Math.random()*m.length)]),G("span",{className:"relative inline-block",children:[r("span",{className:"invisible opacity-0","aria-hidden":"true",children:t}),r("span",{className:"absolute inset-0 flex items-center justify-center font-mono opacity-50",children:n.char})]},e)):r("span",{children:t},e)}):a,l={className:k("inline-block whitespace-nowrap",N),onMouseEnter:t=>{let e=t.currentTarget;e&&!e.style.width&&(e.style.width=`${e.offsetWidth}px`),h(!0)},onMouseLeave:()=>h(!1),...E};return R&&L(a)?r(T,{...l,children:w.cloneElement(a,{},u())}):f?r(S,{href:f,...l,children:u()}):r("span",{...l,children:u()})},I=C;export{q as a,I as b};
3
+ //# sourceMappingURL=chunk-AEZ5XKKG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/GlitchLink.tsx"],"sourcesContent":["\"use client\"\nimport Link from \"next/link\"\nimport React, {\n useState,\n useEffect,\n useRef,\n ReactNode,\n isValidElement,\n useMemo,\n} from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cn } from \"@/lib/utils\"\n\nexport const DEFAULT_SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\ntype GlitchLinkProps = {\n href?: string\n children: ReactNode\n symbols?: string\n className?: string\n asChild?: boolean\n duration?: number\n}\n\nconst GlitchLink = ({\n href,\n children,\n symbols = DEFAULT_SYMBOLS,\n className,\n asChild = false,\n duration = 40,\n ...props\n}: GlitchLinkProps) => {\n const [isHovering, setIsHovering] = useState(false)\n const [frame, setFrame] = useState(0)\n const rafRef = useRef<number | null>(null)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n\n const getTextContent = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\")\n return String(node)\n if (isValidElement(node)) {\n const children = (node.props as any).children\n if (children) return getTextContent(children)\n }\n return \"\"\n }\n\n const originalText = useMemo(() => getTextContent(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < originalText.length; i++) {\n const to = originalText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n setFrame(0)\n }\n\n useEffect(() => {\n if (isHovering && originalText) {\n setupQueue()\n const update = () => {\n setFrame((prev) => prev + 1)\n rafRef.current = requestAnimationFrame(update)\n }\n rafRef.current = requestAnimationFrame(update)\n } else {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setFrame(0)\n }\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [isHovering, originalText])\n\n const renderContent = () => {\n // When not hovering, just render children as-is\n if (!isHovering) {\n return children\n }\n\n // When hovering, apply glitch effect to the text\n return originalText.split(\"\").map((char, i) => {\n const item = queueRef.current[i]\n\n // If animation for this char hasn't started, or it's finished\n if (!item || frame >= item.end) {\n return <span key={i}>{char}</span>\n }\n\n // If we are in the scrambling phase for this specific character\n if (frame >= item.start) {\n // Don't scramble spaces, just render them\n if (char === \" \") {\n return <span key={i}> </span>\n }\n\n if (!item.char || Math.random() < 0.28) {\n item.char = symbols[Math.floor(Math.random() * symbols.length)]\n }\n return (\n <span key={i} className=\"relative inline-block\">\n {/* The invisible real character preserves the exact width */}\n <span className=\"invisible opacity-0\" aria-hidden=\"true\">\n {char}\n </span>\n {/* The absolute symbol sits exactly on top of that width */}\n <span className=\"absolute inset-0 flex items-center justify-center font-mono opacity-50\">\n {item.char}\n </span>\n </span>\n )\n }\n\n // Default: show original character\n return <span key={i}>{char}</span>\n })\n }\n\n const commonProps = {\n className: cn(\"inline-block whitespace-nowrap\", className),\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget\n if (target && !target.style.width) {\n target.style.width = `${target.offsetWidth}px`\n }\n setIsHovering(true)\n },\n onMouseLeave: () => setIsHovering(false),\n ...props,\n }\n\n if (asChild && isValidElement(children)) {\n return (\n <Slot {...commonProps}>\n {React.cloneElement(children as any, {}, renderContent())}\n </Slot>\n )\n }\n\n // If no href is provided, render as a span instead of a Link\n if (!href) {\n return <span {...commonProps}>{renderContent()}</span>\n }\n\n return (\n <Link href={href} {...commonProps}>\n {renderContent()}\n </Link>\n )\n}\n\nexport default GlitchLink\n"],"mappings":";yCACA,OAAOA,MAAU,YACjB,OAAOC,GACL,YAAAC,EACA,aAAAC,EACA,UAAAC,EAEA,kBAAAC,EACA,WAAAC,MACK,QACP,OAAS,QAAAC,MAAY,uBAmFN,cAAAC,EAcL,QAAAC,MAdK,oBAhFR,IAAMC,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AAGoC,EAAc,SAAAH,EAAc,EAAE,CAQnD,EAEOU,EAAQxC","names":["Link","React","useState","useEffect","useRef","isValidElement","useMemo","Slot","jsx","jsxs","DEFAULT_SYMBOLS","GlitchLink","href","children","symbols","className","asChild","duration","props","isHovering","setIsHovering","useState","frame","setFrame","rafRef","useRef","queueRef","getTextContent","node","isValidElement","originalText","useMemo","setupQueue","newQueue","i","to","start","end","useEffect","update","prev","renderContent","char","item","commonProps","cn","e","target","Slot","React","Link","GlitchLink_default"]}
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client";
2
+ var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _link = require('next/link'); var _link2 = _interopRequireDefault(_link);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _reactslot = require('@radix-ui/react-slot');var _jsxruntime = require('react/jsx-runtime');var q="!<>-_\\/[]{}\u2014=+*^?#________",C=({href:f,children:a,symbols:m=q,className:N,asChild:R=!1,duration:p=40,...E})=>{let[i,h]=_react.useState.call(void 0, !1),[g,c]=_react.useState.call(void 0, 0),s=_react.useRef.call(void 0, null),d=_react.useRef.call(void 0, []),y=t=>{if(typeof t=="string"||typeof t=="number")return String(t);if(_react.isValidElement.call(void 0, t)){let e=t.props.children;if(e)return y(e)}return""},o=_react.useMemo.call(void 0, ()=>y(a),[a]),v=()=>{let t=[];for(let e=0;e<o.length;e++){let n=o[e],M=Math.floor(Math.random()*(p*.5)),F=M+Math.floor(Math.random()*(p*.5));t.push({to:n,start:M,end:F})}d.current=t,c(0)};_react.useEffect.call(void 0, ()=>{if(i&&o){v();let t=()=>{c(e=>e+1),s.current=requestAnimationFrame(t)};s.current=requestAnimationFrame(t)}else s.current&&cancelAnimationFrame(s.current),c(0);return()=>{s.current&&cancelAnimationFrame(s.current)}},[i,o]);let u=()=>i?o.split("").map((t,e)=>{let n=d.current[e];return!n||g>=n.end?_jsxruntime.jsx.call(void 0, "span",{children:t},e):g>=n.start?t===" "?_jsxruntime.jsx.call(void 0, "span",{children:" "},e):((!n.char||Math.random()<.28)&&(n.char=m[Math.floor(Math.random()*m.length)]),_jsxruntime.jsxs.call(void 0, "span",{className:"relative inline-block",children:[_jsxruntime.jsx.call(void 0, "span",{className:"invisible opacity-0","aria-hidden":"true",children:t}),_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center font-mono opacity-50",children:n.char})]},e)):_jsxruntime.jsx.call(void 0, "span",{children:t},e)}):a,l={className:_chunkFUYXCJOQjs.a.call(void 0, "inline-block whitespace-nowrap",N),onMouseEnter:t=>{let e=t.currentTarget;e&&!e.style.width&&(e.style.width=`${e.offsetWidth}px`),h(!0)},onMouseLeave:()=>h(!1),...E};return R&&_react.isValidElement.call(void 0, a)?_jsxruntime.jsx.call(void 0, _reactslot.Slot,{...l,children:_react2.default.cloneElement(a,{},u())}):f?_jsxruntime.jsx.call(void 0, _link2.default,{href:f,...l,children:u()}):_jsxruntime.jsx.call(void 0, "span",{...l,children:u()})},I= exports.b =C;exports.a = q; exports.b = I;
3
+ //# sourceMappingURL=chunk-EJTY2ABY.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EJTY2ABY.js","../src/components/GlitchLink.tsx"],"names":["DEFAULT_SYMBOLS","GlitchLink","href","children","symbols","className","asChild","duration","props","isHovering","setIsHovering","useState","frame","setFrame","rafRef","useRef","queueRef","getTextContent","node","isValidElement","originalText","useMemo","setupQueue","newQueue","i","to","start","end","useEffect","update","prev","renderContent","char","item","jsx","jsxs","commonProps","cn","e","target"],"mappings":"AAAA,qLAAY;AACZ,sDAAuC,6ECAtB,4EAQV,iDACc,+CAmFN,IAhFFA,CAAAA,CAAkB,kCAAA,CAWzBC,CAAAA,CAAa,CAAC,CAClB,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,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A","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EJTY2ABY.js","sourcesContent":[null,"\"use client\"\nimport Link from \"next/link\"\nimport React, {\n useState,\n useEffect,\n useRef,\n ReactNode,\n isValidElement,\n useMemo,\n} from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cn } from \"@/lib/utils\"\n\nexport const DEFAULT_SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\ntype GlitchLinkProps = {\n href?: string\n children: ReactNode\n symbols?: string\n className?: string\n asChild?: boolean\n duration?: number\n}\n\nconst GlitchLink = ({\n href,\n children,\n symbols = DEFAULT_SYMBOLS,\n className,\n asChild = false,\n duration = 40,\n ...props\n}: GlitchLinkProps) => {\n const [isHovering, setIsHovering] = useState(false)\n const [frame, setFrame] = useState(0)\n const rafRef = useRef<number | null>(null)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n\n const getTextContent = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\")\n return String(node)\n if (isValidElement(node)) {\n const children = (node.props as any).children\n if (children) return getTextContent(children)\n }\n return \"\"\n }\n\n const originalText = useMemo(() => getTextContent(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < originalText.length; i++) {\n const to = originalText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n setFrame(0)\n }\n\n useEffect(() => {\n if (isHovering && originalText) {\n setupQueue()\n const update = () => {\n setFrame((prev) => prev + 1)\n rafRef.current = requestAnimationFrame(update)\n }\n rafRef.current = requestAnimationFrame(update)\n } else {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setFrame(0)\n }\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [isHovering, originalText])\n\n const renderContent = () => {\n // When not hovering, just render children as-is\n if (!isHovering) {\n return children\n }\n\n // When hovering, apply glitch effect to the text\n return originalText.split(\"\").map((char, i) => {\n const item = queueRef.current[i]\n\n // If animation for this char hasn't started, or it's finished\n if (!item || frame >= item.end) {\n return <span key={i}>{char}</span>\n }\n\n // If we are in the scrambling phase for this specific character\n if (frame >= item.start) {\n // Don't scramble spaces, just render them\n if (char === \" \") {\n return <span key={i}> </span>\n }\n\n if (!item.char || Math.random() < 0.28) {\n item.char = symbols[Math.floor(Math.random() * symbols.length)]\n }\n return (\n <span key={i} className=\"relative inline-block\">\n {/* The invisible real character preserves the exact width */}\n <span className=\"invisible opacity-0\" aria-hidden=\"true\">\n {char}\n </span>\n {/* The absolute symbol sits exactly on top of that width */}\n <span className=\"absolute inset-0 flex items-center justify-center font-mono opacity-50\">\n {item.char}\n </span>\n </span>\n )\n }\n\n // Default: show original character\n return <span key={i}>{char}</span>\n })\n }\n\n const commonProps = {\n className: cn(\"inline-block whitespace-nowrap\", className),\n onMouseEnter: (e: React.MouseEvent<HTMLElement>) => {\n const target = e.currentTarget\n if (target && !target.style.width) {\n target.style.width = `${target.offsetWidth}px`\n }\n setIsHovering(true)\n },\n onMouseLeave: () => setIsHovering(false),\n ...props,\n }\n\n if (asChild && isValidElement(children)) {\n return (\n <Slot {...commonProps}>\n {React.cloneElement(children as any, {}, renderContent())}\n </Slot>\n )\n }\n\n // If no href is provided, render as a span instead of a Link\n if (!href) {\n return <span {...commonProps}>{renderContent()}</span>\n }\n\n return (\n <Link href={href} {...commonProps}>\n {renderContent()}\n </Link>\n )\n}\n\nexport default GlitchLink\n"]}
@@ -0,0 +1,3 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client";
2
+ var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _jsxruntime = require('react/jsx-runtime');var E="!<>-_\\/[]{}\u2014=+*^?#________",I=e=>e[Math.floor(Math.random()*e.length)],y=e=>{if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(y).join("");if(_react2.default.isValidElement(e)){let r=e.props;return(r.text||"")+(r.label||"")+(r.title||"")+y(r.children)}return""},b=(e,r,s)=>{if(typeof e=="string"||typeof e=="number"){let a=String(e),n=[];for(let f=0;f<a.length;f++)n.push(_jsxruntime.jsx.call(void 0, _react2.default.Fragment,{children:r[s.current]||""},`char-${s.current}`)),s.current++;return n}if(Array.isArray(e))return e.map((a,n)=>_jsxruntime.jsx.call(void 0, _react2.default.Fragment,{children:b(a,r,s)},`arr-${n}-${s.current}`));if(_react2.default.isValidElement(e)){let a=e.props,n={};return a.children&&(n.children=b(a.children,r,s)),_react2.default.cloneElement(e,n)}return e},P=({children:e,className:r,duration:s=40,symbols:a=E,delay:n=0})=>{let[f,_]=_react.useState.call(void 0, null),[F,x]=_react.useState.call(void 0, !1),R=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, 0),h=_react.useRef.call(void 0, []),g=_react.useRef.call(void 0, null),S=_react.useRef.call(void 0, !1),N=_react.useMemo.call(void 0, ()=>y(e),[e]),k=()=>{let o=[];for(let c=0;c<N.length;c++){let d=N[c],i=Math.floor(Math.random()*(s*.5)),t=i+Math.floor(Math.random()*(s*.5));o.push({to:d,start:i,end:t})}h.current=o,l.current=0,x(!1)},T=()=>{let o=0,c=[];for(let i=0;i<h.current.length;i++){let t=h.current[i];l.current>=t.end?(o++,c.push(t.to)):(l.current>=t.start&&(!t.char||Math.random()<.28)&&(t.char=I(a)),c.push(_jsxruntime.jsxs.call(void 0, "span",{className:"relative inline-block",children:[_jsxruntime.jsx.call(void 0, "span",{className:"invisible select-none","aria-hidden":"true",children:t.to===" "?"\xA0":t.to}),l.current>=t.start&&_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none",children:t.char})]},i)))}_(b(e,c,{current:0})),o===h.current.length?x(!0):(l.current++,g.current=requestAnimationFrame(T))};return _react.useEffect.call(void 0, ()=>{let o=new IntersectionObserver(c=>{if(c[0].isIntersecting&&!S.current){S.current=!0;let d=setTimeout(()=>{k(),g.current=requestAnimationFrame(T)},n);return()=>clearTimeout(d)}},{threshold:.1});return R.current&&o.observe(R.current),()=>{o.disconnect(),g.current&&cancelAnimationFrame(g.current)}},[N,n]),_jsxruntime.jsx.call(void 0, "span",{ref:R,className:_chunkFUYXCJOQjs.a.call(void 0, "inline-block whitespace-pre-wrap",r),children:F?e:f})};function q(e){return _jsxruntime.jsx.call(void 0, _react.Suspense,{fallback:_jsxruntime.jsx.call(void 0, "span",{className:"invisible",children:e.children}),children:_jsxruntime.jsx.call(void 0, P,{...e})})}exports.a = q;
3
+ //# sourceMappingURL=chunk-FLYTIYNE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-FLYTIYNE.js","../src/components/TextDecoder.tsx"],"names":["SYMBOLS","randomChar","symbols","extractText","node","React","props","injectScrambledText","scrambledChars","indexObj","text","result","i","jsx"],"mappings":"AAAA,qLAAY;AACZ,sDAAuC,4ECQhC,+CAgCC,IA9BFA,CAAAA,CAAU,kCAAA,CAEVC,CAAAA,CAAcC,CAAAA,EAClBA,CAAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,CAAA,CAAIA,CAAAA,CAAQ,MAAM,CAAC,CAAA,CAE9CC,CAAAA,CAAeC,CAAAA,EAA4B,CAC/C,EAAA,CAAI,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAAU,OAAO,MAAA,CAAOA,CAAI,CAAA,CAC5E,EAAA,CAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CAAG,OAAOA,CAAAA,CAAK,GAAA,CAAID,CAAW,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CAC7D,EAAA,CAAIE,eAAAA,CAAM,cAAA,CAAeD,CAAI,CAAA,CAAG,CAC9B,IAAME,CAAAA,CAAQF,CAAAA,CAAK,KAAA,CACnB,MAAA,CACGE,CAAAA,CAAM,IAAA,EAAQ,EAAA,CAAA,CAAA,CACdA,CAAAA,CAAM,KAAA,EAAS,EAAA,CAAA,CAAA,CACfA,CAAAA,CAAM,KAAA,EAAS,EAAA,CAAA,CAChBH,CAAAA,CAAYG,CAAAA,CAAM,QAAQ,CAE9B,CACA,MAAO,EACT,CAAA,CAEMC,CAAAA,CAAsB,CAC1BH,CAAAA,CACAI,CAAAA,CACAC,CAAAA,CAAAA,EACc,CACd,EAAA,CAAI,OAAOL,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAAU,CACxD,IAAMM,CAAAA,CAAO,MAAA,CAAON,CAAI,CAAA,CAClBO,CAAAA,CAAiC,CAAC,CAAA,CACxC,GAAA,CAAA,IAASC,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAIF,CAAAA,CAAK,MAAA,CAAQE,CAAAA,EAAAA,CAC/BD,CAAAA,CAAO,IAAA,CACLE,6BAAAA,eAACR,CAAM,QAAA,CAAN,CACE,QAAA,CAAAG,CAAAA,CAAeC,CAAAA,CAAS,OAAO,CAAA,EAAK,EAAA,CAAA,CADlB,CAAA,KAAA,EAAQA,CAAAA,CAAS,OAAO,CAAA,CAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-FLYTIYNE.js","sourcesContent":[null,"\"use client\"\nimport { cn } from \"@/lib/utils\"\nimport React, {\n useState,\n useEffect,\n useMemo,\n useRef,\n Suspense,\n ReactNode,\n} from \"react\"\n\nconst SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\nconst randomChar = (symbols: string) =>\n symbols[Math.floor(Math.random() * symbols.length)]\n\nconst extractText = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(extractText).join(\"\")\n if (React.isValidElement(node)) {\n const props = node.props as any\n return (\n (props.text || \"\") +\n (props.label || \"\") +\n (props.title || \"\") +\n extractText(props.children)\n )\n }\n return \"\"\n}\n\nconst injectScrambledText = (\n node: ReactNode,\n scrambledChars: (string | ReactNode)[],\n indexObj: { current: number }\n): ReactNode => {\n if (typeof node === \"string\" || typeof node === \"number\") {\n const text = String(node)\n const result: (string | ReactNode)[] = []\n for (let i = 0; i < text.length; i++) {\n result.push(\n <React.Fragment key={`char-${indexObj.current}`}>\n {scrambledChars[indexObj.current] || \"\"}\n </React.Fragment>\n )\n indexObj.current++\n }\n return result\n }\n\n if (Array.isArray(node)) {\n return node.map((child, idx) => (\n <React.Fragment key={`arr-${idx}-${indexObj.current}`}>\n {injectScrambledText(child, scrambledChars, indexObj)}\n </React.Fragment>\n ))\n }\n\n if (React.isValidElement(node)) {\n const props = node.props as any\n const newProps: any = {}\n\n if (props.children) {\n newProps.children = injectScrambledText(\n props.children,\n scrambledChars,\n indexObj\n )\n }\n return React.cloneElement(node, newProps)\n }\n return node\n}\n\nexport interface TextDecoderProps {\n children: ReactNode\n className?: string\n duration?: number\n symbols?: string\n delay?: number\n}\n\nconst TextDecoder = ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n}: TextDecoderProps) => {\n const [outputNodes, setOutputNodes] = useState<ReactNode>(null)\n const [isComplete, setIsComplete] = useState(false)\n const elementRef = useRef<HTMLSpanElement>(null)\n const frameRef = useRef(0)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n const rafRef = useRef<number | null>(null)\n const hasAnimatedRef = useRef(false)\n\n const fullText = useMemo(() => extractText(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < fullText.length; i++) {\n const to = fullText[i]\n // Every character starts within the first 50% of duration\n // and resolves within the second 50%\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n frameRef.current = 0\n setIsComplete(false)\n }\n\n const update = () => {\n let complete = 0\n const currentScrambledChars: (string | ReactNode)[] = []\n\n for (let i = 0; i < queueRef.current.length; i++) {\n const item = queueRef.current[i]\n\n if (frameRef.current >= item.end) {\n // Animation finished for this letter\n complete++\n currentScrambledChars.push(item.to)\n } else {\n // Character is either waiting (invisible ghost) or scrambling\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < 0.28) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n {/* The Ghost: Locks the exact width/height of the specific character */}\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {/* The Scramble: Overlays the ghost without affecting document flow */}\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none\">\n {item.char}\n </span>\n )}\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(children, currentScrambledChars, indexObj)\n )\n\n if (complete === queueRef.current.length) {\n setIsComplete(true)\n } else {\n frameRef.current++\n rafRef.current = requestAnimationFrame(update)\n }\n }\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting && !hasAnimatedRef.current) {\n hasAnimatedRef.current = true\n const timeoutId = setTimeout(() => {\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n }, delay)\n return () => clearTimeout(timeoutId)\n }\n },\n { threshold: 0.1 }\n )\n\n if (elementRef.current) observer.observe(elementRef.current)\n\n return () => {\n observer.disconnect()\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [fullText, delay])\n\n return (\n <span\n ref={elementRef}\n className={cn(\"inline-block whitespace-pre-wrap\", className)}\n >\n {isComplete ? children : outputNodes}\n </span>\n )\n}\n\nexport default function SuspenseDecodedText(props: TextDecoderProps) {\n return (\n <Suspense fallback={<span className=\"invisible\">{props.children}</span>}>\n <TextDecoder {...props} />\n </Suspense>\n )\n}\n"]}
@@ -0,0 +1,3 @@
1
+ "use client";
2
+ import{a as M}from"./chunk-S5TKCF6T.mjs";import p,{useState as A,useEffect as v,useMemo as w,useRef as m,Suspense as D}from"react";import{jsx as u,jsxs as $}from"react/jsx-runtime";var E="!<>-_\\/[]{}\u2014=+*^?#________",I=e=>e[Math.floor(Math.random()*e.length)],y=e=>{if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(y).join("");if(p.isValidElement(e)){let r=e.props;return(r.text||"")+(r.label||"")+(r.title||"")+y(r.children)}return""},b=(e,r,s)=>{if(typeof e=="string"||typeof e=="number"){let a=String(e),n=[];for(let f=0;f<a.length;f++)n.push(u(p.Fragment,{children:r[s.current]||""},`char-${s.current}`)),s.current++;return n}if(Array.isArray(e))return e.map((a,n)=>u(p.Fragment,{children:b(a,r,s)},`arr-${n}-${s.current}`));if(p.isValidElement(e)){let a=e.props,n={};return a.children&&(n.children=b(a.children,r,s)),p.cloneElement(e,n)}return e},P=({children:e,className:r,duration:s=40,symbols:a=E,delay:n=0})=>{let[f,_]=A(null),[F,x]=A(!1),R=m(null),l=m(0),h=m([]),g=m(null),S=m(!1),N=w(()=>y(e),[e]),k=()=>{let o=[];for(let c=0;c<N.length;c++){let d=N[c],i=Math.floor(Math.random()*(s*.5)),t=i+Math.floor(Math.random()*(s*.5));o.push({to:d,start:i,end:t})}h.current=o,l.current=0,x(!1)},T=()=>{let o=0,c=[];for(let i=0;i<h.current.length;i++){let t=h.current[i];l.current>=t.end?(o++,c.push(t.to)):(l.current>=t.start&&(!t.char||Math.random()<.28)&&(t.char=I(a)),c.push($("span",{className:"relative inline-block",children:[u("span",{className:"invisible select-none","aria-hidden":"true",children:t.to===" "?"\xA0":t.to}),l.current>=t.start&&u("span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none",children:t.char})]},i)))}_(b(e,c,{current:0})),o===h.current.length?x(!0):(l.current++,g.current=requestAnimationFrame(T))};return v(()=>{let o=new IntersectionObserver(c=>{if(c[0].isIntersecting&&!S.current){S.current=!0;let d=setTimeout(()=>{k(),g.current=requestAnimationFrame(T)},n);return()=>clearTimeout(d)}},{threshold:.1});return R.current&&o.observe(R.current),()=>{o.disconnect(),g.current&&cancelAnimationFrame(g.current)}},[N,n]),u("span",{ref:R,className:M("inline-block whitespace-pre-wrap",r),children:F?e:f})};function q(e){return u(D,{fallback:u("span",{className:"invisible",children:e.children}),children:u(P,{...e})})}export{q as a};
3
+ //# sourceMappingURL=chunk-ULRJYLR3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/TextDecoder.tsx"],"sourcesContent":["\"use client\"\nimport { cn } from \"@/lib/utils\"\nimport React, {\n useState,\n useEffect,\n useMemo,\n useRef,\n Suspense,\n ReactNode,\n} from \"react\"\n\nconst SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\nconst randomChar = (symbols: string) =>\n symbols[Math.floor(Math.random() * symbols.length)]\n\nconst extractText = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(extractText).join(\"\")\n if (React.isValidElement(node)) {\n const props = node.props as any\n return (\n (props.text || \"\") +\n (props.label || \"\") +\n (props.title || \"\") +\n extractText(props.children)\n )\n }\n return \"\"\n}\n\nconst injectScrambledText = (\n node: ReactNode,\n scrambledChars: (string | ReactNode)[],\n indexObj: { current: number }\n): ReactNode => {\n if (typeof node === \"string\" || typeof node === \"number\") {\n const text = String(node)\n const result: (string | ReactNode)[] = []\n for (let i = 0; i < text.length; i++) {\n result.push(\n <React.Fragment key={`char-${indexObj.current}`}>\n {scrambledChars[indexObj.current] || \"\"}\n </React.Fragment>\n )\n indexObj.current++\n }\n return result\n }\n\n if (Array.isArray(node)) {\n return node.map((child, idx) => (\n <React.Fragment key={`arr-${idx}-${indexObj.current}`}>\n {injectScrambledText(child, scrambledChars, indexObj)}\n </React.Fragment>\n ))\n }\n\n if (React.isValidElement(node)) {\n const props = node.props as any\n const newProps: any = {}\n\n if (props.children) {\n newProps.children = injectScrambledText(\n props.children,\n scrambledChars,\n indexObj\n )\n }\n return React.cloneElement(node, newProps)\n }\n return node\n}\n\nexport interface TextDecoderProps {\n children: ReactNode\n className?: string\n duration?: number\n symbols?: string\n delay?: number\n}\n\nconst TextDecoder = ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n}: TextDecoderProps) => {\n const [outputNodes, setOutputNodes] = useState<ReactNode>(null)\n const [isComplete, setIsComplete] = useState(false)\n const elementRef = useRef<HTMLSpanElement>(null)\n const frameRef = useRef(0)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n const rafRef = useRef<number | null>(null)\n const hasAnimatedRef = useRef(false)\n\n const fullText = useMemo(() => extractText(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < fullText.length; i++) {\n const to = fullText[i]\n // Every character starts within the first 50% of duration\n // and resolves within the second 50%\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n frameRef.current = 0\n setIsComplete(false)\n }\n\n const update = () => {\n let complete = 0\n const currentScrambledChars: (string | ReactNode)[] = []\n\n for (let i = 0; i < queueRef.current.length; i++) {\n const item = queueRef.current[i]\n\n if (frameRef.current >= item.end) {\n // Animation finished for this letter\n complete++\n currentScrambledChars.push(item.to)\n } else {\n // Character is either waiting (invisible ghost) or scrambling\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < 0.28) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n {/* The Ghost: Locks the exact width/height of the specific character */}\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {/* The Scramble: Overlays the ghost without affecting document flow */}\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none\">\n {item.char}\n </span>\n )}\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(children, currentScrambledChars, indexObj)\n )\n\n if (complete === queueRef.current.length) {\n setIsComplete(true)\n } else {\n frameRef.current++\n rafRef.current = requestAnimationFrame(update)\n }\n }\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting && !hasAnimatedRef.current) {\n hasAnimatedRef.current = true\n const timeoutId = setTimeout(() => {\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n }, delay)\n return () => clearTimeout(timeoutId)\n }\n },\n { threshold: 0.1 }\n )\n\n if (elementRef.current) observer.observe(elementRef.current)\n\n return () => {\n observer.disconnect()\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [fullText, delay])\n\n return (\n <span\n ref={elementRef}\n className={cn(\"inline-block whitespace-pre-wrap\", className)}\n >\n {isComplete ? children : outputNodes}\n </span>\n )\n}\n\nexport default function SuspenseDecodedText(props: TextDecoderProps) {\n return (\n <Suspense fallback={<span className=\"invisible\">{props.children}</span>}>\n <TextDecoder {...props} />\n </Suspense>\n )\n}\n"],"mappings":";yCAEA,OAAOA,GACL,YAAAC,EACA,aAAAC,EACA,WAAAC,EACA,UAAAC,EACA,YAAAC,MAEK,QAgCC,cAAAC,EA+FE,QAAAC,MA/FF,oBA9BR,IAAMC,EAAU,mCAEVC,EAAcC,GAClBA,EAAQ,KAAK,MAAM,KAAK,OAAO,EAAIA,EAAQ,MAAM,CAAC,EAE9CC,EAAeC,GAA4B,CAC/C,GAAI,OAAOA,GAAS,UAAY,OAAOA,GAAS,SAAU,OAAO,OAAOA,CAAI,EAC5E,GAAI,MAAM,QAAQA,CAAI,EAAG,OAAOA,EAAK,IAAID,CAAW,EAAE,KAAK,EAAE,EAC7D,GAAIX,EAAM,eAAeY,CAAI,EAAG,C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M,EAEjD,EAEA,OAAAzC,EAAU,IAAM,CACd,IAAM6C,EAAW,IAAI,qBAClBC,GAAY,CACX,GAAIA,EAAQ,CAAC,EAAE,gBAAkB,CAACZ,EAAe,QAAS,CACxDA,EAAe,QAAU,GACzB,IAAMa,EAAY,WAAW,IAAM,CACjCX,EAAW,EACXH,EAAO,QAAU,sBAAsBQ,CAAM,CAC/C,EAAGhB,CAAK,EACR,MAAO,IAAM,aAAasB,CAAS,CACrC,CACF,EACA,CAAE,UAAW,EAAI,CACnB,EAEA,OAAIjB,EAAW,SAASe,EAAS,QAAQf,EAAW,OAAO,EAEpD,IAAM,CACXe,EAAS,WAAW,EAChBZ,EAAO,SAAS,qBAAqBA,EAAO,OAAO,CACzD,CACF,EAAG,CAACE,EAAUV,CAAK,CAAC,EAGlBrB,EAAC,QACC,IAAK0B,EACL,UAAWkB,EAAG,mCAAoCzB,CAAS,EAE1D,SAAAK,EAAaN,EAAWI,EAC3B,CAEJ,EAEe,SAARuB,EAAqCtC,EAAyB,CACnE,OACEP,EAACD,EAAA,CAAS,SAAUC,EAAC,QAAK,UAAU,YAAa,SAAAO,EAAM,SAAS,EAC9D,SAAAP,EAACiB,EAAA,CAAa,GAAGV,EAAO,EAC1B,CAEJ","names":["React","useState","useEffect","useMemo","useRef","Suspense","jsx","jsxs","SYMBOLS","randomChar","symbols","extractText","node","props","injectScrambledText","scrambledChars","indexObj","text","result","i","child","idx","newProps","TextDecoder","children","className","duration","delay","outputNodes","setOutputNodes","isComplete","setIsComplete","elementRef","frameRef","queueRef","rafRef","hasAnimatedRef","fullText","setupQueue","newQueue","to","start","end","update","complete","currentScrambledChars","item","observer","entries","timeoutId","cn","SuspenseDecodedText"]}
@@ -1,3 +1,3 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- "use client";var _chunkHGY6TDJ2js = require('../chunk-HGY6TDJ2.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.DEFAULT_SYMBOLS = _chunkHGY6TDJ2js.a; exports.default = _chunkHGY6TDJ2js.b;
2
+ "use client";var _chunkEJTY2ABYjs = require('../chunk-EJTY2ABY.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.DEFAULT_SYMBOLS = _chunkEJTY2ABYjs.a; exports.default = _chunkEJTY2ABYjs.b;
3
3
  //# sourceMappingURL=GlitchLink.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use client";import{a,b}from"../chunk-P7ACUHYG.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as DEFAULT_SYMBOLS,b as default};
2
+ "use client";import{a,b}from"../chunk-AEZ5XKKG.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as DEFAULT_SYMBOLS,b as default};
3
3
  //# sourceMappingURL=GlitchLink.mjs.map
@@ -1,3 +1,3 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- "use client";var _chunkNZDJHFEGjs = require('../chunk-NZDJHFEG.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.default = _chunkNZDJHFEGjs.a;
2
+ "use client";var _chunkFLYTIYNEjs = require('../chunk-FLYTIYNE.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.default = _chunkFLYTIYNEjs.a;
3
3
  //# sourceMappingURL=TextDecoder.js.map
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- "use client";import{a}from"../chunk-NLKTP7EJ.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as default};
2
+ "use client";import{a}from"../chunk-ULRJYLR3.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as default};
3
3
  //# sourceMappingURL=TextDecoder.mjs.map
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
- var _chunkMLULTZDSjs = require('./chunk-MLULTZDS.js');var _chunkHGY6TDJ2js = require('./chunk-HGY6TDJ2.js');var _chunkR74QDO2Zjs = require('./chunk-R74QDO2Z.js');var _chunkNZDJHFEGjs = require('./chunk-NZDJHFEG.js');var _chunkLX3KCZOWjs = require('./chunk-LX3KCZOW.js');var _chunkSIGGW2CQjs = require('./chunk-SIGGW2CQ.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');require('./chunk-XYO4VLMF.js');exports.Button = _chunkLX3KCZOWjs.b; exports.GeometricFluidGrid = _chunkMLULTZDSjs.a; exports.GlitchLink = _chunkHGY6TDJ2js.b; exports.PixelLoad = _chunkR74QDO2Zjs.a; exports.Tabs = _chunkSIGGW2CQjs.a; exports.TabsContent = _chunkSIGGW2CQjs.d; exports.TabsList = _chunkSIGGW2CQjs.b; exports.TabsTrigger = _chunkSIGGW2CQjs.c; exports.TextDecoder = _chunkNZDJHFEGjs.a; exports.buttonVariants = _chunkLX3KCZOWjs.a; exports.cn = _chunkFUYXCJOQjs.a;
2
+ var _chunkMLULTZDSjs = require('./chunk-MLULTZDS.js');var _chunkEJTY2ABYjs = require('./chunk-EJTY2ABY.js');var _chunkR74QDO2Zjs = require('./chunk-R74QDO2Z.js');var _chunkFLYTIYNEjs = require('./chunk-FLYTIYNE.js');var _chunkLX3KCZOWjs = require('./chunk-LX3KCZOW.js');var _chunkSIGGW2CQjs = require('./chunk-SIGGW2CQ.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');require('./chunk-XYO4VLMF.js');exports.Button = _chunkLX3KCZOWjs.b; exports.GeometricFluidGrid = _chunkMLULTZDSjs.a; exports.GlitchLink = _chunkEJTY2ABYjs.b; exports.PixelLoad = _chunkR74QDO2Zjs.a; exports.Tabs = _chunkSIGGW2CQjs.a; exports.TabsContent = _chunkSIGGW2CQjs.d; exports.TabsList = _chunkSIGGW2CQjs.b; exports.TabsTrigger = _chunkSIGGW2CQjs.c; exports.TextDecoder = _chunkFLYTIYNEjs.a; exports.buttonVariants = _chunkLX3KCZOWjs.a; exports.cn = _chunkFUYXCJOQjs.a;
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
1
  "use client";
2
- import{a as d}from"./chunk-RTHCEJYC.mjs";import{b as s}from"./chunk-P7ACUHYG.mjs";import{a as c}from"./chunk-WF73K6X2.mjs";import{a as l}from"./chunk-NLKTP7EJ.mjs";import{a as e,b as r}from"./chunk-V5ORUPUF.mjs";import{a as i,b as o,c as a,d as n}from"./chunk-JK6CQDLQ.mjs";import{a as t}from"./chunk-S5TKCF6T.mjs";import"./chunk-KPAOPUY2.mjs";export{r as Button,d as GeometricFluidGrid,s as GlitchLink,c as PixelLoad,i as Tabs,n as TabsContent,o as TabsList,a as TabsTrigger,l as TextDecoder,e as buttonVariants,t as cn};
2
+ import{a as d}from"./chunk-RTHCEJYC.mjs";import{b as s}from"./chunk-AEZ5XKKG.mjs";import{a as c}from"./chunk-WF73K6X2.mjs";import{a as l}from"./chunk-ULRJYLR3.mjs";import{a as e,b as r}from"./chunk-V5ORUPUF.mjs";import{a as i,b as o,c as a,d as n}from"./chunk-JK6CQDLQ.mjs";import{a as t}from"./chunk-S5TKCF6T.mjs";import"./chunk-KPAOPUY2.mjs";export{r as Button,d as GeometricFluidGrid,s as GlitchLink,c as PixelLoad,i as Tabs,n as TabsContent,o as TabsList,a as TabsTrigger,l as TextDecoder,e as buttonVariants,t as cn};
3
3
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alkimi.org/ui-kit",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "packageManager": "pnpm@10.26.0",
5
5
  "description": "A React component library built with shadcn/ui and Tailwind CSS",
6
6
  "main": "./dist/index.js",
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client";
2
- var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _link = require('next/link'); var _link2 = _interopRequireDefault(_link);var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _reactslot = require('@radix-ui/react-slot');var _jsxruntime = require('react/jsx-runtime');var C="!<>-_\\/[]{}\u2014=+*^?#________",G=({href:L,children:a,symbols:u=C,className:N,asChild:R=!1,duration:m=40,...A})=>{let[i,l]=_react.useState.call(void 0, !1),[f,c]=_react.useState.call(void 0, 0),r=_react.useRef.call(void 0, ),p=_react.useRef.call(void 0, []),h=e=>typeof e=="string"||typeof e=="number"?String(e):_react.isValidElement.call(void 0, e)&&e.props.children?h(e.props.children):"",o=_react.useMemo.call(void 0, ()=>h(a),[a]),F=()=>{let e=[];for(let t=0;t<o.length;t++){let n=o[t],y=Math.floor(Math.random()*(m*.5)),S=y+Math.floor(Math.random()*(m*.5));e.push({to:n,start:y,end:S})}p.current=e,c(0)};_react.useEffect.call(void 0, ()=>{if(i&&o){F();let e=()=>{c(t=>t+1),r.current=requestAnimationFrame(e)};r.current=requestAnimationFrame(e)}else r.current&&cancelAnimationFrame(r.current),c(0);return()=>{r.current&&cancelAnimationFrame(r.current)}},[i,o]);let g=()=>o.split("").map((e,t)=>{let n=p.current[t];return!i||!n||f>=n.end?_jsxruntime.jsx.call(void 0, "span",{children:e},t):f>=n.start?((!n.char||Math.random()<.28)&&(n.char=u[Math.floor(Math.random()*u.length)]),_jsxruntime.jsxs.call(void 0, "span",{className:"relative inline-block",children:[_jsxruntime.jsx.call(void 0, "span",{className:"invisible opacity-0","aria-hidden":"true",children:e===" "?"\xA0":e}),_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center font-mono opacity-50",children:n.char})]},t)):_jsxruntime.jsx.call(void 0, "span",{children:e},t)}),d={className:_chunkFUYXCJOQjs.a.call(void 0, "inline-flex items-center justify-center whitespace-nowrap",N),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),...A};return R&&_react.isValidElement.call(void 0, a)?_jsxruntime.jsx.call(void 0, _reactslot.Slot,{...d,children:_react2.default.cloneElement(a,{},g())}):_jsxruntime.jsx.call(void 0, _link2.default,{href:L||"#",...d,children:g()})},D= exports.b =G;exports.a = C; exports.b = D;
3
- //# sourceMappingURL=chunk-HGY6TDJ2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-HGY6TDJ2.js","../src/components/GlitchLink.tsx"],"names":["DEFAULT_SYMBOLS","GlitchLink","href","children","symbols","className","asChild","duration","props","isHovering","setIsHovering","useState","frame","setFrame","rafRef","useRef","queueRef","getTextContent","node","isValidElement","originalText","useMemo","setupQueue","newQueue","i","to","start","end","useEffect","update","prev","renderContent","char","item","jsx","jsxs","commonProps","cn","Slot","React","Link","GlitchLink_default"],"mappings":"AAAA,qLAAY;AACZ,sDAAuC,6ECAtB,4EAQV,iDACc,+CA2EN,IAxEFA,CAAAA,CAAkB,kCAAA,CAWzBC,CAAAA,CAAa,CAAC,CAClB,IAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAUJ,CAAAA,CACV,SAAA,CAAAK,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,CAAA,CAAA,CACV,QAAA,CAAAC,CAAAA,CAAW,EAAA,CACX,GAAGC,CACL,CAAA,CAAA,EAAuB,CACrB,GAAM,CAACC,CAAAA,CAAYC,CAAa,CAAA,CAAIC,6BAAAA,CAAS,CAAK,CAAA,CAC5C,CAACC,CAAAA,CAAOC,CAAQ,CAAA,CAAIF,6BAAAA,CAAU,CAAA,CAC9BG,CAAAA,CAASC,2BAAAA,CAAe,CACxBC,CAAAA,CAAWD,2BAAAA,CAEd,CAAC,CAAA,CAEEE,CAAAA,CAAkBC,CAAAA,EAClB,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,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AAAA,GAAS,GAAA,CAAM,MAAA,CAAWA,CAAAA,CAC7B,CAAA,CAEAE,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAU,wEAAA,CACb,QAAA,CAAAD,CAAAA,CAAK,IAAA,CACR,CAAA,CAAA,CAAA,CARST,CASX,CAAA,CAAA,CAKGU,6BAAAA,MAAC,CAAA,CAAc,QAAA,CAAAF,CAAAA,CAAAA,CAAJR,CAAS,CAC7B,CAAC,CAAA,CAGGY,CAAAA,CAAc,CAClB,SAAA,CAAWC,gCAAAA,2DACT,CACAhC,CACF,CAAA,CACA,YAAA,CAAc,CAAA,CAAA,EAAMK,CAAAA,CAAc,CAAA,CAAI,CAAA,CACtC,YAAA,CAAc,CAAA,CAAA,EAAMA,CAAAA,CAAc,CAAA,CAAK,CAAA,CACvC,GAAGF,CACL,CAAA,CAEA,OAAIF,CAAAA,EAAWa,mCAAAA,CAAuB,CAAA,CAElCe,6BAAAA,eAACI,CAAA,CAAM,GAAGF,CAAAA,CACP,QAAA,CAAAG,eAAAA,CAAM,YAAA,CAAapC,CAAAA,CAAiB,CAAC,CAAA,CAAG4B,CAAAA,CAAc,CAAC,CAAA,CAC1D,CAAA,CAKFG,6BAAAA,cAACM,CAAA,CAAK,IAAA,CAAMtC,CAAAA,EAAQ,GAAA,CAAM,GAAGkC,CAAAA,CAC1B,QAAA,CAAAL,CAAAA,CAAc,CAAA,CACjB,CAEJ,CAAA,CAEOU,CAAAA,aAAQxC,CAAAA,CAAAA,6BAAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-HGY6TDJ2.js","sourcesContent":[null,"\"use client\"\nimport Link from \"next/link\"\nimport React, {\n useState,\n useEffect,\n useRef,\n ReactNode,\n isValidElement,\n useMemo,\n} from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cn } from \"@/lib/utils\"\n\nexport const DEFAULT_SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\ntype GlitchLinkProps = {\n href?: string\n children: ReactNode\n symbols?: string\n className?: string\n asChild?: boolean\n duration?: number\n}\n\nconst GlitchLink = ({\n href,\n children,\n symbols = DEFAULT_SYMBOLS,\n className,\n asChild = false,\n duration = 40,\n ...props\n}: GlitchLinkProps) => {\n const [isHovering, setIsHovering] = useState(false)\n const [frame, setFrame] = useState(0)\n const rafRef = useRef<number>()\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n\n const getTextContent = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\")\n return String(node)\n if (isValidElement(node) && node.props.children)\n return getTextContent(node.props.children)\n return \"\"\n }\n\n const originalText = useMemo(() => getTextContent(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < originalText.length; i++) {\n const to = originalText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n setFrame(0)\n }\n\n useEffect(() => {\n if (isHovering && originalText) {\n setupQueue()\n const update = () => {\n setFrame((prev) => prev + 1)\n rafRef.current = requestAnimationFrame(update)\n }\n rafRef.current = requestAnimationFrame(update)\n } else {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setFrame(0)\n }\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [isHovering, originalText])\n\n const renderContent = () => {\n return originalText.split(\"\").map((char, i) => {\n const item = queueRef.current[i]\n\n // If not hovering, or animation for this char hasn't started, or it's finished\n if (!isHovering || !item || frame >= item.end) {\n return <span key={i}>{char}</span>\n }\n\n // If we are in the scrambling phase for this specific character\n if (frame >= item.start) {\n if (!item.char || Math.random() < 0.28) {\n item.char = symbols[Math.floor(Math.random() * symbols.length)]\n }\n return (\n <span key={i} className=\"relative inline-block\">\n {/* The invisible real character preserves the exact width */}\n <span className=\"invisible opacity-0\" aria-hidden=\"true\">\n {char === \" \" ? \"\\u00A0\" : char}\n </span>\n {/* The absolute symbol sits exactly on top of that width */}\n <span className=\"absolute inset-0 flex items-center justify-center font-mono opacity-50\">\n {item.char}\n </span>\n </span>\n )\n }\n\n // Default: show original character\n return <span key={i}>{char}</span>\n })\n }\n\n const commonProps = {\n className: cn(\n \"inline-flex items-center justify-center whitespace-nowrap\",\n className\n ),\n onMouseEnter: () => setIsHovering(true),\n onMouseLeave: () => setIsHovering(false),\n ...props,\n }\n\n if (asChild && isValidElement(children)) {\n return (\n <Slot {...commonProps}>\n {React.cloneElement(children as any, {}, renderContent())}\n </Slot>\n )\n }\n\n return (\n <Link href={href || \"#\"} {...commonProps}>\n {renderContent()}\n </Link>\n )\n}\n\nexport default GlitchLink\n"]}
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as T}from"./chunk-S5TKCF6T.mjs";import b,{useState as M,useEffect as v,useMemo as w,useRef as d,Suspense as D}from"react";import{jsx as i,jsxs as F}from"react/jsx-runtime";var E="!<>-_\\/[]{}\u2014=+*^?#________",I=e=>e[Math.floor(Math.random()*e.length)],y=e=>{if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(y).join("");if(b.isValidElement(e)){let r=e.props;return(r.text||"")+(r.label||"")+(r.title||"")+y(r.children)}return""},R=(e,r,c)=>{if(typeof e=="string"||typeof e=="number"){let n=String(e),o=[];for(let p=0;p<n.length;p++)o.push(r[c.current]||""),c.current++;return o}if(Array.isArray(e))return e.map(n=>R(n,r,c));if(b.isValidElement(e)){let n=e.props,o={...n,key:n.key||`node-${c.current}`};return n.children&&(o.children=R(n.children,r,c)),b.cloneElement(e,o)}return e},P=({children:e,className:r,duration:c=40,symbols:n=E,delay:o=0})=>{let[p,_]=M(null),[A,x]=M(!1),g=d(null),l=d(0),m=d([]),f=d(),N=w(()=>y(e),[e]),k=()=>{let a=[];for(let s=0;s<N.length;s++){let h=N[s],u=Math.floor(Math.random()*(c*.5)),t=u+Math.floor(Math.random()*(c*.5));a.push({to:h,start:u,end:t})}m.current=a,l.current=0,x(!1)},S=()=>{let a=0,s=[];for(let u=0;u<m.current.length;u++){let t=m.current[u];l.current>=t.end?(a++,s.push(t.to)):(l.current>=t.start&&(!t.char||Math.random()<.28)&&(t.char=I(n)),s.push(F("span",{className:"relative inline-block",children:[i("span",{className:"invisible select-none","aria-hidden":"true",children:t.to===" "?"\xA0":t.to}),l.current>=t.start&&i("span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none",children:t.char})]},u)))}_(R(e,s,{current:0})),a===m.current.length?x(!0):(l.current++,f.current=requestAnimationFrame(S))};return v(()=>{let a=new IntersectionObserver(s=>{if(s[0].isIntersecting){let h=setTimeout(()=>{k(),f.current=requestAnimationFrame(S)},o);return()=>clearTimeout(h)}},{threshold:.1});return g.current&&a.observe(g.current),()=>{a.disconnect(),f.current&&cancelAnimationFrame(f.current)}},[N,o]),i("span",{ref:g,className:T("inline-block whitespace-pre-wrap",r),children:A?e:p})};function q(e){return i(D,{fallback:i("span",{className:"invisible",children:e.children}),children:i(P,{...e})})}export{q as a};
3
- //# sourceMappingURL=chunk-NLKTP7EJ.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/TextDecoder.tsx"],"sourcesContent":["\"use client\"\nimport { cn } from \"@/lib/utils\"\nimport React, {\n useState,\n useEffect,\n useMemo,\n useRef,\n Suspense,\n ReactNode,\n} from \"react\"\n\nconst SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\nconst randomChar = (symbols: string) =>\n symbols[Math.floor(Math.random() * symbols.length)]\n\nconst extractText = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(extractText).join(\"\")\n if (React.isValidElement(node)) {\n const props = node.props as any\n return (\n (props.text || \"\") +\n (props.label || \"\") +\n (props.title || \"\") +\n extractText(props.children)\n )\n }\n return \"\"\n}\n\nconst injectScrambledText = (\n node: ReactNode,\n scrambledChars: (string | ReactNode)[],\n indexObj: { current: number }\n): ReactNode => {\n if (typeof node === \"string\" || typeof node === \"number\") {\n const text = String(node)\n const result: (string | ReactNode)[] = []\n for (let i = 0; i < text.length; i++) {\n result.push(scrambledChars[indexObj.current] || \"\")\n indexObj.current++\n }\n return result\n }\n\n if (Array.isArray(node)) {\n return node.map((child) =>\n injectScrambledText(child, scrambledChars, indexObj)\n )\n }\n\n if (React.isValidElement(node)) {\n const props = node.props as any\n const newProps = { ...props, key: props.key || `node-${indexObj.current}` }\n\n if (props.children) {\n newProps.children = injectScrambledText(\n props.children,\n scrambledChars,\n indexObj\n )\n }\n return React.cloneElement(node, newProps)\n }\n return node\n}\n\nexport interface TextDecoderProps {\n children: ReactNode\n className?: string\n duration?: number\n symbols?: string\n delay?: number\n}\n\nconst TextDecoder = ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n}: TextDecoderProps) => {\n const [outputNodes, setOutputNodes] = useState<ReactNode>(null)\n const [isComplete, setIsComplete] = useState(false)\n const elementRef = useRef<HTMLSpanElement>(null)\n const frameRef = useRef(0)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n const rafRef = useRef<number>()\n\n const fullText = useMemo(() => extractText(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < fullText.length; i++) {\n const to = fullText[i]\n // Every character starts within the first 50% of duration\n // and resolves within the second 50%\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n frameRef.current = 0\n setIsComplete(false)\n }\n\n const update = () => {\n let complete = 0\n const currentScrambledChars: (string | ReactNode)[] = []\n\n for (let i = 0; i < queueRef.current.length; i++) {\n const item = queueRef.current[i]\n\n if (frameRef.current >= item.end) {\n // Animation finished for this letter\n complete++\n currentScrambledChars.push(item.to)\n } else {\n // Character is either waiting (invisible ghost) or scrambling\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < 0.28) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n {/* The Ghost: Locks the exact width/height of the specific character */}\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {/* The Scramble: Overlays the ghost without affecting document flow */}\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none\">\n {item.char}\n </span>\n )}\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(children, currentScrambledChars, indexObj)\n )\n\n if (complete === queueRef.current.length) {\n setIsComplete(true)\n } else {\n frameRef.current++\n rafRef.current = requestAnimationFrame(update)\n }\n }\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting) {\n const timeoutId = setTimeout(() => {\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n }, delay)\n return () => clearTimeout(timeoutId)\n }\n },\n { threshold: 0.1 }\n )\n\n if (elementRef.current) observer.observe(elementRef.current)\n\n return () => {\n observer.disconnect()\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [fullText, delay])\n\n return (\n <span\n ref={elementRef}\n className={cn(\"inline-block whitespace-pre-wrap\", className)}\n >\n {isComplete ? children : outputNodes}\n </span>\n )\n}\n\nexport default function SuspenseDecodedText(props: TextDecoderProps) {\n return (\n <Suspense fallback={<span className=\"invisible\">{props.children}</span>}>\n <TextDecoder {...props} />\n </Suspense>\n )\n}\n"],"mappings":";yCAEA,OAAOA,GACL,YAAAC,EACA,aAAAC,EACA,WAAAC,EACA,UAAAC,EACA,YAAAC,MAEK,QAwHG,OAEE,OAAAC,EAFF,QAAAC,MAAA,oBAtHV,IAAMC,EAAU,mCAEVC,EAAcC,GAClBA,EAAQ,KAAK,MAAM,KAAK,OAAO,EAAIA,EAAQ,MAAM,CAAC,EAE9CC,EAAeC,GAA4B,CAC/C,GAAI,OAAOA,G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GAElBE,EAAS,UACTE,EAAO,QAAU,sBAAsBO,CAAM,EAEjD,EAEA,OAAAvC,EAAU,IAAM,CACd,IAAM2C,EAAW,IAAI,qBAClBC,GAAY,CACX,GAAIA,EAAQ,CAAC,EAAE,eAAgB,CAC7B,IAAMC,EAAY,WAAW,IAAM,CACjCX,EAAW,EACXF,EAAO,QAAU,sBAAsBO,CAAM,CAC/C,EAAGf,CAAK,EACR,MAAO,IAAM,aAAaqB,CAAS,CACrC,CACF,EACA,CAAE,UAAW,EAAI,CACnB,EAEA,OAAIhB,EAAW,SAASc,EAAS,QAAQd,EAAW,OAAO,EAEpD,IAAM,CACXc,EAAS,WAAW,EAChBX,EAAO,SAAS,qBAAqBA,EAAO,OAAO,CACzD,CACF,EAAG,CAACC,EAAUT,CAAK,CAAC,EAGlBpB,EAAC,QACC,IAAKyB,EACL,UAAWiB,EAAG,mCAAoCxB,CAAS,EAE1D,SAAAK,EAAaN,EAAWI,EAC3B,CAEJ,EAEe,SAARsB,EAAqCpC,EAAyB,CACnE,OACEP,EAACD,EAAA,CAAS,SAAUC,EAAC,QAAK,UAAU,YAAa,SAAAO,EAAM,SAAS,EAC9D,SAAAP,EAACgB,EAAA,CAAa,GAAGT,EAAO,EAC1B,CAEJ","names":["React","useState","useEffect","useMemo","useRef","Suspense","jsx","jsxs","SYMBOLS","randomChar","symbols","extractText","node","props","injectScrambledText","scrambledChars","indexObj","text","result","i","child","newProps","TextDecoder","children","className","duration","delay","outputNodes","setOutputNodes","isComplete","setIsComplete","elementRef","frameRef","queueRef","rafRef","fullText","setupQueue","newQueue","to","start","end","update","complete","currentScrambledChars","item","observer","entries","timeoutId","cn","SuspenseDecodedText"]}
@@ -1,3 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }"use client";
2
- var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var _react2 = _interopRequireDefault(_react);var _jsxruntime = require('react/jsx-runtime');var E="!<>-_\\/[]{}\u2014=+*^?#________",I=e=>e[Math.floor(Math.random()*e.length)],y=e=>{if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(y).join("");if(_react2.default.isValidElement(e)){let r=e.props;return(r.text||"")+(r.label||"")+(r.title||"")+y(r.children)}return""},R=(e,r,c)=>{if(typeof e=="string"||typeof e=="number"){let n=String(e),o=[];for(let p=0;p<n.length;p++)o.push(r[c.current]||""),c.current++;return o}if(Array.isArray(e))return e.map(n=>R(n,r,c));if(_react2.default.isValidElement(e)){let n=e.props,o={...n,key:n.key||`node-${c.current}`};return n.children&&(o.children=R(n.children,r,c)),_react2.default.cloneElement(e,o)}return e},P=({children:e,className:r,duration:c=40,symbols:n=E,delay:o=0})=>{let[p,_]=_react.useState.call(void 0, null),[A,x]=_react.useState.call(void 0, !1),g=_react.useRef.call(void 0, null),l=_react.useRef.call(void 0, 0),m=_react.useRef.call(void 0, []),f=_react.useRef.call(void 0, ),N=_react.useMemo.call(void 0, ()=>y(e),[e]),k=()=>{let a=[];for(let s=0;s<N.length;s++){let h=N[s],u=Math.floor(Math.random()*(c*.5)),t=u+Math.floor(Math.random()*(c*.5));a.push({to:h,start:u,end:t})}m.current=a,l.current=0,x(!1)},S=()=>{let a=0,s=[];for(let u=0;u<m.current.length;u++){let t=m.current[u];l.current>=t.end?(a++,s.push(t.to)):(l.current>=t.start&&(!t.char||Math.random()<.28)&&(t.char=I(n)),s.push(_jsxruntime.jsxs.call(void 0, "span",{className:"relative inline-block",children:[_jsxruntime.jsx.call(void 0, "span",{className:"invisible select-none","aria-hidden":"true",children:t.to===" "?"\xA0":t.to}),l.current>=t.start&&_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none",children:t.char})]},u)))}_(R(e,s,{current:0})),a===m.current.length?x(!0):(l.current++,f.current=requestAnimationFrame(S))};return _react.useEffect.call(void 0, ()=>{let a=new IntersectionObserver(s=>{if(s[0].isIntersecting){let h=setTimeout(()=>{k(),f.current=requestAnimationFrame(S)},o);return()=>clearTimeout(h)}},{threshold:.1});return g.current&&a.observe(g.current),()=>{a.disconnect(),f.current&&cancelAnimationFrame(f.current)}},[N,o]),_jsxruntime.jsx.call(void 0, "span",{ref:g,className:_chunkFUYXCJOQjs.a.call(void 0, "inline-block whitespace-pre-wrap",r),children:A?e:p})};function q(e){return _jsxruntime.jsx.call(void 0, _react.Suspense,{fallback:_jsxruntime.jsx.call(void 0, "span",{className:"invisible",children:e.children}),children:_jsxruntime.jsx.call(void 0, P,{...e})})}exports.a = q;
3
- //# sourceMappingURL=chunk-NZDJHFEG.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-NZDJHFEG.js","../src/components/TextDecoder.tsx"],"names":["SYMBOLS","randomChar","symbols","extractText","node","React","props","injectScrambledText","scrambledChars","indexObj","text","result","i","child","newProps"],"mappings":"AAAA,qLAAY;AACZ,sDAAuC,4ECQhC,+CAwHG,IAtHJA,CAAAA,CAAU,kCAAA,CAEVC,CAAAA,CAAcC,CAAAA,EAClBA,CAAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,MAAA,CAAO,CAAA,CAAIA,CAAAA,CAAQ,MAAM,CAAC,CAAA,CAE9CC,CAAAA,CAAeC,CAAAA,EAA4B,CAC/C,EAAA,CAAI,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAAU,OAAO,MAAA,CAAOA,CAAI,CAAA,CAC5E,EAAA,CAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CAAG,OAAOA,CAAAA,CAAK,GAAA,CAAID,CAAW,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CAC7D,EAAA,CAAIE,eAAAA,CAAM,cAAA,CAAeD,CAAI,CAAA,CAAG,CAC9B,IAAME,CAAAA,CAAQF,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"use client\"\nimport { cn } from \"@/lib/utils\"\nimport React, {\n useState,\n useEffect,\n useMemo,\n useRef,\n Suspense,\n ReactNode,\n} from \"react\"\n\nconst SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\nconst randomChar = (symbols: string) =>\n symbols[Math.floor(Math.random() * symbols.length)]\n\nconst extractText = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\") return String(node)\n if (Array.isArray(node)) return node.map(extractText).join(\"\")\n if (React.isValidElement(node)) {\n const props = node.props as any\n return (\n (props.text || \"\") +\n (props.label || \"\") +\n (props.title || \"\") +\n extractText(props.children)\n )\n }\n return \"\"\n}\n\nconst injectScrambledText = (\n node: ReactNode,\n scrambledChars: (string | ReactNode)[],\n indexObj: { current: number }\n): ReactNode => {\n if (typeof node === \"string\" || typeof node === \"number\") {\n const text = String(node)\n const result: (string | ReactNode)[] = []\n for (let i = 0; i < text.length; i++) {\n result.push(scrambledChars[indexObj.current] || \"\")\n indexObj.current++\n }\n return result\n }\n\n if (Array.isArray(node)) {\n return node.map((child) =>\n injectScrambledText(child, scrambledChars, indexObj)\n )\n }\n\n if (React.isValidElement(node)) {\n const props = node.props as any\n const newProps = { ...props, key: props.key || `node-${indexObj.current}` }\n\n if (props.children) {\n newProps.children = injectScrambledText(\n props.children,\n scrambledChars,\n indexObj\n )\n }\n return React.cloneElement(node, newProps)\n }\n return node\n}\n\nexport interface TextDecoderProps {\n children: ReactNode\n className?: string\n duration?: number\n symbols?: string\n delay?: number\n}\n\nconst TextDecoder = ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n}: TextDecoderProps) => {\n const [outputNodes, setOutputNodes] = useState<ReactNode>(null)\n const [isComplete, setIsComplete] = useState(false)\n const elementRef = useRef<HTMLSpanElement>(null)\n const frameRef = useRef(0)\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n const rafRef = useRef<number>()\n\n const fullText = useMemo(() => extractText(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < fullText.length; i++) {\n const to = fullText[i]\n // Every character starts within the first 50% of duration\n // and resolves within the second 50%\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n frameRef.current = 0\n setIsComplete(false)\n }\n\n const update = () => {\n let complete = 0\n const currentScrambledChars: (string | ReactNode)[] = []\n\n for (let i = 0; i < queueRef.current.length; i++) {\n const item = queueRef.current[i]\n\n if (frameRef.current >= item.end) {\n // Animation finished for this letter\n complete++\n currentScrambledChars.push(item.to)\n } else {\n // Character is either waiting (invisible ghost) or scrambling\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < 0.28) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n {/* The Ghost: Locks the exact width/height of the specific character */}\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {/* The Scramble: Overlays the ghost without affecting document flow */}\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono text-[1em] leading-none\">\n {item.char}\n </span>\n )}\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(children, currentScrambledChars, indexObj)\n )\n\n if (complete === queueRef.current.length) {\n setIsComplete(true)\n } else {\n frameRef.current++\n rafRef.current = requestAnimationFrame(update)\n }\n }\n\n useEffect(() => {\n const observer = new IntersectionObserver(\n (entries) => {\n if (entries[0].isIntersecting) {\n const timeoutId = setTimeout(() => {\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n }, delay)\n return () => clearTimeout(timeoutId)\n }\n },\n { threshold: 0.1 }\n )\n\n if (elementRef.current) observer.observe(elementRef.current)\n\n return () => {\n observer.disconnect()\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [fullText, delay])\n\n return (\n <span\n ref={elementRef}\n className={cn(\"inline-block whitespace-pre-wrap\", className)}\n >\n {isComplete ? children : outputNodes}\n </span>\n )\n}\n\nexport default function SuspenseDecodedText(props: TextDecoderProps) {\n return (\n <Suspense fallback={<span className=\"invisible\">{props.children}</span>}>\n <TextDecoder {...props} />\n </Suspense>\n )\n}\n"]}
@@ -1,3 +0,0 @@
1
- "use client";
2
- import{a as M}from"./chunk-S5TKCF6T.mjs";import v from"next/link";import x,{useState as _,useEffect as E,useRef as b,isValidElement as k,useMemo as q}from"react";import{Slot as w}from"@radix-ui/react-slot";import{jsx as s,jsxs as P}from"react/jsx-runtime";var C="!<>-_\\/[]{}\u2014=+*^?#________",G=({href:L,children:a,symbols:u=C,className:N,asChild:R=!1,duration:m=40,...A})=>{let[i,l]=_(!1),[f,c]=_(0),r=b(),p=b([]),h=e=>typeof e=="string"||typeof e=="number"?String(e):k(e)&&e.props.children?h(e.props.children):"",o=q(()=>h(a),[a]),F=()=>{let e=[];for(let t=0;t<o.length;t++){let n=o[t],y=Math.floor(Math.random()*(m*.5)),S=y+Math.floor(Math.random()*(m*.5));e.push({to:n,start:y,end:S})}p.current=e,c(0)};E(()=>{if(i&&o){F();let e=()=>{c(t=>t+1),r.current=requestAnimationFrame(e)};r.current=requestAnimationFrame(e)}else r.current&&cancelAnimationFrame(r.current),c(0);return()=>{r.current&&cancelAnimationFrame(r.current)}},[i,o]);let g=()=>o.split("").map((e,t)=>{let n=p.current[t];return!i||!n||f>=n.end?s("span",{children:e},t):f>=n.start?((!n.char||Math.random()<.28)&&(n.char=u[Math.floor(Math.random()*u.length)]),P("span",{className:"relative inline-block",children:[s("span",{className:"invisible opacity-0","aria-hidden":"true",children:e===" "?"\xA0":e}),s("span",{className:"absolute inset-0 flex items-center justify-center font-mono opacity-50",children:n.char})]},t)):s("span",{children:e},t)}),d={className:M("inline-flex items-center justify-center whitespace-nowrap",N),onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),...A};return R&&k(a)?s(w,{...d,children:x.cloneElement(a,{},g())}):s(v,{href:L||"#",...d,children:g()})},D=G;export{C as a,D as b};
3
- //# sourceMappingURL=chunk-P7ACUHYG.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/components/GlitchLink.tsx"],"sourcesContent":["\"use client\"\nimport Link from \"next/link\"\nimport React, {\n useState,\n useEffect,\n useRef,\n ReactNode,\n isValidElement,\n useMemo,\n} from \"react\"\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cn } from \"@/lib/utils\"\n\nexport const DEFAULT_SYMBOLS = \"!<>-_\\\\/[]{}—=+*^?#________\"\n\ntype GlitchLinkProps = {\n href?: string\n children: ReactNode\n symbols?: string\n className?: string\n asChild?: boolean\n duration?: number\n}\n\nconst GlitchLink = ({\n href,\n children,\n symbols = DEFAULT_SYMBOLS,\n className,\n asChild = false,\n duration = 40,\n ...props\n}: GlitchLinkProps) => {\n const [isHovering, setIsHovering] = useState(false)\n const [frame, setFrame] = useState(0)\n const rafRef = useRef<number>()\n const queueRef = useRef<\n { to: string; start: number; end: number; char?: string }[]\n >([])\n\n const getTextContent = (node: ReactNode): string => {\n if (typeof node === \"string\" || typeof node === \"number\")\n return String(node)\n if (isValidElement(node) && node.props.children)\n return getTextContent(node.props.children)\n return \"\"\n }\n\n const originalText = useMemo(() => getTextContent(children), [children])\n\n const setupQueue = () => {\n const newQueue = []\n for (let i = 0; i < originalText.length; i++) {\n const to = originalText[i]\n const start = Math.floor(Math.random() * (duration * 0.5))\n const end = start + Math.floor(Math.random() * (duration * 0.5))\n newQueue.push({ to, start, end })\n }\n queueRef.current = newQueue\n setFrame(0)\n }\n\n useEffect(() => {\n if (isHovering && originalText) {\n setupQueue()\n const update = () => {\n setFrame((prev) => prev + 1)\n rafRef.current = requestAnimationFrame(update)\n }\n rafRef.current = requestAnimationFrame(update)\n } else {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n setFrame(0)\n }\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }, [isHovering, originalText])\n\n const renderContent = () => {\n return originalText.split(\"\").map((char, i) => {\n const item = queueRef.current[i]\n\n // If not hovering, or animation for this char hasn't started, or it's finished\n if (!isHovering || !item || frame >= item.end) {\n return <span key={i}>{char}</span>\n }\n\n // If we are in the scrambling phase for this specific character\n if (frame >= item.start) {\n if (!item.char || Math.random() < 0.28) {\n item.char = symbols[Math.floor(Math.random() * symbols.length)]\n }\n return (\n <span key={i} className=\"relative inline-block\">\n {/* The invisible real character preserves the exact width */}\n <span className=\"invisible opacity-0\" aria-hidden=\"true\">\n {char === \" \" ? \"\\u00A0\" : char}\n </span>\n {/* The absolute symbol sits exactly on top of that width */}\n <span className=\"absolute inset-0 flex items-center justify-center font-mono opacity-50\">\n {item.char}\n </span>\n </span>\n )\n }\n\n // Default: show original character\n return <span key={i}>{char}</span>\n })\n }\n\n const commonProps = {\n className: cn(\n \"inline-flex items-center justify-center whitespace-nowrap\",\n className\n ),\n onMouseEnter: () => setIsHovering(true),\n onMouseLeave: () => setIsHovering(false),\n ...props,\n }\n\n if (asChild && isValidElement(children)) {\n return (\n <Slot {...commonProps}>\n {React.cloneElement(children as any, {}, renderContent())}\n </Slot>\n )\n }\n\n return (\n <Link href={href || \"#\"} {...commonProps}>\n {renderContent()}\n </Link>\n )\n}\n\nexport default GlitchLink\n"],"mappings":";yCACA,OAAOA,MAAU,YACjB,OAAOC,GACL,YAAAC,EACA,aAAAC,EACA,UAAAC,EAEA,kBAAAC,EACA,WAAAC,MACK,QACP,OAAS,QAAAC,MAAY,uBA2EN,cAAAC,EASL,QAAAC,MATK,oBAxER,IAAMC,EAAkB,mCAWzBC,EAAa,CAAC,CAClB,KAAAC,EACA,SAAAC,EACA,QAAAC,EAAUJ,EACV,UAAAK,EACA,QAAAC,EAAU,GACV,SAAAC,EAAW,GACX,GAAGC,CACL,IAAuB,CACrB,GAAM,CAACC,EAAYC,CAAa,EAAIC,EAAS,EAAK,EAC5C,CAACC,EAAOC,CAAQ,E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AAc,SAAAkC,GAAJR,CAAS,EAIzBZ,GAASqB,EAAK,QACZ,CAACA,EAAK,MAAQ,KAAK,OAAO,EAAI,OAChCA,EAAK,KAAO7B,EAAQ,KAAK,MAAM,KAAK,OAAO,EAAIA,EAAQ,MAAM,CAAC,GAG9DL,EAAC,QAAa,UAAU,wBAEtB,UAAAD,EAAC,QAAK,UAAU,sBAAsB,cAAY,OAC/C,SAAAkC,IAAS,IAAM,OAAWA,EAC7B,EAEAlC,EAAC,QAAK,UAAU,yEACb,SAAAmC,EAAK,KACR,IARST,CASX,GAKG1B,EAAC,QAAc,SAAAkC,GAAJR,CAAS,CAC7B,CAAC,EAGGU,EAAc,CAClB,UAAWC,EACT,4DACA9B,CACF,EACA,aAAc,IAAMK,EAAc,EAAI,EACtC,aAAc,IAAMA,EAAc,EAAK,EACvC,GAAGF,CACL,EAEA,OAAIF,GAAWa,EAAehB,CAAQ,EAElCL,EAACsC,EAAA,CAAM,GAAGF,EACP,SAAAG,EAAM,aAAalC,EAAiB,CAAC,EAAG4B,EAAc,CAAC,EAC1D,EAKFjC,EAACwC,EAAA,CAAK,KAAMpC,GAAQ,IAAM,GAAGgC,EAC1B,SAAAH,EAAc,EACjB,CAEJ,EAEOQ,EAAQtC","names":["Link","React","useState","useEffect","useRef","isValidElement","useMemo","Slot","jsx","jsxs","DEFAULT_SYMBOLS","GlitchLink","href","children","symbols","className","asChild","duration","props","isHovering","setIsHovering","useState","frame","setFrame","rafRef","useRef","queueRef","getTextContent","node","isValidElement","originalText","useMemo","setupQueue","newQueue","i","to","start","end","useEffect","update","prev","renderContent","char","item","commonProps","cn","Slot","React","Link","GlitchLink_default"]}