@alkimi.org/ui-kit 0.9.1 → 0.9.2
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/{chunk-VNF4HDJR.mjs → chunk-2CF4QASK.mjs} +2 -2
- package/dist/chunk-2CF4QASK.mjs.map +1 -0
- package/dist/chunk-CMV76O4U.mjs +3 -0
- package/dist/chunk-CMV76O4U.mjs.map +1 -0
- package/dist/chunk-EWRKHBIV.js +3 -0
- package/dist/chunk-EWRKHBIV.js.map +1 -0
- package/dist/{chunk-ZF6PO6PJ.js → chunk-I5INE4KG.js} +2 -2
- package/dist/{chunk-ZF6PO6PJ.js.map → chunk-I5INE4KG.js.map} +1 -1
- package/dist/chunk-MSYJFTUX.js +3 -0
- package/dist/{chunk-527KMCOG.js.map → chunk-MSYJFTUX.js.map} +1 -1
- package/dist/{chunk-RLO6XENU.js → chunk-RKONP3N6.js} +2 -2
- package/dist/{chunk-RLO6XENU.js.map → chunk-RKONP3N6.js.map} +1 -1
- package/dist/chunk-RYJZXDJ5.mjs +3 -0
- package/dist/chunk-RYJZXDJ5.mjs.map +1 -0
- package/dist/chunk-WY4HCUAP.mjs +3 -0
- package/dist/chunk-WY4HCUAP.mjs.map +1 -0
- package/dist/components/GeometricFluidGrid.js +1 -1
- package/dist/components/GeometricFluidGrid.mjs +1 -1
- package/dist/components/TextDecoder.d.mts +3 -2
- package/dist/components/TextDecoder.d.ts +3 -2
- package/dist/components/TextDecoder.js +1 -1
- package/dist/components/TextDecoder.mjs +1 -1
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/breadcrumb.mjs +1 -1
- package/dist/components/breadcrumb.mjs.map +1 -1
- package/dist/components/button.d.mts +1 -1
- package/dist/components/button.d.ts +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.mjs +1 -1
- package/dist/components/command.d.mts +2 -2
- package/dist/components/command.d.ts +2 -2
- package/dist/components/label.js +1 -1
- package/dist/components/label.mjs +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/slider.js.map +1 -1
- package/dist/components/slider.mjs +1 -1
- package/dist/components/slider.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-527KMCOG.js +0 -3
- package/dist/chunk-G7EYYKWS.js +0 -3
- package/dist/chunk-G7EYYKWS.js.map +0 -1
- package/dist/chunk-GOZDJRUZ.mjs +0 -3
- package/dist/chunk-GOZDJRUZ.mjs.map +0 -1
- package/dist/chunk-RGSVOR7N.mjs +0 -3
- package/dist/chunk-RGSVOR7N.mjs.map +0 -1
- package/dist/chunk-VNF4HDJR.mjs.map +0 -1
- package/dist/chunk-XFLIVHNV.mjs +0 -3
- package/dist/chunk-XFLIVHNV.mjs.map +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as c}from"./chunk-KPAOPUY2.mjs";import{useEffect as N,useRef as $}from"react";import{jsx as D}from"react/jsx-runtime";var m=
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
import{a as c}from"./chunk-KPAOPUY2.mjs";import{useEffect as N,useRef as $}from"react";import{jsx as D}from"react/jsx-runtime";var m=17,B=1,P=5,q=(x,a)=>{if(x<a){let s=1-x/a;return s*s*(3-2*s)}return 0},v=class{constructor(a){c(this,"x",0);c(this,"y",0);c(this,"anchorX",0);c(this,"anchorY",0);c(this,"vx",0);c(this,"vy",0);c(this,"nodes",[]);c(this,"opacity",0);c(this,"glitchZones",[]);c(this,"maxReach",180);this.anchorX=a.x,this.anchorY=a.y,this.x=this.anchorX,this.y=this.anchorY,this.init()}init(){this.nodes=[];let a=3+Math.floor(Math.random()*3);for(let s=0;s<a;s++){let e=15+Math.random()*25,b=(Math.random()-.5)*60,u=(Math.random()-.5)*60;this.nodes.push({offsetX:b,offsetY:u,vx:(Math.random()-.5)*.1,vy:(Math.random()-.5)*.1,radius:e,t:Math.random()*100})}this.opacity=1}update(){let a=this.anchorX-this.x,s=this.anchorY-this.y,e=5e-4,b=a*e,u=s*e,g=(Math.random()-.5)*.01,r=(Math.random()-.5)*.01;if(this.vx+=b+g,this.vy+=u+r,this.vx*=.96,this.vy*=.96,this.x+=this.vx,this.y+=this.vy,this.nodes.forEach(n=>{n.t+=.005,n.offsetX+=Math.sin(n.t)*.1+n.vx,n.offsetY+=Math.cos(n.t*.9)*.1+n.vy;let d=70;(n.offsetX>d||n.offsetX<-d)&&(n.vx*=-1),(n.offsetY>d||n.offsetY<-d)&&(n.vy*=-1),n.radius+=Math.sin(n.t*2)*.1}),this.glitchZones=this.glitchZones.filter(n=>n.life>0),this.glitchZones.forEach(n=>n.life--),Math.random()<.03){let d=f=>Math.round((f-m/2)/m)*m+m/2,R=this.x+(Math.random()-.5)*80,X=this.y+(Math.random()-.5)*80,p=d(R),i=d(X);if((Math.random()>.6?"line":"dot")==="line"){let f=Math.random()>.5,y=40+Math.random()*80,t=2;this.glitchZones.push({x:f?p-t/2:p-y/2,y:f?i-y/2:i-t/2,w:f?t:y,h:f?y:t,life:8+Math.random()*12})}else this.glitchZones.push({x:p-4/2,y:i-4/2,w:4,h:4,life:6+Math.random()*10})}}},F=class{constructor(a,s){c(this,"x");c(this,"y");c(this,"opacity");c(this,"decay");c(this,"nodes");c(this,"maxReach",60);this.x=a,this.y=s,this.opacity=.8,this.decay=.03,this.nodes=[];let e=2;for(let b=0;b<e;b++)this.nodes.push({offsetX:(Math.random()-.5)*10,offsetY:(Math.random()-.5)*10,vx:(Math.random()-.5)*1,vy:(Math.random()-.5)*1,radius:5+Math.random()*10,t:0})}update(){this.opacity-=this.decay,this.nodes.forEach(a=>{a.offsetX+=a.vx,a.offsetY+=a.vy,a.radius*=.95})}},_=({variant:x="animated"})=>{let a=$(null);return N(()=>{let s=a.current;if(!s)return;let e=s.getContext("2d");if(!e)return;let b,u=[],g=[],r={x:-1e3,y:-1e3,lastX:-1e3,lastY:-1e3},n=()=>{u=[];let i=s.width,h=s.height;u.push(new v({x:i-i*.15,y:h*.15})),u.push(new v({x:i*.4,y:h*.4})),u.push(new v({x:i*.05+50,y:h-h*.15})),u.push(new v({x:i-i*.05-50,y:h-h*.05-50}))},d=()=>{let i=s.getBoundingClientRect();s.width=i.width,s.height=i.height,n()},R=i=>{let h=s.getBoundingClientRect();r.x=i.clientX-h.left,r.y=i.clientY-h.top,r.lastX===-1e3&&(r.lastX=r.x,r.lastY=r.y);let f=r.x-r.lastX,y=r.y-r.lastY;Math.sqrt(f*f+y*y)>20&&(g.push(new F(r.x,r.y)),r.lastX=r.x,r.lastY=r.y)},X=()=>{d()},p=()=>{let i=s.width,h=s.height;if(e.fillStyle="#050505",e.fillRect(0,0,i,h),x==="static"){for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m)e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1);return}u.forEach(t=>t.update());for(let t=g.length-1;t>=0;t--)g[t].update(),g[t].opacity<=0&&g.splice(t,1);let f=[...u,...g],y=[];u.forEach(t=>y.push(...t.glitchZones));for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m){let C=!1;for(let o of y)if(t>=o.x&&t<=o.x+o.w&&l>=o.y&&l<=o.y+o.h){C=!0;break}if(C){if(e.fillStyle="rgba(182, 243, 191, 0.95)",Math.random()>.1){let o=Math.random()>.5?P*.7:B*2;e.beginPath(),e.arc(t,l,o/2,0,Math.PI*2),e.fill()}continue}let M=0,I=!1;for(let o of f)if(Math.abs(t-o.x)<o.maxReach&&Math.abs(l-o.y)<o.maxReach){I=!0;break}if(!I){e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1);continue}for(let o of f){let E=t-o.x,z=l-o.y;if(Math.abs(E)>o.maxReach||Math.abs(z)>o.maxReach)continue;let w=0;for(let Y of o.nodes){let Z=E-Y.offsetX,G=z-Y.offsetY,S=Math.sqrt(Z*Z+G*G);w+=q(S,Y.radius)}w>1&&(w=1),M+=w*o.opacity}if(M>1&&(M=1),M>.01){let G=Math.floor(255+-73*M),S=Math.floor(255+-12*M),L=Math.floor(255+-64*M),A=M*.5,k=B+M*(P-B);e.fillStyle=`rgba(${G}, ${S}, ${L}, ${A})`,e.beginPath(),e.arc(t,l,k/2,0,Math.PI*2),e.fill()}else e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1)}b=requestAnimationFrame(p)};return window.addEventListener("resize",X),x==="animated"&&window.addEventListener("mousemove",R),d(),p(),()=>{window.removeEventListener("resize",X),x==="animated"&&window.removeEventListener("mousemove",R),cancelAnimationFrame(b)}},[x]),D("canvas",{ref:a,className:"fixed inset-0 -z-999 w-full h-full pointer-events-none"})},V=_;export{V as a};
|
|
3
|
+
//# sourceMappingURL=chunk-2CF4QASK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/GeometricFluidGrid.tsx"],"sourcesContent":["\"use client\"\nimport React, { useEffect, useRef } from \"react\"\n\n// --- CONFIGURATION ---\nconst GAP = 17\nconst BASE_SIZE = 1\nconst MAX_SIZE = 5\n\n// --- TYPES ---\ninterface Node {\n offsetX: number\n offsetY: number\n vx: number\n vy: number\n radius: number\n t: number\n}\n\ninterface GlitchZone {\n x: number\n y: number\n w: number\n h: number\n life: number\n}\n\ninterface MouseState {\n x: number\n y: number\n lastX: number\n lastY: number\n}\n\n// --- MATH HELPERS ---\nconst getFalloff = (dist: number, radius: number): number => {\n if (dist < radius) {\n const val = 1 - dist / radius\n return val * val * (3 - 2 * val)\n }\n return 0\n}\n\n// --- CLASSES ---\nclass AnchoredBlob {\n // Current Position\n x: number = 0\n y: number = 0\n\n // Anchor Position (Home base)\n anchorX: number = 0\n anchorY: number = 0\n\n // Movement\n vx: number = 0\n vy: number = 0\n\n // Appearance\n nodes: Node[] = []\n opacity: number = 0\n\n // Glitch State\n glitchZones: GlitchZone[] = []\n maxReach: number = 180\n\n constructor(anchorConfig: { x: number; y: number }) {\n this.anchorX = anchorConfig.x\n this.anchorY = anchorConfig.y\n this.x = this.anchorX\n this.y = this.anchorY\n this.init()\n }\n\n init() {\n // 1. Create Internal Nodes (The \"Blob\" composition)\n this.nodes = []\n const nodeCount = 3 + Math.floor(Math.random() * 3) // 3 to 5 nodes\n\n for (let i = 0; i < nodeCount; i++) {\n // Significantly smaller radius (15-40px) to reduce central bulk\n const r = 15 + Math.random() * 25\n // Wider initial spread\n const ox = (Math.random() - 0.5) * 60\n const oy = (Math.random() - 0.5) * 60\n\n this.nodes.push({\n offsetX: ox,\n offsetY: oy,\n vx: (Math.random() - 0.5) * 0.1, // Slower internal movement (was 0.4)\n vy: (Math.random() - 0.5) * 0.1,\n radius: r,\n t: Math.random() * 100,\n })\n }\n\n this.opacity = 1\n }\n\n update() {\n // --- 1. Tethered Movement Logic ---\n const dx = this.anchorX - this.x\n const dy = this.anchorY - this.y\n\n // Spring constant (very loose)\n const k = 0.0005\n const ax = dx * k\n const ay = dy * k\n\n // Random wandering force - Reduced significantly for slower drift\n const wx = (Math.random() - 0.5) * 0.01 // was 0.05\n const wy = (Math.random() - 0.5) * 0.01 // was 0.05\n\n this.vx += ax + wx\n this.vy += ay + wy\n\n this.vx *= 0.96\n this.vy *= 0.96\n\n this.x += this.vx\n this.y += this.vy\n\n // --- 2. Internal Node Animation ---\n this.nodes.forEach((node) => {\n // Slow down time step\n node.t += 0.005 // was 0.02\n\n // Slower oscillation and movement\n node.offsetX += Math.sin(node.t) * 0.1 + node.vx // amp was 0.4\n node.offsetY += Math.cos(node.t * 0.9) * 0.1 + node.vy\n\n // Constrain to \"nucleus\"\n const maxDist = 70\n if (node.offsetX > maxDist || node.offsetX < -maxDist) node.vx *= -1\n if (node.offsetY > maxDist || node.offsetY < -maxDist) node.vy *= -1\n\n // Pulse size\n node.radius += Math.sin(node.t * 2) * 0.1\n })\n\n // --- 3. Manage Glitch Zones ---\n // Remove dead glitches\n this.glitchZones = this.glitchZones.filter((g) => g.life > 0)\n this.glitchZones.forEach((g) => g.life--)\n\n // Randomly spawn new glitches\n if (Math.random() < 0.03) {\n // 3% chance per frame\n const spread = 80\n\n // Snap random positions to exact grid points to ensure clean lines\n const snap = (v: number) =>\n Math.round((v - GAP / 2) / GAP) * GAP + GAP / 2\n\n const rawCx = this.x + (Math.random() - 0.5) * spread\n const rawCy = this.y + (Math.random() - 0.5) * spread\n\n const cx = snap(rawCx)\n const cy = snap(rawCy)\n\n const type = Math.random() > 0.6 ? \"line\" : \"dot\"\n\n if (type === \"line\") {\n const isVert = Math.random() > 0.5\n // Medium length: 40-120px\n const len = 40 + Math.random() * 80\n\n // Thickness is essentially zero (just a sliver) centered on the grid line\n // to guarantee we only pick up exactly one row/column of dots\n const thickness = 2\n\n this.glitchZones.push({\n x: isVert ? cx - thickness / 2 : cx - len / 2,\n y: isVert ? cy - len / 2 : cy - thickness / 2,\n w: isVert ? thickness : len,\n h: isVert ? len : thickness,\n life: 8 + Math.random() * 12,\n })\n } else {\n // Single dot\n // Box just large enough to catch one grid point\n const size = 4\n\n this.glitchZones.push({\n x: cx - size / 2,\n y: cy - size / 2,\n w: size,\n h: size,\n life: 6 + Math.random() * 10,\n })\n }\n }\n }\n}\n\nclass TrailBlob {\n x: number\n y: number\n opacity: number\n decay: number\n nodes: Node[]\n maxReach: number = 60\n\n constructor(x: number, y: number) {\n this.x = x\n this.y = y\n this.opacity = 0.8\n this.decay = 0.03\n\n this.nodes = []\n const count = 2\n for (let i = 0; i < count; i++) {\n this.nodes.push({\n offsetX: (Math.random() - 0.5) * 10,\n offsetY: (Math.random() - 0.5) * 10,\n vx: (Math.random() - 0.5) * 1,\n vy: (Math.random() - 0.5) * 1,\n radius: 5 + Math.random() * 10,\n t: 0,\n })\n }\n }\n\n update() {\n this.opacity -= this.decay\n this.nodes.forEach((node) => {\n node.offsetX += node.vx\n node.offsetY += node.vy\n node.radius *= 0.95\n })\n }\n}\n\ninterface GeometricFluidGridProps {\n variant?: \"animated\" | \"static\"\n}\n\nconst GeometricFluidGrid: React.FC<GeometricFluidGridProps> = ({\n variant = \"animated\",\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n\n useEffect(() => {\n const canvas = canvasRef.current\n if (!canvas) return\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n let animationFrameId: number\n let orbs: AnchoredBlob[] = []\n let trail: TrailBlob[] = []\n let mouse: MouseState = { x: -1000, y: -1000, lastX: -1000, lastY: -1000 }\n\n const initWorld = () => {\n orbs = []\n const w = canvas.width\n const h = canvas.height\n\n // 1. Top Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.15,\n y: h * 0.15,\n })\n )\n\n // 2. ~40% from top and ~40% from left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.4,\n y: h * 0.4,\n })\n )\n\n // 3. Bottom Left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.05 + 50,\n y: h - h * 0.15,\n })\n )\n\n // 4. Bottom Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.05 - 50,\n y: h - h * 0.05 - 50,\n })\n )\n }\n\n const resize = () => {\n const rect = canvas.getBoundingClientRect()\n canvas.width = rect.width\n canvas.height = rect.height\n initWorld()\n }\n\n const handleMouseMove = (e: MouseEvent) => {\n const rect = canvas.getBoundingClientRect()\n mouse.x = e.clientX - rect.left\n mouse.y = e.clientY - rect.top\n\n if (mouse.lastX === -1000) {\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n\n const dx = mouse.x - mouse.lastX\n const dy = mouse.y - mouse.lastY\n const dist = Math.sqrt(dx * dx + dy * dy)\n\n if (dist > 20) {\n trail.push(new TrailBlob(mouse.x, mouse.y))\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n }\n\n const handleResize = () => {\n resize()\n }\n\n const draw = () => {\n const w = canvas.width\n const h = canvas.height\n\n // Clear Screen\n ctx.fillStyle = \"#050505\"\n ctx.fillRect(0, 0, w, h)\n\n // Static variant: just render uniform dots\n if (variant === \"static\") {\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n return // No animation loop for static variant\n }\n\n // Animated variant: update and render with animations\n // Update Logic\n orbs.forEach((orb) => orb.update())\n for (let i = trail.length - 1; i >= 0; i--) {\n trail[i].update()\n if (trail[i].opacity <= 0) trail.splice(i, 1)\n }\n\n const renderList = [...orbs, ...trail]\n\n // Collect all glitch zones for easier checking inside the loop\n // We flat map them to a simple array to iterate quickly\n const allGlitches: GlitchZone[] = []\n orbs.forEach((o) => allGlitches.push(...o.glitchZones))\n\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n // --- GLITCH CHECK ---\n // Check if this specific grid dot is inside a glitch zone\n let isGlitching = false\n for (const g of allGlitches) {\n // Simple AABB check\n if (x >= g.x && x <= g.x + g.w && y >= g.y && y <= g.y + g.h) {\n isGlitching = true\n break\n }\n }\n\n if (isGlitching) {\n // Glitched Dot: Bright\n // We use the grid itself to manifest the glitch\n ctx.fillStyle = \"rgba(182, 243, 191, 0.95)\"\n\n // Randomly skip some dots in the glitch line for a \"broken\" look\n if (Math.random() > 0.1) {\n const size = Math.random() > 0.5 ? MAX_SIZE * 0.7 : BASE_SIZE * 2\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n }\n continue // Skip standard influence calculation for this dot\n }\n\n // --- STANDARD INFLUENCE CHECK ---\n let totalInfluence = 0\n\n // Optimization: Is near blob?\n let nearby = false\n for (const entity of renderList) {\n if (\n Math.abs(x - entity.x) < entity.maxReach &&\n Math.abs(y - entity.y) < entity.maxReach\n ) {\n nearby = true\n break\n }\n }\n\n if (!nearby) {\n // Passive Background Dot\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n continue\n }\n\n // Calculate Influence\n for (const entity of renderList) {\n const dx = x - entity.x\n const dy = y - entity.y\n\n if (\n Math.abs(dx) > entity.maxReach ||\n Math.abs(dy) > entity.maxReach\n )\n continue\n\n let localInf = 0\n for (const node of entity.nodes) {\n const nx = dx - node.offsetX\n const ny = dy - node.offsetY\n const dist = Math.sqrt(nx * nx + ny * ny)\n localInf += getFalloff(dist, node.radius)\n }\n if (localInf > 1) localInf = 1\n totalInfluence += localInf * entity.opacity\n }\n\n if (totalInfluence > 1) totalInfluence = 1\n\n // Draw Cell\n if (totalInfluence > 0.01) {\n // Gradient: White (Edge) to Green (#B6F3BF - Center)\n const edgeR = 255,\n centerR = 182\n const edgeG = 255,\n centerG = 243\n const edgeB = 255,\n centerB = 191\n\n // Interpolate from White (0 influence) to Green (1 influence)\n const r = Math.floor(edgeR + (centerR - edgeR) * totalInfluence)\n const g = Math.floor(edgeG + (centerG - edgeG) * totalInfluence)\n const b = Math.floor(edgeB + (centerB - edgeB) * totalInfluence)\n\n const alpha = totalInfluence * 0.5\n const size = BASE_SIZE + totalInfluence * (MAX_SIZE - BASE_SIZE)\n\n ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${alpha})`\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n } else {\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n }\n\n animationFrameId = requestAnimationFrame(draw)\n }\n\n window.addEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.addEventListener(\"mousemove\", handleMouseMove)\n }\n\n resize()\n draw()\n\n return () => {\n window.removeEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.removeEventListener(\"mousemove\", handleMouseMove)\n }\n cancelAnimationFrame(animationFrameId)\n }\n }, [variant])\n\n return (\n <canvas\n ref={canvasRef}\n className=\"fixed inset-0 -z-999 w-full h-full pointer-events-none\"\n />\n )\n}\n\nexport default GeometricFluidGrid\n"],"mappings":";yCACA,OAAgB,aAAAA,EAAW,UAAAC,MAAc,QA+drC,cAAAC,MAAA,oBA5dJ,IAAMC,EAAM,GACNC,EAAY,EACZC,EAAW,EA4BXC,EAAa,CAACC,EAAcC,IAA2B,CAC3D,GAAID,EAAOC,EAAQ,CACjB,IAAMC,EAAM,EAAIF,EAAOC,EACvB,OAAOC,EAAMA,GAAO,EAAI,EAAIA,EAC9B,CACA,MAAO,EACT,EAGMC,EAAN,KAAmB,CAqBjB,YAAYC,EAAwC,CAnBpDC,EAAA,SAAY,GACZA,EAAA,SAAY,GAGZA,EAAA,eAAkB,GAClBA,EAAA,eAAkB,GAGlBA,EAAA,UAAa,GACbA,EAAA,UAAa,GAGbA,EAAA,aAAgB,CAAC,GACjBA,EAAA,eAAkB,GAGlBA,EAAA,mBAA4B,CAAC,GAC7BA,EAAA,gBAAmB,KAGjB,KAAK,QAAUD,EAAa,EAC5B,KAAK,QAAUA,EAAa,EAC5B,KAAK,EAAI,KAAK,QACd,KAAK,EAAI,KAAK,QACd,KAAK,KAAK,CACZ,CAEA,MAAO,CAEL,KAAK,MAAQ,CAAC,EACd,IAAME,EAAY,EAAI,KAAK,MAAM,KAAK,OAAO,EAAI,CAAC,EAElD,QAASC,EAAI,EAAGA,EAAID,EAAWC,IAAK,CAElC,IAAMC,EAAI,GAAK,KAAK,OAAO,EAAI,GAEzBC,GAAM,KAAK,OAAO,EAAI,IAAO,GAC7BC,GAAM,KAAK,OAAO,EAAI,IAAO,GAEnC,KAAK,MAAM,KAAK,CACd,QAASD,EACT,QAASC,EACT,IAAK,KAAK,OAAO,EAAI,IAAO,GAC5B,IAAK,KAAK,OAAO,EAAI,IAAO,GAC5B,OAAQF,EACR,EAAG,KAAK,OAAO,EAAI,GACrB,CAAC,CACH,CAEA,KAAK,QAAU,CACjB,CAE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,EAAO7D,EAAY8D,GAAkB7D,EAAWD,GAEtD2C,EAAI,UAAY,QAAQhC,CAAC,KAAKY,CAAC,KAAK6C,CAAC,KAAKC,CAAK,IAC/C1B,EAAI,UAAU,EACdA,EAAI,IAAIT,EAAGC,EAAG0B,EAAO,EAAG,EAAG,KAAK,GAAK,CAAC,EACtClB,EAAI,KAAK,CACX,MACEA,EAAI,UAAY,sBAChBA,EAAI,SAAST,EAAI,GAAKC,EAAI,GAAK,EAAG,CAAC,CAEvC,CAGFS,EAAmB,sBAAsBW,CAAI,CAC/C,EAEA,cAAO,iBAAiB,SAAUD,CAAY,EAC1ChB,IAAY,YACd,OAAO,iBAAiB,YAAac,CAAe,EAGtDF,EAAO,EACPK,EAAK,EAEE,IAAM,CACX,OAAO,oBAAoB,SAAUD,CAAY,EAC7ChB,IAAY,YACd,OAAO,oBAAoB,YAAac,CAAe,EAEzD,qBAAqBR,CAAgB,CACvC,CACF,EAAG,CAACN,CAAO,CAAC,EAGVxC,EAAC,UACC,IAAKyC,EACL,UAAU,yDACZ,CAEJ,EAEO+B,EAAQjC","names":["useEffect","useRef","jsx","GAP","BASE_SIZE","MAX_SIZE","getFalloff","dist","radius","val","AnchoredBlob","anchorConfig","__publicField","nodeCount","i","r","ox","oy","dx","dy","k","ax","ay","wx","wy","node","maxDist","g","snap","v","rawCx","rawCy","cx","cy","isVert","len","thickness","TrailBlob","x","y","count","GeometricFluidGrid","variant","canvasRef","useRef","useEffect","canvas","ctx","animationFrameId","orbs","trail","mouse","initWorld","w","resize","rect","handleMouseMove","e","handleResize","draw","orb","renderList","allGlitches","o","isGlitching","size","totalInfluence","nearby","entity","localInf","nx","ny","b","alpha","GeometricFluidGrid_default"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as w}from"./chunk-S5TKCF6T.mjs";import R,{useState as q,useEffect as E,useMemo as $,useRef as p}from"react";import{jsx as h,jsxs as I}from"react/jsx-runtime";var j="!<>-_\\/[]{}\u2014=+*^?#________",C=e=>e[Math.floor(Math.random()*e.length)],S=e=>{if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(S).join("");if(R.isValidElement(e)){let s=e.props;return(s.text||"")+(s.label||"")+(s.title||"")+S(s.children)}return""},N=(e,s,i)=>{if(typeof e=="string"||typeof e=="number"){let l=String(e),c=[];for(let m=0;m<l.length;m++)c.push(h(R.Fragment,{children:s[i.current]||""},`char-${i.current}`)),i.current++;return c}if(Array.isArray(e))return e.map((l,c)=>h(R.Fragment,{children:N(l,s,i)},`arr-${c}-${i.current}`));if(R.isValidElement(e)){let l=e.props,c={};return l.children&&(c.children=N(l.children,s,i)),R.cloneElement(e,c)}return e};function L({children:e,className:s,duration:i=40,symbols:l=j,delay:c=0,isLoading:m=!1,speed:T=.28}){let[D,_]=q(null),[P,y]=q(!1),A=p(null),g=p(0),b=p([]),t=p(null),F=p(!1),f=$(()=>S(e),[e]),k=()=>{let r=[];for(let u=0;u<f.length;u++){let n=f[u],o=Math.floor(Math.random()*(i*.5)),a=o+Math.floor(Math.random()*(i*.5));r.push({to:n,start:o,end:a})}b.current=r,g.current=0,y(!1)},d=p([]),v=()=>{let r=[];d.current.length!==f.length&&(d.current=new Array(f.length).fill(void 0));for(let n=0;n<f.length;n++){let o=f[n];o===" "?r.push(" "):((!d.current[n]||Math.random()<T)&&(d.current[n]=C(l)),r.push(I("span",{className:"relative inline-block",children:[h("span",{className:"invisible select-none","aria-hidden":"true",children:o}),h("span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none",children:d.current[n]})]},n)))}_(N(e,r,{current:0})),t.current=requestAnimationFrame(v)},x=()=>{let r=0,u=[];for(let o=0;o<b.current.length;o++){let a=b.current[o];g.current>=a.end?(r++,u.push(a.to)):(g.current>=a.start&&(!a.char||Math.random()<T)&&(a.char=C(l)),u.push(I("span",{className:"relative inline-block",children:[h("span",{className:"invisible select-none","aria-hidden":"true",children:a.to===" "?"\xA0":a.to}),g.current>=a.start&&h("span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none",children:a.char})]},o)))}_(N(e,u,{current:0})),r===b.current.length?y(!0):(g.current++,t.current=requestAnimationFrame(x))},M=p(!1);return E(()=>{if(m)return M.current=!0,F.current=!0,y(!1),t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(v),()=>{t.current&&cancelAnimationFrame(t.current)};if(M.current)return M.current=!1,k(),t.current=requestAnimationFrame(x),()=>{t.current&&cancelAnimationFrame(t.current)}},[m,f]),E(()=>{if(m)return;let r=new IntersectionObserver(u=>{if(u[0].isIntersecting&&!F.current){F.current=!0;let n=setTimeout(()=>{k(),t.current=requestAnimationFrame(x)},c);return()=>clearTimeout(n)}},{threshold:.1});return A.current&&r.observe(A.current),()=>{r.disconnect(),t.current&&cancelAnimationFrame(t.current)}},[f,c,m]),h("span",{ref:A,className:w("inline-block whitespace-pre-wrap",s),children:P?e:D})}export{L as a};
|
|
3
|
+
//# sourceMappingURL=chunk-CMV76O4U.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 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 isLoading?: boolean\n speed?: number\n}\n\nexport default function TextDecoder ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n isLoading = false,\n speed = 0.28,\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 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 loadingCharsRef = useRef<(string | undefined)[]>([])\n\n const updateLoading = () => {\n const currentScrambledChars: (string | ReactNode)[] = []\n\n if (loadingCharsRef.current.length !== fullText.length) {\n loadingCharsRef.current = new Array(fullText.length).fill(undefined)\n }\n\n for (let i = 0; i < fullText.length; i++) {\n const char = fullText[i]\n\n if (char === \" \") {\n currentScrambledChars.push(\" \")\n } else {\n if (!loadingCharsRef.current[i] || Math.random() < speed) {\n loadingCharsRef.current[i] = randomChar(symbols)\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {char}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none\">\n {loadingCharsRef.current[i]}\n </span>\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(children, currentScrambledChars, indexObj)\n )\n\n rafRef.current = requestAnimationFrame(updateLoading)\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 complete++\n currentScrambledChars.push(item.to)\n } else {\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < speed) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono 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 const wasLoadingRef = useRef(false)\n\n useEffect(() => {\n if (isLoading) {\n wasLoadingRef.current = true\n hasAnimatedRef.current = true\n setIsComplete(false)\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n rafRef.current = requestAnimationFrame(updateLoading)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n\n if (wasLoadingRef.current) {\n wasLoadingRef.current = false\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n }, [isLoading, fullText])\n\n useEffect(() => {\n if (isLoading) return\n\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, isLoading])\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"],"mappings":";yCAEA,OAAOA,GACL,YAAAC,EACA,aAAAC,EACA,WAAAC,EACA,UAAAC,MAEK,QAgCC,cAAAC,EAiGE,QAAAC,MAjGF,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,GAAIV,EAAM,eAAeW,CAAI,EAAG,CAC9B,IAAMC,EAAQD,EAAK,MACnB,OACGC,EAAM,MAAQ,KACdA,EAAM,OAAS,KACfA,EAAM,OAAS,IAChBF,EAAYE,EAAM,QAAQ,CAE9B,CACA,MAAO,EACT,EAEMC,EAAsB,CAC1BF,EACAG,EACAC,IACc,CACd,GAAI,OAAOJ,GAAS,UAAY,OAAOA,GAAS,SAA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,EAAW,EACXH,EAAO,QAAU,sBAAsBY,CAAM,CAC/C,EAAGtB,CAAK,EACR,MAAO,IAAM,aAAa4B,CAAS,CACrC,CACF,EACA,CAAE,UAAW,EAAI,CACnB,EAEA,OAAIrB,EAAW,SAASmB,EAAS,QAAQnB,EAAW,OAAO,EAEpD,IAAM,CACXmB,EAAS,WAAW,EAChBhB,EAAO,SAAS,qBAAqBA,EAAO,OAAO,CACzD,CACF,EAAG,CAACE,EAAUZ,EAAOC,CAAS,CAAC,EAG7BtB,EAAC,QACC,IAAK4B,EACL,UAAWsB,EAAG,mCAAoC/B,CAAS,EAE1D,SAAAO,EAAaR,EAAWM,EAC3B,CAEJ","names":["React","useState","useEffect","useMemo","useRef","jsx","jsxs","SYMBOLS","randomChar","symbols","extractText","node","props","injectScrambledText","scrambledChars","indexObj","text","result","i","child","idx","newProps","TextDecoder","children","className","duration","delay","isLoading","speed","outputNodes","setOutputNodes","isComplete","setIsComplete","elementRef","frameRef","queueRef","rafRef","hasAnimatedRef","fullText","setupQueue","newQueue","to","start","end","loadingCharsRef","updateLoading","currentScrambledChars","char","update","complete","item","wasLoadingRef","observer","entries","timeoutId","cn"]}
|
|
@@ -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 j="!<>-_\\/[]{}\u2014=+*^?#________",C=e=>e[Math.floor(Math.random()*e.length)],S=e=>{if(typeof e=="string"||typeof e=="number")return String(e);if(Array.isArray(e))return e.map(S).join("");if(_react2.default.isValidElement(e)){let s=e.props;return(s.text||"")+(s.label||"")+(s.title||"")+S(s.children)}return""},N=(e,s,i)=>{if(typeof e=="string"||typeof e=="number"){let l=String(e),c=[];for(let m=0;m<l.length;m++)c.push(_jsxruntime.jsx.call(void 0, _react2.default.Fragment,{children:s[i.current]||""},`char-${i.current}`)),i.current++;return c}if(Array.isArray(e))return e.map((l,c)=>_jsxruntime.jsx.call(void 0, _react2.default.Fragment,{children:N(l,s,i)},`arr-${c}-${i.current}`));if(_react2.default.isValidElement(e)){let l=e.props,c={};return l.children&&(c.children=N(l.children,s,i)),_react2.default.cloneElement(e,c)}return e};function L({children:e,className:s,duration:i=40,symbols:l=j,delay:c=0,isLoading:m=!1,speed:T=.28}){let[D,_]=_react.useState.call(void 0, null),[P,y]=_react.useState.call(void 0, !1),A=_react.useRef.call(void 0, null),g=_react.useRef.call(void 0, 0),b=_react.useRef.call(void 0, []),t=_react.useRef.call(void 0, null),F=_react.useRef.call(void 0, !1),f=_react.useMemo.call(void 0, ()=>S(e),[e]),k=()=>{let r=[];for(let u=0;u<f.length;u++){let n=f[u],o=Math.floor(Math.random()*(i*.5)),a=o+Math.floor(Math.random()*(i*.5));r.push({to:n,start:o,end:a})}b.current=r,g.current=0,y(!1)},d=_react.useRef.call(void 0, []),v=()=>{let r=[];d.current.length!==f.length&&(d.current=new Array(f.length).fill(void 0));for(let n=0;n<f.length;n++){let o=f[n];o===" "?r.push(" "):((!d.current[n]||Math.random()<T)&&(d.current[n]=C(l)),r.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:o}),_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none",children:d.current[n]})]},n)))}_(N(e,r,{current:0})),t.current=requestAnimationFrame(v)},x=()=>{let r=0,u=[];for(let o=0;o<b.current.length;o++){let a=b.current[o];g.current>=a.end?(r++,u.push(a.to)):(g.current>=a.start&&(!a.char||Math.random()<T)&&(a.char=C(l)),u.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:a.to===" "?"\xA0":a.to}),g.current>=a.start&&_jsxruntime.jsx.call(void 0, "span",{className:"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none",children:a.char})]},o)))}_(N(e,u,{current:0})),r===b.current.length?y(!0):(g.current++,t.current=requestAnimationFrame(x))},M=_react.useRef.call(void 0, !1);return _react.useEffect.call(void 0, ()=>{if(m)return M.current=!0,F.current=!0,y(!1),t.current&&cancelAnimationFrame(t.current),t.current=requestAnimationFrame(v),()=>{t.current&&cancelAnimationFrame(t.current)};if(M.current)return M.current=!1,k(),t.current=requestAnimationFrame(x),()=>{t.current&&cancelAnimationFrame(t.current)}},[m,f]),_react.useEffect.call(void 0, ()=>{if(m)return;let r=new IntersectionObserver(u=>{if(u[0].isIntersecting&&!F.current){F.current=!0;let n=setTimeout(()=>{k(),t.current=requestAnimationFrame(x)},c);return()=>clearTimeout(n)}},{threshold:.1});return A.current&&r.observe(A.current),()=>{r.disconnect(),t.current&&cancelAnimationFrame(t.current)}},[f,c,m]),_jsxruntime.jsx.call(void 0, "span",{ref:A,className:_chunkFUYXCJOQjs.a.call(void 0, "inline-block whitespace-pre-wrap",s),children:P?e:D})}exports.a = L;
|
|
3
|
+
//# sourceMappingURL=chunk-EWRKHBIV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-EWRKHBIV.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,4ECOhC,+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,CAAe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client\"\nimport { cn } from \"@/lib/utils\"\nimport React, {\n useState,\n useEffect,\n useMemo,\n useRef,\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 isLoading?: boolean\n speed?: number\n}\n\nexport default function TextDecoder ({\n children,\n className,\n duration = 40,\n symbols = SYMBOLS,\n delay = 0,\n isLoading = false,\n speed = 0.28,\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 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 loadingCharsRef = useRef<(string | undefined)[]>([])\n\n const updateLoading = () => {\n const currentScrambledChars: (string | ReactNode)[] = []\n\n if (loadingCharsRef.current.length !== fullText.length) {\n loadingCharsRef.current = new Array(fullText.length).fill(undefined)\n }\n\n for (let i = 0; i < fullText.length; i++) {\n const char = fullText[i]\n\n if (char === \" \") {\n currentScrambledChars.push(\" \")\n } else {\n if (!loadingCharsRef.current[i] || Math.random() < speed) {\n loadingCharsRef.current[i] = randomChar(symbols)\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {char}\n </span>\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono leading-none\">\n {loadingCharsRef.current[i]}\n </span>\n </span>\n )\n }\n }\n\n const indexObj = { current: 0 }\n setOutputNodes(\n injectScrambledText(children, currentScrambledChars, indexObj)\n )\n\n rafRef.current = requestAnimationFrame(updateLoading)\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 complete++\n currentScrambledChars.push(item.to)\n } else {\n if (frameRef.current >= item.start) {\n if (!item.char || Math.random() < speed) {\n item.char = randomChar(symbols)\n }\n }\n\n currentScrambledChars.push(\n <span key={i} className=\"relative inline-block\">\n <span className=\"invisible select-none\" aria-hidden=\"true\">\n {item.to === \" \" ? \"\\u00A0\" : item.to}\n </span>\n {frameRef.current >= item.start && (\n <span className=\"absolute inset-0 flex items-center justify-center opacity-50 font-mono 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 const wasLoadingRef = useRef(false)\n\n useEffect(() => {\n if (isLoading) {\n wasLoadingRef.current = true\n hasAnimatedRef.current = true\n setIsComplete(false)\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n rafRef.current = requestAnimationFrame(updateLoading)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n\n if (wasLoadingRef.current) {\n wasLoadingRef.current = false\n setupQueue()\n rafRef.current = requestAnimationFrame(update)\n return () => {\n if (rafRef.current) cancelAnimationFrame(rafRef.current)\n }\n }\n }, [isLoading, fullText])\n\n useEffect(() => {\n if (isLoading) return\n\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, isLoading])\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"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
|
|
2
|
-
var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var a = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var r=a.forwardRef(({className:l,...t},o)=>_jsxruntime.jsx.call(void 0, "label",{ref:o,className:_chunkFUYXCJOQjs.a.call(void 0, "text-sm
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var a = _interopRequireWildcard(_react);var _jsxruntime = require('react/jsx-runtime');var r=a.forwardRef(({className:l,...t},o)=>_jsxruntime.jsx.call(void 0, "label",{ref:o,className:_chunkFUYXCJOQjs.a.call(void 0, "text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",l),...t}));r.displayName="Label";exports.a = r;
|
|
3
|
+
//# sourceMappingURL=chunk-I5INE4KG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-I5INE4KG.js","../src/components/label.tsx"],"names":["Label","className","props","ref","jsx","cn"],"mappings":"AAAA,uWAAY;AACZ,sDAAuC,uECChB,+CAOnB,IAFEA,CAAAA,CAAc,CAAA,CAAA,UAAA,CAClB,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EACxBC,6BAAAA,OAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWE,gCAAAA,yFACT,CACAJ,CACF,CAAA,CACC,GAAGC,CAAAA,CACN,CAEJ,CAAA,CACAF,CAAAA,CAAM,WAAA,CAAc,OAAA,CAAA,cAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-I5INE4KG.js","sourcesContent":[null,"\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n )\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
var _chunkULIOO55Ijs = require('./chunk-ULIOO55I.js');var _chunkGVSERRZXjs = require('./chunk-GVSERRZX.js');var _chunkFUYXCJOQjs = require('./chunk-FUYXCJOQ.js');var _react = require('react'); var d = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');function U({options:c=[],groups:s,value:i,onValueChange:M,placeholder:u="Select option...",searchPlaceholder:D="Search...",emptyMessage:E="No option found.",disabled:I=!1,className:T,error:L=!1,multiple:l=!1,values:r=[],onValuesChange:f}){let[g,v]=d.useState(!1),x=d.useMemo(()=>s?s.flatMap(e=>e.options):c,[s,c]),C=x.find(e=>e.value===i),a=x.filter(e=>r.includes(e.value)),X=e=>{if(l){let n=r.includes(e)?r.filter(m=>m!==e):[...r,e];_optionalChain([f, 'optionalCall', _ => _(n)])}else _optionalChain([M, 'optionalCall', _2 => _2(e===i?"":e)]),v(!1)},$=(e,n)=>{n.preventDefault(),n.stopPropagation();let m=r.filter(q=>q!==e);_optionalChain([f, 'optionalCall', _3 => _3(m)])},j=()=>l?a.length===0?u:a.length===1?a[0].label:`${a.length} selected`:C?C.label:u,h=e=>{let n=l?r.includes(e.value):i===e.value;return _jsxruntime.jsxs.call(void 0, _chunkGVSERRZXjs.h,{value:e.value,onSelect:X,className:"rounded-[12px]",children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:e.label}),_jsxruntime.jsx.call(void 0, _lucidereact.Check,{className:_chunkFUYXCJOQjs.a.call(void 0, "ml-auto h-4 w-4 shrink-0",n?"opacity-100":"opacity-0")})]},e.value)},y=()=>!l||a.length===0?null:_jsxruntime.jsx.call(void 0, "div",{className:"px-2 py-1.5",children:_jsxruntime.jsx.call(void 0, "div",{className:"flex flex-wrap gap-1",children:a.map(e=>_jsxruntime.jsxs.call(void 0, "div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:e.label}),_jsxruntime.jsx.call(void 0, _lucidereact.X,{className:"h-3 w-3 cursor-pointer",onClick:n=>$(e.value,n)})]},e.value))})});return _jsxruntime.jsxs.call(void 0, _chunkULIOO55Ijs.a,{open:g,onOpenChange:v,children:[_jsxruntime.jsx.call(void 0, _chunkULIOO55Ijs.b,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, "button",{type:"button",role:"combobox","aria-expanded":g,disabled:I,className:_chunkFUYXCJOQjs.a.call(void 0, "cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!i&&!r.length&&"text-secondary-text",L&&"border-destructive-foreground focus-visible:ring-destructive-foreground",T),children:[_jsxruntime.jsx.call(void 0, "span",{className:"truncate",children:j()}),_jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),_jsxruntime.jsx.call(void 0, _chunkULIOO55Ijs.c,{className:"overflow-hidden rounded-xl p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:_jsxruntime.jsxs.call(void 0, _chunkGVSERRZXjs.a,{children:[_jsxruntime.jsx.call(void 0, _chunkGVSERRZXjs.c,{placeholder:D}),_jsxruntime.jsxs.call(void 0, _chunkGVSERRZXjs.d,{children:[_jsxruntime.jsx.call(void 0, _chunkGVSERRZXjs.e,{children:E}),s?_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[y(),s.map(e=>_jsxruntime.jsx.call(void 0, _chunkGVSERRZXjs.f,{heading:e.label,children:e.options.map(h)},e.label))]}):_jsxruntime.jsxs.call(void 0, _chunkGVSERRZXjs.f,{children:[y(),c.map(h)]})]})]})})]})}exports.a = U;
|
|
3
|
+
//# sourceMappingURL=chunk-MSYJFTUX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-MSYJFTUX.js","../src/components/combobox.tsx"],"names":["Combobox","options","groups","value","onValueChange","placeholder","searchPlaceholder","emptyMessage","disabled","className","error","multiple","values","onValuesChange","open","setOpen","allOptions","g","selectedOption","option","selectedOptions","handleSelect","currentValue","newValues","v","handleRemoveValue","valueToRemove","e","getDisplayText"],"mappings":"AAAA,22BAAY;AACZ,sDAAqD,sDAA2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AAAA,EAAMA,CAAAA,GAAMF,CAAY,CAAA,CACvC,CAAC,GAAGV,CAAAA,CAAQU,CAAY,CAAA,iBAC5BT,CAAAA,wBAAAA,CAAiBU,CAAS,GAC5B,CAAA,qBACEnB,CAAAA,0BAAAA,CAAgBkB,CAAAA,GAAiBnB,CAAAA,CAAQ,EAAA,CAAKmB,CAAY,GAAA,CAC1DP,CAAAA,CAAQ,CAAA,CAAK,CAEjB,CAAA,CAEMU,CAAAA,CAAoB,CAACC,CAAAA,CAAuBC,CAAAA,CAAAA,EAAwB,CACxEA,CAAAA,CAAE,cAAA,CAAe,CAAA,CACjBA,CAAAA,CAAE,eAAA,CAAgB,CAAA,CAClB,IAAMJ,CAAAA,CAAYX,CAAAA,CAAO,MAAA,CAAQY,CAAAA,EAAMA,CAAAA,GAAME,CAAa,CAAA,iBAC1Db,CAAAA,0BAAAA,CAAiBU,CAAS,GAC5B,CAAA,CAEMK,CAAAA,CAAiB,CAAA,CAAA,EACjBjB,CAAAA,CACES,CAAAA,CAAgB,MAAA,GAAW,CAAA,CAAUf,CAAAA,CACrCe,CAAAA,CAAgB,MAAA,GAAW,CAAA,CAAUA,CAAAA,CAAgB,CAAC,CAAA,CAAE,KAAA,CACrD,CAAA,EAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-MSYJFTUX.js","sourcesContent":[null,"import * as React from \"react\"\nimport { Check, ChevronDown, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/components/command\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\nexport interface ComboboxOption {\n value: string\n label: string\n}\n\nexport interface ComboboxGroup {\n label: string\n options: ComboboxOption[]\n}\n\nexport interface ComboboxProps {\n options?: ComboboxOption[]\n groups?: ComboboxGroup[]\n value?: string\n onValueChange?: (value: string) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n}\n\nexport function Combobox({\n options = [],\n groups,\n value,\n onValueChange,\n placeholder = \"Select option...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No option found.\",\n disabled = false,\n className,\n error = false,\n multiple = false,\n values = [],\n onValuesChange,\n}: ComboboxProps) {\n const [open, setOpen] = React.useState(false)\n\n const allOptions = React.useMemo(() => {\n if (groups) return groups.flatMap((g) => g.options)\n return options\n }, [groups, options])\n\n const selectedOption = allOptions.find((option) => option.value === value)\n const selectedOptions = allOptions.filter((option) =>\n values.includes(option.value)\n )\n\n const handleSelect = (currentValue: string) => {\n if (multiple) {\n const newValues = values.includes(currentValue)\n ? values.filter((v) => v !== currentValue)\n : [...values, currentValue]\n onValuesChange?.(newValues)\n } else {\n onValueChange?.(currentValue === value ? \"\" : currentValue)\n setOpen(false)\n }\n }\n\n const handleRemoveValue = (valueToRemove: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const newValues = values.filter((v) => v !== valueToRemove)\n onValuesChange?.(newValues)\n }\n\n const getDisplayText = () => {\n if (multiple) {\n if (selectedOptions.length === 0) return placeholder\n if (selectedOptions.length === 1) return selectedOptions[0].label\n return `${selectedOptions.length} selected`\n }\n return selectedOption ? selectedOption.label : placeholder\n }\n\n const renderOption = (option: ComboboxOption) => {\n const isSelected = multiple\n ? values.includes(option.value)\n : value === option.value\n\n return (\n <CommandItem\n key={option.value}\n value={option.value}\n onSelect={handleSelect}\n className=\"rounded-[12px]\"\n >\n <span className=\"truncate\">{option.label}</span>\n <Check\n className={cn(\n \"ml-auto h-4 w-4 shrink-0\",\n isSelected ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n </CommandItem>\n )\n }\n\n const renderSelectedChips = () => {\n if (!multiple || selectedOptions.length === 0) return null\n\n return (\n <div className=\"px-2 py-1.5\">\n <div className=\"flex flex-wrap gap-1\">\n {selectedOptions.map((option) => (\n <div\n key={option.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate\">{option.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer\"\n onClick={(e) => handleRemoveValue(option.value, e)}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"overflow-hidden rounded-xl p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <Command>\n <CommandInput placeholder={searchPlaceholder} />\n <CommandList>\n <CommandEmpty>{emptyMessage}</CommandEmpty>\n {groups ? (\n <>\n {renderSelectedChips()}\n {groups.map((group) => (\n <CommandGroup key={group.label} heading={group.label}>\n {group.options.map(renderOption)}\n </CommandGroup>\n ))}\n </>\n ) : (\n <CommandGroup>\n {renderSelectedChips()}\n {options.map(renderOption)}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
var _chunkXYO4VLMFjs = require('./chunk-XYO4VLMF.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var m=
|
|
3
|
-
//# sourceMappingURL=chunk-
|
|
2
|
+
var _chunkXYO4VLMFjs = require('./chunk-XYO4VLMF.js');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var m=17,B=1,P=5,q=(x,a)=>{if(x<a){let s=1-x/a;return s*s*(3-2*s)}return 0},v=class{constructor(a){_chunkXYO4VLMFjs.a.call(void 0, this,"x",0);_chunkXYO4VLMFjs.a.call(void 0, this,"y",0);_chunkXYO4VLMFjs.a.call(void 0, this,"anchorX",0);_chunkXYO4VLMFjs.a.call(void 0, this,"anchorY",0);_chunkXYO4VLMFjs.a.call(void 0, this,"vx",0);_chunkXYO4VLMFjs.a.call(void 0, this,"vy",0);_chunkXYO4VLMFjs.a.call(void 0, this,"nodes",[]);_chunkXYO4VLMFjs.a.call(void 0, this,"opacity",0);_chunkXYO4VLMFjs.a.call(void 0, this,"glitchZones",[]);_chunkXYO4VLMFjs.a.call(void 0, this,"maxReach",180);this.anchorX=a.x,this.anchorY=a.y,this.x=this.anchorX,this.y=this.anchorY,this.init()}init(){this.nodes=[];let a=3+Math.floor(Math.random()*3);for(let s=0;s<a;s++){let e=15+Math.random()*25,b=(Math.random()-.5)*60,u=(Math.random()-.5)*60;this.nodes.push({offsetX:b,offsetY:u,vx:(Math.random()-.5)*.1,vy:(Math.random()-.5)*.1,radius:e,t:Math.random()*100})}this.opacity=1}update(){let a=this.anchorX-this.x,s=this.anchorY-this.y,e=5e-4,b=a*e,u=s*e,g=(Math.random()-.5)*.01,r=(Math.random()-.5)*.01;if(this.vx+=b+g,this.vy+=u+r,this.vx*=.96,this.vy*=.96,this.x+=this.vx,this.y+=this.vy,this.nodes.forEach(n=>{n.t+=.005,n.offsetX+=Math.sin(n.t)*.1+n.vx,n.offsetY+=Math.cos(n.t*.9)*.1+n.vy;let d=70;(n.offsetX>d||n.offsetX<-d)&&(n.vx*=-1),(n.offsetY>d||n.offsetY<-d)&&(n.vy*=-1),n.radius+=Math.sin(n.t*2)*.1}),this.glitchZones=this.glitchZones.filter(n=>n.life>0),this.glitchZones.forEach(n=>n.life--),Math.random()<.03){let d=f=>Math.round((f-m/2)/m)*m+m/2,R=this.x+(Math.random()-.5)*80,X=this.y+(Math.random()-.5)*80,p=d(R),i=d(X);if((Math.random()>.6?"line":"dot")==="line"){let f=Math.random()>.5,y=40+Math.random()*80,t=2;this.glitchZones.push({x:f?p-t/2:p-y/2,y:f?i-y/2:i-t/2,w:f?t:y,h:f?y:t,life:8+Math.random()*12})}else this.glitchZones.push({x:p-4/2,y:i-4/2,w:4,h:4,life:6+Math.random()*10})}}},F=class{constructor(a,s){_chunkXYO4VLMFjs.a.call(void 0, this,"x");_chunkXYO4VLMFjs.a.call(void 0, this,"y");_chunkXYO4VLMFjs.a.call(void 0, this,"opacity");_chunkXYO4VLMFjs.a.call(void 0, this,"decay");_chunkXYO4VLMFjs.a.call(void 0, this,"nodes");_chunkXYO4VLMFjs.a.call(void 0, this,"maxReach",60);this.x=a,this.y=s,this.opacity=.8,this.decay=.03,this.nodes=[];let e=2;for(let b=0;b<e;b++)this.nodes.push({offsetX:(Math.random()-.5)*10,offsetY:(Math.random()-.5)*10,vx:(Math.random()-.5)*1,vy:(Math.random()-.5)*1,radius:5+Math.random()*10,t:0})}update(){this.opacity-=this.decay,this.nodes.forEach(a=>{a.offsetX+=a.vx,a.offsetY+=a.vy,a.radius*=.95})}},_=({variant:x="animated"})=>{let a=_react.useRef.call(void 0, null);return _react.useEffect.call(void 0, ()=>{let s=a.current;if(!s)return;let e=s.getContext("2d");if(!e)return;let b,u=[],g=[],r={x:-1e3,y:-1e3,lastX:-1e3,lastY:-1e3},n=()=>{u=[];let i=s.width,h=s.height;u.push(new v({x:i-i*.15,y:h*.15})),u.push(new v({x:i*.4,y:h*.4})),u.push(new v({x:i*.05+50,y:h-h*.15})),u.push(new v({x:i-i*.05-50,y:h-h*.05-50}))},d=()=>{let i=s.getBoundingClientRect();s.width=i.width,s.height=i.height,n()},R=i=>{let h=s.getBoundingClientRect();r.x=i.clientX-h.left,r.y=i.clientY-h.top,r.lastX===-1e3&&(r.lastX=r.x,r.lastY=r.y);let f=r.x-r.lastX,y=r.y-r.lastY;Math.sqrt(f*f+y*y)>20&&(g.push(new F(r.x,r.y)),r.lastX=r.x,r.lastY=r.y)},X=()=>{d()},p=()=>{let i=s.width,h=s.height;if(e.fillStyle="#050505",e.fillRect(0,0,i,h),x==="static"){for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m)e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1);return}u.forEach(t=>t.update());for(let t=g.length-1;t>=0;t--)g[t].update(),g[t].opacity<=0&&g.splice(t,1);let f=[...u,...g],y=[];u.forEach(t=>y.push(...t.glitchZones));for(let t=m/2;t<i;t+=m)for(let l=m/2;l<h;l+=m){let C=!1;for(let o of y)if(t>=o.x&&t<=o.x+o.w&&l>=o.y&&l<=o.y+o.h){C=!0;break}if(C){if(e.fillStyle="rgba(182, 243, 191, 0.95)",Math.random()>.1){let o=Math.random()>.5?P*.7:B*2;e.beginPath(),e.arc(t,l,o/2,0,Math.PI*2),e.fill()}continue}let M=0,I=!1;for(let o of f)if(Math.abs(t-o.x)<o.maxReach&&Math.abs(l-o.y)<o.maxReach){I=!0;break}if(!I){e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1);continue}for(let o of f){let E=t-o.x,z=l-o.y;if(Math.abs(E)>o.maxReach||Math.abs(z)>o.maxReach)continue;let w=0;for(let Y of o.nodes){let Z=E-Y.offsetX,G=z-Y.offsetY,S=Math.sqrt(Z*Z+G*G);w+=q(S,Y.radius)}w>1&&(w=1),M+=w*o.opacity}if(M>1&&(M=1),M>.01){let G=Math.floor(255+-73*M),S=Math.floor(255+-12*M),L=Math.floor(255+-64*M),A=M*.5,k=B+M*(P-B);e.fillStyle=`rgba(${G}, ${S}, ${L}, ${A})`,e.beginPath(),e.arc(t,l,k/2,0,Math.PI*2),e.fill()}else e.fillStyle="rgba(47, 47, 47, 1)",e.fillRect(t-.5,l-.5,1,1)}b=requestAnimationFrame(p)};return window.addEventListener("resize",X),x==="animated"&&window.addEventListener("mousemove",R),d(),p(),()=>{window.removeEventListener("resize",X),x==="animated"&&window.removeEventListener("mousemove",R),cancelAnimationFrame(b)}},[x]),_jsxruntime.jsx.call(void 0, "canvas",{ref:a,className:"fixed inset-0 -z-999 w-full h-full pointer-events-none"})},V= exports.a =_;exports.a = V;
|
|
3
|
+
//# sourceMappingURL=chunk-RKONP3N6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RLO6XENU.js","../src/components/GeometricFluidGrid.tsx"],"names":["GAP","BASE_SIZE","MAX_SIZE","getFalloff","dist","radius","val","AnchoredBlob","anchorConfig","__publicField","nodeCount","i","r","ox","oy","dx","dy","k","ax","ay","wx","wy","node","maxDist","g","snap","v","rawCx","rawCy","cx","cy","isVert","len","thickness","TrailBlob","x","y","count","GeometricFluidGrid","variant","canvasRef","useRef","useEffect","canvas","ctx","animationFrameId","orbs","trail","mouse","initWorld","w","resize","rect","handleMouseMove","e","handleResize","draw","orb","renderList","allGlitches","o","isGlitching","size","totalInfluence","nearby","entity","localInf","nx","ny","b","alpha","jsx","GeometricFluidGrid_default"],"mappings":"AAAA,qFAAY;AACZ,sDAAuC,8BCAE,+CA+drC,IA5dEA,CAAAA,CAAM,EAAA,CACNC,CAAAA,CAAY,CAAA,CACZC,CAAAA,CAAW,CAAA,CA4BXC,CAAAA,CAAa,CAACC,CAAAA,CAAcC,CAAAA,CAAAA,EAA2B,CAC3D,EAAA,CAAID,CAAAA,CAAOC,CAAAA,CAAQ,CACjB,IAAMC,CAAAA,CAAM,CAAA,CAAIF,CAAAA,CAAOC,CAAAA,CACvB,OAAOC,CAAAA,CAAMA,CAAAA,CAAAA,CAAO,CAAA,CAAI,CAAA,CAAIA,CAAAA,CA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/alkimi-ui-kit/dist/chunk-RLO6XENU.js","sourcesContent":[null,"\"use client\"\nimport React, { useEffect, useRef } from \"react\"\n\n// --- CONFIGURATION ---\nconst GAP = 14\nconst BASE_SIZE = 1\nconst MAX_SIZE = 5\n\n// --- TYPES ---\ninterface Node {\n offsetX: number\n offsetY: number\n vx: number\n vy: number\n radius: number\n t: number\n}\n\ninterface GlitchZone {\n x: number\n y: number\n w: number\n h: number\n life: number\n}\n\ninterface MouseState {\n x: number\n y: number\n lastX: number\n lastY: number\n}\n\n// --- MATH HELPERS ---\nconst getFalloff = (dist: number, radius: number): number => {\n if (dist < radius) {\n const val = 1 - dist / radius\n return val * val * (3 - 2 * val)\n }\n return 0\n}\n\n// --- CLASSES ---\nclass AnchoredBlob {\n // Current Position\n x: number = 0\n y: number = 0\n\n // Anchor Position (Home base)\n anchorX: number = 0\n anchorY: number = 0\n\n // Movement\n vx: number = 0\n vy: number = 0\n\n // Appearance\n nodes: Node[] = []\n opacity: number = 0\n\n // Glitch State\n glitchZones: GlitchZone[] = []\n maxReach: number = 180\n\n constructor(anchorConfig: { x: number; y: number }) {\n this.anchorX = anchorConfig.x\n this.anchorY = anchorConfig.y\n this.x = this.anchorX\n this.y = this.anchorY\n this.init()\n }\n\n init() {\n // 1. Create Internal Nodes (The \"Blob\" composition)\n this.nodes = []\n const nodeCount = 3 + Math.floor(Math.random() * 3) // 3 to 5 nodes\n\n for (let i = 0; i < nodeCount; i++) {\n // Significantly smaller radius (15-40px) to reduce central bulk\n const r = 15 + Math.random() * 25\n // Wider initial spread\n const ox = (Math.random() - 0.5) * 60\n const oy = (Math.random() - 0.5) * 60\n\n this.nodes.push({\n offsetX: ox,\n offsetY: oy,\n vx: (Math.random() - 0.5) * 0.1, // Slower internal movement (was 0.4)\n vy: (Math.random() - 0.5) * 0.1,\n radius: r,\n t: Math.random() * 100,\n })\n }\n\n this.opacity = 1\n }\n\n update() {\n // --- 1. Tethered Movement Logic ---\n const dx = this.anchorX - this.x\n const dy = this.anchorY - this.y\n\n // Spring constant (very loose)\n const k = 0.0005\n const ax = dx * k\n const ay = dy * k\n\n // Random wandering force - Reduced significantly for slower drift\n const wx = (Math.random() - 0.5) * 0.01 // was 0.05\n const wy = (Math.random() - 0.5) * 0.01 // was 0.05\n\n this.vx += ax + wx\n this.vy += ay + wy\n\n this.vx *= 0.96\n this.vy *= 0.96\n\n this.x += this.vx\n this.y += this.vy\n\n // --- 2. Internal Node Animation ---\n this.nodes.forEach((node) => {\n // Slow down time step\n node.t += 0.005 // was 0.02\n\n // Slower oscillation and movement\n node.offsetX += Math.sin(node.t) * 0.1 + node.vx // amp was 0.4\n node.offsetY += Math.cos(node.t * 0.9) * 0.1 + node.vy\n\n // Constrain to \"nucleus\"\n const maxDist = 70\n if (node.offsetX > maxDist || node.offsetX < -maxDist) node.vx *= -1\n if (node.offsetY > maxDist || node.offsetY < -maxDist) node.vy *= -1\n\n // Pulse size\n node.radius += Math.sin(node.t * 2) * 0.1\n })\n\n // --- 3. Manage Glitch Zones ---\n // Remove dead glitches\n this.glitchZones = this.glitchZones.filter((g) => g.life > 0)\n this.glitchZones.forEach((g) => g.life--)\n\n // Randomly spawn new glitches\n if (Math.random() < 0.03) {\n // 3% chance per frame\n const spread = 80\n\n // Snap random positions to exact grid points to ensure clean lines\n const snap = (v: number) =>\n Math.round((v - GAP / 2) / GAP) * GAP + GAP / 2\n\n const rawCx = this.x + (Math.random() - 0.5) * spread\n const rawCy = this.y + (Math.random() - 0.5) * spread\n\n const cx = snap(rawCx)\n const cy = snap(rawCy)\n\n const type = Math.random() > 0.6 ? \"line\" : \"dot\"\n\n if (type === \"line\") {\n const isVert = Math.random() > 0.5\n // Medium length: 40-120px\n const len = 40 + Math.random() * 80\n\n // Thickness is essentially zero (just a sliver) centered on the grid line\n // to guarantee we only pick up exactly one row/column of dots\n const thickness = 2\n\n this.glitchZones.push({\n x: isVert ? cx - thickness / 2 : cx - len / 2,\n y: isVert ? cy - len / 2 : cy - thickness / 2,\n w: isVert ? thickness : len,\n h: isVert ? len : thickness,\n life: 8 + Math.random() * 12,\n })\n } else {\n // Single dot\n // Box just large enough to catch one grid point\n const size = 4\n\n this.glitchZones.push({\n x: cx - size / 2,\n y: cy - size / 2,\n w: size,\n h: size,\n life: 6 + Math.random() * 10,\n })\n }\n }\n }\n}\n\nclass TrailBlob {\n x: number\n y: number\n opacity: number\n decay: number\n nodes: Node[]\n maxReach: number = 60\n\n constructor(x: number, y: number) {\n this.x = x\n this.y = y\n this.opacity = 0.8\n this.decay = 0.03\n\n this.nodes = []\n const count = 2\n for (let i = 0; i < count; i++) {\n this.nodes.push({\n offsetX: (Math.random() - 0.5) * 10,\n offsetY: (Math.random() - 0.5) * 10,\n vx: (Math.random() - 0.5) * 1,\n vy: (Math.random() - 0.5) * 1,\n radius: 5 + Math.random() * 10,\n t: 0,\n })\n }\n }\n\n update() {\n this.opacity -= this.decay\n this.nodes.forEach((node) => {\n node.offsetX += node.vx\n node.offsetY += node.vy\n node.radius *= 0.95\n })\n }\n}\n\ninterface GeometricFluidGridProps {\n variant?: \"animated\" | \"static\"\n}\n\nconst GeometricFluidGrid: React.FC<GeometricFluidGridProps> = ({\n variant = \"animated\",\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n\n useEffect(() => {\n const canvas = canvasRef.current\n if (!canvas) return\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n let animationFrameId: number\n let orbs: AnchoredBlob[] = []\n let trail: TrailBlob[] = []\n let mouse: MouseState = { x: -1000, y: -1000, lastX: -1000, lastY: -1000 }\n\n const initWorld = () => {\n orbs = []\n const w = canvas.width\n const h = canvas.height\n\n // 1. Top Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.15,\n y: h * 0.15,\n })\n )\n\n // 2. ~40% from top and ~40% from left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.4,\n y: h * 0.4,\n })\n )\n\n // 3. Bottom Left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.05 + 50,\n y: h - h * 0.15,\n })\n )\n\n // 4. Bottom Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.05 - 50,\n y: h - h * 0.05 - 50,\n })\n )\n }\n\n const resize = () => {\n const rect = canvas.getBoundingClientRect()\n canvas.width = rect.width\n canvas.height = rect.height\n initWorld()\n }\n\n const handleMouseMove = (e: MouseEvent) => {\n const rect = canvas.getBoundingClientRect()\n mouse.x = e.clientX - rect.left\n mouse.y = e.clientY - rect.top\n\n if (mouse.lastX === -1000) {\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n\n const dx = mouse.x - mouse.lastX\n const dy = mouse.y - mouse.lastY\n const dist = Math.sqrt(dx * dx + dy * dy)\n\n if (dist > 20) {\n trail.push(new TrailBlob(mouse.x, mouse.y))\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n }\n\n const handleResize = () => {\n resize()\n }\n\n const draw = () => {\n const w = canvas.width\n const h = canvas.height\n\n // Clear Screen\n ctx.fillStyle = \"#050505\"\n ctx.fillRect(0, 0, w, h)\n\n // Static variant: just render uniform dots\n if (variant === \"static\") {\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n ctx.fillStyle = \"rgba(255, 255, 255, 0.03)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n return // No animation loop for static variant\n }\n\n // Animated variant: update and render with animations\n // Update Logic\n orbs.forEach((orb) => orb.update())\n for (let i = trail.length - 1; i >= 0; i--) {\n trail[i].update()\n if (trail[i].opacity <= 0) trail.splice(i, 1)\n }\n\n const renderList = [...orbs, ...trail]\n\n // Collect all glitch zones for easier checking inside the loop\n // We flat map them to a simple array to iterate quickly\n const allGlitches: GlitchZone[] = []\n orbs.forEach((o) => allGlitches.push(...o.glitchZones))\n\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n // --- GLITCH CHECK ---\n // Check if this specific grid dot is inside a glitch zone\n let isGlitching = false\n for (const g of allGlitches) {\n // Simple AABB check\n if (x >= g.x && x <= g.x + g.w && y >= g.y && y <= g.y + g.h) {\n isGlitching = true\n break\n }\n }\n\n if (isGlitching) {\n // Glitched Dot: Bright\n // We use the grid itself to manifest the glitch\n ctx.fillStyle = \"rgba(182, 243, 191, 0.95)\"\n\n // Randomly skip some dots in the glitch line for a \"broken\" look\n if (Math.random() > 0.1) {\n const size = Math.random() > 0.5 ? MAX_SIZE * 0.7 : BASE_SIZE * 2\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n }\n continue // Skip standard influence calculation for this dot\n }\n\n // --- STANDARD INFLUENCE CHECK ---\n let totalInfluence = 0\n\n // Optimization: Is near blob?\n let nearby = false\n for (const entity of renderList) {\n if (\n Math.abs(x - entity.x) < entity.maxReach &&\n Math.abs(y - entity.y) < entity.maxReach\n ) {\n nearby = true\n break\n }\n }\n\n if (!nearby) {\n // Passive Background Dot\n ctx.fillStyle = \"rgba(255, 255, 255, 0.03)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n continue\n }\n\n // Calculate Influence\n for (const entity of renderList) {\n const dx = x - entity.x\n const dy = y - entity.y\n\n if (\n Math.abs(dx) > entity.maxReach ||\n Math.abs(dy) > entity.maxReach\n )\n continue\n\n let localInf = 0\n for (const node of entity.nodes) {\n const nx = dx - node.offsetX\n const ny = dy - node.offsetY\n const dist = Math.sqrt(nx * nx + ny * ny)\n localInf += getFalloff(dist, node.radius)\n }\n if (localInf > 1) localInf = 1\n totalInfluence += localInf * entity.opacity\n }\n\n if (totalInfluence > 1) totalInfluence = 1\n\n // Draw Cell\n if (totalInfluence > 0.01) {\n // Gradient: White (Edge) to Green (#B6F3BF - Center)\n const edgeR = 255,\n centerR = 182\n const edgeG = 255,\n centerG = 243\n const edgeB = 255,\n centerB = 191\n\n // Interpolate from White (0 influence) to Green (1 influence)\n const r = Math.floor(edgeR + (centerR - edgeR) * totalInfluence)\n const g = Math.floor(edgeG + (centerG - edgeG) * totalInfluence)\n const b = Math.floor(edgeB + (centerB - edgeB) * totalInfluence)\n\n const alpha = totalInfluence * 0.5\n const size = BASE_SIZE + totalInfluence * (MAX_SIZE - BASE_SIZE)\n\n ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${alpha})`\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n } else {\n ctx.fillStyle = \"rgba(255, 255, 255, 0.03)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n }\n\n animationFrameId = requestAnimationFrame(draw)\n }\n\n window.addEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.addEventListener(\"mousemove\", handleMouseMove)\n }\n\n resize()\n draw()\n\n return () => {\n window.removeEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.removeEventListener(\"mousemove\", handleMouseMove)\n }\n cancelAnimationFrame(animationFrameId)\n }\n }, [variant])\n\n return (\n <canvas\n ref={canvasRef}\n className=\"fixed inset-0 -z-999 w-full h-full pointer-events-none\"\n />\n )\n}\n\nexport default GeometricFluidGrid\n"]}
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RKONP3N6.js","../src/components/GeometricFluidGrid.tsx"],"names":["GAP","BASE_SIZE","MAX_SIZE","getFalloff","dist","radius","val","AnchoredBlob","anchorConfig","__publicField","nodeCount","i","r","ox","oy","dx","dy","k","ax","ay","wx","wy","node","maxDist","g","snap","v","rawCx","rawCy","cx","cy","isVert","len","thickness","TrailBlob","x","y","count","GeometricFluidGrid","variant","canvasRef","useRef","useEffect","canvas","ctx","animationFrameId","orbs","trail","mouse","initWorld","w","resize","rect","handleMouseMove","e","handleResize","draw","orb","renderList","allGlitches","o","isGlitching","size","totalInfluence","nearby","entity","localInf","nx","ny","b","alpha","jsx","GeometricFluidGrid_default"],"mappings":"AAAA,qFAAY;AACZ,sDAAuC,8BCAE,+CA+drC,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AA,CAC7ChB,CAAAA,GAAY,UAAA,EACd,MAAA,CAAO,mBAAA,CAAoB,WAAA,CAAac,CAAe,CAAA,CAEzD,oBAAA,CAAqBR,CAAgB,CACvC,CACF,CAAA,CAAG,CAACN,CAAO,CAAC,CAAA,CAGVgC,6BAAAA,QAAC,CAAA,CACC,GAAA,CAAK/B,CAAAA,CACL,SAAA,CAAU,wDAAA,CACZ,CAEJ,CAAA,CAEOgC,CAAAA,aAAQlC,CAAAA,CAAAA,cAAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/chunk-RKONP3N6.js","sourcesContent":[null,"\"use client\"\nimport React, { useEffect, useRef } from \"react\"\n\n// --- CONFIGURATION ---\nconst GAP = 17\nconst BASE_SIZE = 1\nconst MAX_SIZE = 5\n\n// --- TYPES ---\ninterface Node {\n offsetX: number\n offsetY: number\n vx: number\n vy: number\n radius: number\n t: number\n}\n\ninterface GlitchZone {\n x: number\n y: number\n w: number\n h: number\n life: number\n}\n\ninterface MouseState {\n x: number\n y: number\n lastX: number\n lastY: number\n}\n\n// --- MATH HELPERS ---\nconst getFalloff = (dist: number, radius: number): number => {\n if (dist < radius) {\n const val = 1 - dist / radius\n return val * val * (3 - 2 * val)\n }\n return 0\n}\n\n// --- CLASSES ---\nclass AnchoredBlob {\n // Current Position\n x: number = 0\n y: number = 0\n\n // Anchor Position (Home base)\n anchorX: number = 0\n anchorY: number = 0\n\n // Movement\n vx: number = 0\n vy: number = 0\n\n // Appearance\n nodes: Node[] = []\n opacity: number = 0\n\n // Glitch State\n glitchZones: GlitchZone[] = []\n maxReach: number = 180\n\n constructor(anchorConfig: { x: number; y: number }) {\n this.anchorX = anchorConfig.x\n this.anchorY = anchorConfig.y\n this.x = this.anchorX\n this.y = this.anchorY\n this.init()\n }\n\n init() {\n // 1. Create Internal Nodes (The \"Blob\" composition)\n this.nodes = []\n const nodeCount = 3 + Math.floor(Math.random() * 3) // 3 to 5 nodes\n\n for (let i = 0; i < nodeCount; i++) {\n // Significantly smaller radius (15-40px) to reduce central bulk\n const r = 15 + Math.random() * 25\n // Wider initial spread\n const ox = (Math.random() - 0.5) * 60\n const oy = (Math.random() - 0.5) * 60\n\n this.nodes.push({\n offsetX: ox,\n offsetY: oy,\n vx: (Math.random() - 0.5) * 0.1, // Slower internal movement (was 0.4)\n vy: (Math.random() - 0.5) * 0.1,\n radius: r,\n t: Math.random() * 100,\n })\n }\n\n this.opacity = 1\n }\n\n update() {\n // --- 1. Tethered Movement Logic ---\n const dx = this.anchorX - this.x\n const dy = this.anchorY - this.y\n\n // Spring constant (very loose)\n const k = 0.0005\n const ax = dx * k\n const ay = dy * k\n\n // Random wandering force - Reduced significantly for slower drift\n const wx = (Math.random() - 0.5) * 0.01 // was 0.05\n const wy = (Math.random() - 0.5) * 0.01 // was 0.05\n\n this.vx += ax + wx\n this.vy += ay + wy\n\n this.vx *= 0.96\n this.vy *= 0.96\n\n this.x += this.vx\n this.y += this.vy\n\n // --- 2. Internal Node Animation ---\n this.nodes.forEach((node) => {\n // Slow down time step\n node.t += 0.005 // was 0.02\n\n // Slower oscillation and movement\n node.offsetX += Math.sin(node.t) * 0.1 + node.vx // amp was 0.4\n node.offsetY += Math.cos(node.t * 0.9) * 0.1 + node.vy\n\n // Constrain to \"nucleus\"\n const maxDist = 70\n if (node.offsetX > maxDist || node.offsetX < -maxDist) node.vx *= -1\n if (node.offsetY > maxDist || node.offsetY < -maxDist) node.vy *= -1\n\n // Pulse size\n node.radius += Math.sin(node.t * 2) * 0.1\n })\n\n // --- 3. Manage Glitch Zones ---\n // Remove dead glitches\n this.glitchZones = this.glitchZones.filter((g) => g.life > 0)\n this.glitchZones.forEach((g) => g.life--)\n\n // Randomly spawn new glitches\n if (Math.random() < 0.03) {\n // 3% chance per frame\n const spread = 80\n\n // Snap random positions to exact grid points to ensure clean lines\n const snap = (v: number) =>\n Math.round((v - GAP / 2) / GAP) * GAP + GAP / 2\n\n const rawCx = this.x + (Math.random() - 0.5) * spread\n const rawCy = this.y + (Math.random() - 0.5) * spread\n\n const cx = snap(rawCx)\n const cy = snap(rawCy)\n\n const type = Math.random() > 0.6 ? \"line\" : \"dot\"\n\n if (type === \"line\") {\n const isVert = Math.random() > 0.5\n // Medium length: 40-120px\n const len = 40 + Math.random() * 80\n\n // Thickness is essentially zero (just a sliver) centered on the grid line\n // to guarantee we only pick up exactly one row/column of dots\n const thickness = 2\n\n this.glitchZones.push({\n x: isVert ? cx - thickness / 2 : cx - len / 2,\n y: isVert ? cy - len / 2 : cy - thickness / 2,\n w: isVert ? thickness : len,\n h: isVert ? len : thickness,\n life: 8 + Math.random() * 12,\n })\n } else {\n // Single dot\n // Box just large enough to catch one grid point\n const size = 4\n\n this.glitchZones.push({\n x: cx - size / 2,\n y: cy - size / 2,\n w: size,\n h: size,\n life: 6 + Math.random() * 10,\n })\n }\n }\n }\n}\n\nclass TrailBlob {\n x: number\n y: number\n opacity: number\n decay: number\n nodes: Node[]\n maxReach: number = 60\n\n constructor(x: number, y: number) {\n this.x = x\n this.y = y\n this.opacity = 0.8\n this.decay = 0.03\n\n this.nodes = []\n const count = 2\n for (let i = 0; i < count; i++) {\n this.nodes.push({\n offsetX: (Math.random() - 0.5) * 10,\n offsetY: (Math.random() - 0.5) * 10,\n vx: (Math.random() - 0.5) * 1,\n vy: (Math.random() - 0.5) * 1,\n radius: 5 + Math.random() * 10,\n t: 0,\n })\n }\n }\n\n update() {\n this.opacity -= this.decay\n this.nodes.forEach((node) => {\n node.offsetX += node.vx\n node.offsetY += node.vy\n node.radius *= 0.95\n })\n }\n}\n\ninterface GeometricFluidGridProps {\n variant?: \"animated\" | \"static\"\n}\n\nconst GeometricFluidGrid: React.FC<GeometricFluidGridProps> = ({\n variant = \"animated\",\n}) => {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n\n useEffect(() => {\n const canvas = canvasRef.current\n if (!canvas) return\n\n const ctx = canvas.getContext(\"2d\")\n if (!ctx) return\n\n let animationFrameId: number\n let orbs: AnchoredBlob[] = []\n let trail: TrailBlob[] = []\n let mouse: MouseState = { x: -1000, y: -1000, lastX: -1000, lastY: -1000 }\n\n const initWorld = () => {\n orbs = []\n const w = canvas.width\n const h = canvas.height\n\n // 1. Top Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.15,\n y: h * 0.15,\n })\n )\n\n // 2. ~40% from top and ~40% from left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.4,\n y: h * 0.4,\n })\n )\n\n // 3. Bottom Left\n orbs.push(\n new AnchoredBlob({\n x: w * 0.05 + 50,\n y: h - h * 0.15,\n })\n )\n\n // 4. Bottom Right\n orbs.push(\n new AnchoredBlob({\n x: w - w * 0.05 - 50,\n y: h - h * 0.05 - 50,\n })\n )\n }\n\n const resize = () => {\n const rect = canvas.getBoundingClientRect()\n canvas.width = rect.width\n canvas.height = rect.height\n initWorld()\n }\n\n const handleMouseMove = (e: MouseEvent) => {\n const rect = canvas.getBoundingClientRect()\n mouse.x = e.clientX - rect.left\n mouse.y = e.clientY - rect.top\n\n if (mouse.lastX === -1000) {\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n\n const dx = mouse.x - mouse.lastX\n const dy = mouse.y - mouse.lastY\n const dist = Math.sqrt(dx * dx + dy * dy)\n\n if (dist > 20) {\n trail.push(new TrailBlob(mouse.x, mouse.y))\n mouse.lastX = mouse.x\n mouse.lastY = mouse.y\n }\n }\n\n const handleResize = () => {\n resize()\n }\n\n const draw = () => {\n const w = canvas.width\n const h = canvas.height\n\n // Clear Screen\n ctx.fillStyle = \"#050505\"\n ctx.fillRect(0, 0, w, h)\n\n // Static variant: just render uniform dots\n if (variant === \"static\") {\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n return // No animation loop for static variant\n }\n\n // Animated variant: update and render with animations\n // Update Logic\n orbs.forEach((orb) => orb.update())\n for (let i = trail.length - 1; i >= 0; i--) {\n trail[i].update()\n if (trail[i].opacity <= 0) trail.splice(i, 1)\n }\n\n const renderList = [...orbs, ...trail]\n\n // Collect all glitch zones for easier checking inside the loop\n // We flat map them to a simple array to iterate quickly\n const allGlitches: GlitchZone[] = []\n orbs.forEach((o) => allGlitches.push(...o.glitchZones))\n\n for (let x = GAP / 2; x < w; x += GAP) {\n for (let y = GAP / 2; y < h; y += GAP) {\n // --- GLITCH CHECK ---\n // Check if this specific grid dot is inside a glitch zone\n let isGlitching = false\n for (const g of allGlitches) {\n // Simple AABB check\n if (x >= g.x && x <= g.x + g.w && y >= g.y && y <= g.y + g.h) {\n isGlitching = true\n break\n }\n }\n\n if (isGlitching) {\n // Glitched Dot: Bright\n // We use the grid itself to manifest the glitch\n ctx.fillStyle = \"rgba(182, 243, 191, 0.95)\"\n\n // Randomly skip some dots in the glitch line for a \"broken\" look\n if (Math.random() > 0.1) {\n const size = Math.random() > 0.5 ? MAX_SIZE * 0.7 : BASE_SIZE * 2\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n }\n continue // Skip standard influence calculation for this dot\n }\n\n // --- STANDARD INFLUENCE CHECK ---\n let totalInfluence = 0\n\n // Optimization: Is near blob?\n let nearby = false\n for (const entity of renderList) {\n if (\n Math.abs(x - entity.x) < entity.maxReach &&\n Math.abs(y - entity.y) < entity.maxReach\n ) {\n nearby = true\n break\n }\n }\n\n if (!nearby) {\n // Passive Background Dot\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n continue\n }\n\n // Calculate Influence\n for (const entity of renderList) {\n const dx = x - entity.x\n const dy = y - entity.y\n\n if (\n Math.abs(dx) > entity.maxReach ||\n Math.abs(dy) > entity.maxReach\n )\n continue\n\n let localInf = 0\n for (const node of entity.nodes) {\n const nx = dx - node.offsetX\n const ny = dy - node.offsetY\n const dist = Math.sqrt(nx * nx + ny * ny)\n localInf += getFalloff(dist, node.radius)\n }\n if (localInf > 1) localInf = 1\n totalInfluence += localInf * entity.opacity\n }\n\n if (totalInfluence > 1) totalInfluence = 1\n\n // Draw Cell\n if (totalInfluence > 0.01) {\n // Gradient: White (Edge) to Green (#B6F3BF - Center)\n const edgeR = 255,\n centerR = 182\n const edgeG = 255,\n centerG = 243\n const edgeB = 255,\n centerB = 191\n\n // Interpolate from White (0 influence) to Green (1 influence)\n const r = Math.floor(edgeR + (centerR - edgeR) * totalInfluence)\n const g = Math.floor(edgeG + (centerG - edgeG) * totalInfluence)\n const b = Math.floor(edgeB + (centerB - edgeB) * totalInfluence)\n\n const alpha = totalInfluence * 0.5\n const size = BASE_SIZE + totalInfluence * (MAX_SIZE - BASE_SIZE)\n\n ctx.fillStyle = `rgba(${r}, ${g}, ${b}, ${alpha})`\n ctx.beginPath()\n ctx.arc(x, y, size / 2, 0, Math.PI * 2)\n ctx.fill()\n } else {\n ctx.fillStyle = \"rgba(47, 47, 47, 1)\"\n ctx.fillRect(x - 0.5, y - 0.5, 1, 1)\n }\n }\n }\n\n animationFrameId = requestAnimationFrame(draw)\n }\n\n window.addEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.addEventListener(\"mousemove\", handleMouseMove)\n }\n\n resize()\n draw()\n\n return () => {\n window.removeEventListener(\"resize\", handleResize)\n if (variant === \"animated\") {\n window.removeEventListener(\"mousemove\", handleMouseMove)\n }\n cancelAnimationFrame(animationFrameId)\n }\n }, [variant])\n\n return (\n <canvas\n ref={canvasRef}\n className=\"fixed inset-0 -z-999 w-full h-full pointer-events-none\"\n />\n )\n}\n\nexport default GeometricFluidGrid\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as N,b as w,c as O}from"./chunk-FZ3NXOFK.mjs";import{a as P,c as k,d as S,e as G,f as b,h as R}from"./chunk-U6XL5TKL.mjs";import{a as p}from"./chunk-S5TKCF6T.mjs";import*as d from"react";import{Check as z,ChevronDown as A,X as B}from"lucide-react";import{Fragment as F,jsx as o,jsxs as t}from"react/jsx-runtime";function U({options:c=[],groups:s,value:i,onValueChange:M,placeholder:u="Select option...",searchPlaceholder:D="Search...",emptyMessage:E="No option found.",disabled:I=!1,className:T,error:L=!1,multiple:l=!1,values:r=[],onValuesChange:f}){let[g,v]=d.useState(!1),x=d.useMemo(()=>s?s.flatMap(e=>e.options):c,[s,c]),C=x.find(e=>e.value===i),a=x.filter(e=>r.includes(e.value)),X=e=>{if(l){let n=r.includes(e)?r.filter(m=>m!==e):[...r,e];f?.(n)}else M?.(e===i?"":e),v(!1)},$=(e,n)=>{n.preventDefault(),n.stopPropagation();let m=r.filter(q=>q!==e);f?.(m)},j=()=>l?a.length===0?u:a.length===1?a[0].label:`${a.length} selected`:C?C.label:u,h=e=>{let n=l?r.includes(e.value):i===e.value;return t(R,{value:e.value,onSelect:X,className:"rounded-[12px]",children:[o("span",{className:"truncate",children:e.label}),o(z,{className:p("ml-auto h-4 w-4 shrink-0",n?"opacity-100":"opacity-0")})]},e.value)},y=()=>!l||a.length===0?null:o("div",{className:"px-2 py-1.5",children:o("div",{className:"flex flex-wrap gap-1",children:a.map(e=>t("div",{className:"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs",children:[o("span",{className:"truncate",children:e.label}),o(B,{className:"h-3 w-3 cursor-pointer",onClick:n=>$(e.value,n)})]},e.value))})});return t(N,{open:g,onOpenChange:v,children:[o(w,{asChild:!0,children:t("button",{type:"button",role:"combobox","aria-expanded":g,disabled:I,className:p("cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",!i&&!r.length&&"text-secondary-text",L&&"border-destructive-foreground focus-visible:ring-destructive-foreground",T),children:[o("span",{className:"truncate",children:j()}),o(A,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o(O,{className:"overflow-hidden rounded-xl p-0",align:"start",style:{width:"var(--radix-popover-trigger-width)"},children:t(P,{children:[o(k,{placeholder:D}),t(S,{children:[o(G,{children:E}),s?t(F,{children:[y(),s.map(e=>o(b,{heading:e.label,children:e.options.map(h)},e.label))]}):t(b,{children:[y(),c.map(h)]})]})]})})]})}export{U as a};
|
|
3
|
+
//# sourceMappingURL=chunk-RYJZXDJ5.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/combobox.tsx"],"sourcesContent":["import * as React from \"react\"\nimport { Check, ChevronDown, X } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\nimport {\n Command,\n CommandEmpty,\n CommandGroup,\n CommandInput,\n CommandItem,\n CommandList,\n} from \"@/components/command\"\nimport { Popover, PopoverContent, PopoverTrigger } from \"@/components/popover\"\n\nexport interface ComboboxOption {\n value: string\n label: string\n}\n\nexport interface ComboboxGroup {\n label: string\n options: ComboboxOption[]\n}\n\nexport interface ComboboxProps {\n options?: ComboboxOption[]\n groups?: ComboboxGroup[]\n value?: string\n onValueChange?: (value: string) => void\n placeholder?: string\n searchPlaceholder?: string\n emptyMessage?: string\n disabled?: boolean\n className?: string\n error?: boolean\n multiple?: boolean\n values?: string[]\n onValuesChange?: (values: string[]) => void\n}\n\nexport function Combobox({\n options = [],\n groups,\n value,\n onValueChange,\n placeholder = \"Select option...\",\n searchPlaceholder = \"Search...\",\n emptyMessage = \"No option found.\",\n disabled = false,\n className,\n error = false,\n multiple = false,\n values = [],\n onValuesChange,\n}: ComboboxProps) {\n const [open, setOpen] = React.useState(false)\n\n const allOptions = React.useMemo(() => {\n if (groups) return groups.flatMap((g) => g.options)\n return options\n }, [groups, options])\n\n const selectedOption = allOptions.find((option) => option.value === value)\n const selectedOptions = allOptions.filter((option) =>\n values.includes(option.value)\n )\n\n const handleSelect = (currentValue: string) => {\n if (multiple) {\n const newValues = values.includes(currentValue)\n ? values.filter((v) => v !== currentValue)\n : [...values, currentValue]\n onValuesChange?.(newValues)\n } else {\n onValueChange?.(currentValue === value ? \"\" : currentValue)\n setOpen(false)\n }\n }\n\n const handleRemoveValue = (valueToRemove: string, e: React.MouseEvent) => {\n e.preventDefault()\n e.stopPropagation()\n const newValues = values.filter((v) => v !== valueToRemove)\n onValuesChange?.(newValues)\n }\n\n const getDisplayText = () => {\n if (multiple) {\n if (selectedOptions.length === 0) return placeholder\n if (selectedOptions.length === 1) return selectedOptions[0].label\n return `${selectedOptions.length} selected`\n }\n return selectedOption ? selectedOption.label : placeholder\n }\n\n const renderOption = (option: ComboboxOption) => {\n const isSelected = multiple\n ? values.includes(option.value)\n : value === option.value\n\n return (\n <CommandItem\n key={option.value}\n value={option.value}\n onSelect={handleSelect}\n className=\"rounded-[12px]\"\n >\n <span className=\"truncate\">{option.label}</span>\n <Check\n className={cn(\n \"ml-auto h-4 w-4 shrink-0\",\n isSelected ? \"opacity-100\" : \"opacity-0\"\n )}\n />\n </CommandItem>\n )\n }\n\n const renderSelectedChips = () => {\n if (!multiple || selectedOptions.length === 0) return null\n\n return (\n <div className=\"px-2 py-1.5\">\n <div className=\"flex flex-wrap gap-1\">\n {selectedOptions.map((option) => (\n <div\n key={option.value}\n className=\"inline-flex items-center gap-1 rounded-md bg-secondary px-2 py-0.5 text-xs\"\n >\n <span className=\"truncate\">{option.label}</span>\n <X\n className=\"h-3 w-3 cursor-pointer\"\n onClick={(e) => handleRemoveValue(option.value, e)}\n />\n </div>\n ))}\n </div>\n </div>\n )\n }\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n role=\"combobox\"\n aria-expanded={open}\n disabled={disabled}\n className={cn(\n \"cursor-pointer flex my-2 h-9 w-full items-center justify-between rounded-3xl border border-border bg-background hover:bg-secondary px-4 py-2 text-sm text-primary-accent ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50\",\n !value && !values.length && \"text-secondary-text\",\n error &&\n \"border-destructive-foreground focus-visible:ring-destructive-foreground\",\n className\n )}\n >\n <span className=\"truncate\">{getDisplayText()}</span>\n <ChevronDown className=\"ml-2 h-4 w-4 shrink-0 opacity-50\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n className=\"overflow-hidden rounded-xl p-0\"\n align=\"start\"\n style={{ width: \"var(--radix-popover-trigger-width)\" }}\n >\n <Command>\n <CommandInput placeholder={searchPlaceholder} />\n <CommandList>\n <CommandEmpty>{emptyMessage}</CommandEmpty>\n {groups ? (\n <>\n {renderSelectedChips()}\n {groups.map((group) => (\n <CommandGroup key={group.label} heading={group.label}>\n {group.options.map(renderOption)}\n </CommandGroup>\n ))}\n </>\n ) : (\n <CommandGroup>\n {renderSelectedChips()}\n {options.map(renderOption)}\n </CommandGroup>\n )}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n )\n}\n"],"mappings":";4KAAA,UAAYA,MAAW,QACvB,OAAS,SAAAC,EAAO,eAAAC,EAAa,KAAAC,MAAS,eAoGhC,OAsEQ,YAAAC,EAhEN,OAAAC,EANF,QAAAC,MAAA,oBA7DC,SAASC,EAAS,CACvB,QAAAC,EAAU,CAAC,EACX,OAAAC,EACA,MAAAC,EACA,cAAAC,EACA,YAAAC,EAAc,mBACd,kBAAAC,EAAoB,YACpB,aAAAC,EAAe,mBACf,SAAAC,EAAW,GACX,UAAAC,EACA,MAAAC,EAAQ,GACR,SAAAC,EAAW,GACX,OAAAC,EAAS,CAAC,EACV,eAAAC,CACF,EAAkB,CAChB,GAAM,CAACC,EAAMC,CAAO,EAAU,WAAS,EAAK,EAEtCC,EAAmB,UAAQ,IAC3Bd,EAAeA,EAAO,QAASe,GAAMA,EAAE,OAAO,EAC3ChB,EACN,CAACC,EAAQD,CAAO,CAAC,EAEdiB,EAAiBF,EAAW,KAAMG,GAAWA,EAAO,QAAUhB,CAAK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U,yBACV,QAAUR,GAAMF,EAAkBN,EAAO,MAAOQ,CAAC,EACnD,IAPKR,EAAO,KAQd,CACD,EACH,EACF,EAIJ,OACEpB,EAACqC,EAAA,CAAQ,KAAMtB,EAAM,aAAcC,EACjC,UAAAjB,EAACuC,EAAA,CAAe,QAAO,GACrB,SAAAtC,EAAC,UACC,KAAK,SACL,KAAK,WACL,gBAAee,EACf,SAAUN,EACV,UAAWyB,EACT,sVACA,CAAC9B,GAAS,CAACS,EAAO,QAAU,sBAC5BF,GACE,0EACFD,CACF,EAEA,UAAAX,EAAC,QAAK,UAAU,WAAY,SAAA8B,EAAe,EAAE,EAC7C9B,EAACwC,EAAA,CAAY,UAAU,mCAAmC,GAC5D,EACF,EACAxC,EAACyC,EAAA,CACC,UAAU,iCACV,MAAM,QACN,MAAO,CAAE,MAAO,oCAAqC,EAErD,SAAAxC,EAACyC,EAAA,CACC,UAAA1C,EAAC2C,EAAA,CAAa,YAAanC,EAAmB,EAC9CP,EAAC2C,EAAA,CACC,UAAA5C,EAAC6C,EAAA,CAAc,SAAApC,EAAa,EAC3BL,EACCH,EAAAF,EAAA,CACG,UAAAqC,EAAoB,EACpBhC,EAAO,IAAK0C,GACX9C,EAAC+C,EAAA,CAA+B,QAASD,EAAM,MAC5C,SAAAA,EAAM,QAAQ,IAAIf,CAAY,GADde,EAAM,KAEzB,CACD,GACH,EAEA7C,EAAC8C,EAAA,CACE,UAAAX,EAAoB,EACpBjC,EAAQ,IAAI4B,CAAY,GAC3B,GAEJ,GACF,EACF,GACF,CAEJ","names":["React","Check","ChevronDown","X","Fragment","jsx","jsxs","Combobox","options","groups","value","onValueChange","placeholder","searchPlaceholder","emptyMessage","disabled","className","error","multiple","values","onValuesChange","open","setOpen","allOptions","g","selectedOption","option","selectedOptions","handleSelect","currentValue","newValues","v","handleRemoveValue","valueToRemove","e","getDisplayText","renderOption","isSelected","CommandItem","Check","cn","renderSelectedChips","X","Popover","PopoverTrigger","ChevronDown","PopoverContent","Command","CommandInput","CommandList","CommandEmpty","group","CommandGroup"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as e}from"./chunk-S5TKCF6T.mjs";import*as a from"react";import{jsx as s}from"react/jsx-runtime";var r=a.forwardRef(({className:l,...t},o)=>s("label",{ref:o,className:e("text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70",l),...t}));r.displayName="Label";export{r as a};
|
|
3
|
+
//# sourceMappingURL=chunk-WY4HCUAP.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/label.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}\n\nconst Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className, ...props }, ref) => (\n <label\n ref={ref}\n className={cn(\n \"text-sm font-medium leading-5 peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n className\n )}\n {...props}\n />\n )\n)\nLabel.displayName = \"Label\"\n\nexport { Label }\n"],"mappings":";yCAEA,UAAYA,MAAW,QAOnB,cAAAC,MAAA,oBAFJ,IAAMC,EAAc,aAClB,CAAC,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAGC,IACxBJ,EAAC,SACC,IAAKI,EACL,UAAWC,EACT,0FACAH,CACF,EACC,GAAGC,EACN,CAEJ,EACAF,EAAM,YAAc","names":["React","jsx","Label","className","props","ref","cn"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
"use client";var
|
|
2
|
+
"use client";var _chunkRKONP3N6js = require('../chunk-RKONP3N6.js');require('../chunk-XYO4VLMF.js');exports.default = _chunkRKONP3N6js.a;
|
|
3
3
|
//# sourceMappingURL=GeometricFluidGrid.js.map
|
|
@@ -8,7 +8,8 @@ interface TextDecoderProps {
|
|
|
8
8
|
symbols?: string;
|
|
9
9
|
delay?: number;
|
|
10
10
|
isLoading?: boolean;
|
|
11
|
+
speed?: number;
|
|
11
12
|
}
|
|
12
|
-
declare function
|
|
13
|
+
declare function TextDecoder({ children, className, duration, symbols, delay, isLoading, speed, }: TextDecoderProps): react_jsx_runtime.JSX.Element;
|
|
13
14
|
|
|
14
|
-
export { type TextDecoderProps,
|
|
15
|
+
export { type TextDecoderProps, TextDecoder as default };
|
|
@@ -8,7 +8,8 @@ interface TextDecoderProps {
|
|
|
8
8
|
symbols?: string;
|
|
9
9
|
delay?: number;
|
|
10
10
|
isLoading?: boolean;
|
|
11
|
+
speed?: number;
|
|
11
12
|
}
|
|
12
|
-
declare function
|
|
13
|
+
declare function TextDecoder({ children, className, duration, symbols, delay, isLoading, speed, }: TextDecoderProps): react_jsx_runtime.JSX.Element;
|
|
13
14
|
|
|
14
|
-
export { type TextDecoderProps,
|
|
15
|
+
export { type TextDecoderProps, TextDecoder as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
-
"use client";var
|
|
2
|
+
"use client";var _chunkEWRKHBIVjs = require('../chunk-EWRKHBIV.js');require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');exports.default = _chunkEWRKHBIVjs.a;
|
|
3
3
|
//# sourceMappingURL=TextDecoder.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use client";import{a}from"../chunk-
|
|
2
|
+
"use client";import{a}from"../chunk-CMV76O4U.mjs";import"../chunk-S5TKCF6T.mjs";import"../chunk-KPAOPUY2.mjs";export{a as default};
|
|
3
3
|
//# sourceMappingURL=TextDecoder.mjs.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }"use client";
|
|
2
|
-
var _chunkFUYXCJOQjs = require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');var _react = require('react'); var s = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');var i=s.forwardRef(({...a},e)=>_jsxruntime.jsx.call(void 0, "nav",{ref:e,"aria-label":"breadcrumb",...a}));i.displayName="Breadcrumb";var l=s.forwardRef(({className:a,...e},r)=>_jsxruntime.jsx.call(void 0, "ol",{ref:r,className:_chunkFUYXCJOQjs.a.call(void 0, "flex flex-wrap items-center gap-1.5 break-words text-sm text-secondary-text sm:gap-2.5",a),...e}));l.displayName="BreadcrumbList";var p=s.forwardRef(({className:a,...e},r)=>_jsxruntime.jsx.call(void 0, "li",{ref:r,className:_chunkFUYXCJOQjs.a.call(void 0, "inline-flex items-center gap-1.5",a),...e}));p.displayName="BreadcrumbItem";var d=s.forwardRef(({asChild:a,className:e,...r},n)=>_jsxruntime.jsx.call(void 0, "a",{ref:n,className:_chunkFUYXCJOQjs.a.call(void 0, "transition-colors",e),...r}));d.displayName="BreadcrumbLink";var f=s.forwardRef(({className:a,...e},r)=>_jsxruntime.jsx.call(void 0, "span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:_chunkFUYXCJOQjs.a.call(void 0, "font-normal text-primary-accent",a),...e}));f.displayName="BreadcrumbPage";var R=({children:a,className:e,...r})=>_jsxruntime.jsx.call(void 0, "li",{role:"presentation","aria-hidden":"true",className:_chunkFUYXCJOQjs.a.call(void 0, "[&>svg]:size-3.5",e),...r,children:_nullishCoalesce(a, () => (_jsxruntime.jsx.call(void 0, _lucidereact.ChevronRight,{})))});R.displayName="BreadcrumbSeparator";var u=({className:a,...e})=>_jsxruntime.jsxs.call(void 0, "span",{role:"presentation","aria-hidden":"true",className:_chunkFUYXCJOQjs.a.call(void 0, "flex h-9 w-9 items-center justify-center",a),...e,children:[_jsxruntime.jsx.call(void 0, _lucidereact.MoreHorizontal,{className:"h-4 w-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"More"})]});u.displayName="BreadcrumbEllipsis";exports.Breadcrumb = i; exports.BreadcrumbEllipsis = u; exports.BreadcrumbItem = p; exports.BreadcrumbLink = d; exports.BreadcrumbList = l; exports.BreadcrumbPage = f; exports.BreadcrumbSeparator = R;
|
|
2
|
+
var _chunkFUYXCJOQjs = require('../chunk-FUYXCJOQ.js');require('../chunk-XYO4VLMF.js');var _react = require('react'); var s = _interopRequireWildcard(_react);var _lucidereact = require('lucide-react');var _jsxruntime = require('react/jsx-runtime');var i=s.forwardRef(({...a},e)=>_jsxruntime.jsx.call(void 0, "nav",{ref:e,"aria-label":"breadcrumb",...a}));i.displayName="Breadcrumb";var l=s.forwardRef(({className:a,...e},r)=>_jsxruntime.jsx.call(void 0, "ol",{ref:r,className:_chunkFUYXCJOQjs.a.call(void 0, "flex flex-wrap items-center gap-1.5 break-words text-sm text-secondary-text sm:gap-2.5",a),...e}));l.displayName="BreadcrumbList";var p=s.forwardRef(({className:a,...e},r)=>_jsxruntime.jsx.call(void 0, "li",{ref:r,className:_chunkFUYXCJOQjs.a.call(void 0, "inline-flex items-center gap-1.5",a),...e}));p.displayName="BreadcrumbItem";var d=s.forwardRef(({asChild:a,className:e,...r},n)=>_jsxruntime.jsx.call(void 0, "a",{ref:n,className:_chunkFUYXCJOQjs.a.call(void 0, "transition-colors hover:text-hover-link",e),...r}));d.displayName="BreadcrumbLink";var f=s.forwardRef(({className:a,...e},r)=>_jsxruntime.jsx.call(void 0, "span",{ref:r,role:"link","aria-disabled":"true","aria-current":"page",className:_chunkFUYXCJOQjs.a.call(void 0, "font-normal text-primary-accent",a),...e}));f.displayName="BreadcrumbPage";var R=({children:a,className:e,...r})=>_jsxruntime.jsx.call(void 0, "li",{role:"presentation","aria-hidden":"true",className:_chunkFUYXCJOQjs.a.call(void 0, "[&>svg]:size-3.5",e),...r,children:_nullishCoalesce(a, () => (_jsxruntime.jsx.call(void 0, _lucidereact.ChevronRight,{})))});R.displayName="BreadcrumbSeparator";var u=({className:a,...e})=>_jsxruntime.jsxs.call(void 0, "span",{role:"presentation","aria-hidden":"true",className:_chunkFUYXCJOQjs.a.call(void 0, "flex h-9 w-9 items-center justify-center",a),...e,children:[_jsxruntime.jsx.call(void 0, _lucidereact.MoreHorizontal,{className:"h-4 w-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"More"})]});u.displayName="BreadcrumbEllipsis";exports.Breadcrumb = i; exports.BreadcrumbEllipsis = u; exports.BreadcrumbItem = p; exports.BreadcrumbLink = d; exports.BreadcrumbList = l; exports.BreadcrumbPage = f; exports.BreadcrumbSeparator = R;
|
|
3
3
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/components/breadcrumb.js","../../src/components/breadcrumb.tsx"],"names":["Breadcrumb","props","ref","jsx","BreadcrumbList","className","cn","BreadcrumbItem","BreadcrumbLink","asChild","BreadcrumbPage","BreadcrumbSeparator","children","ChevronRight","BreadcrumbEllipsis","jsxs","MoreHorizontal"],"mappings":"AAAA,2cAAY;AACZ,uDAAwC,gCAA6B,uECD9C,2CACsB,+CASpB,IALnBA,CAAAA,CAAmB,CAAA,CAAA,UAAA,CAKvB,CAAC,CAAE,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAQC,6BAAAA,KAAC,CAAA,CAAI,GAAA,CAAKD,CAAAA,CAAK,YAAA,CAAW,YAAA,CAAc,GAAGD,CAAAA,CAAO,CAAE,CAAA,CAC7ED,CAAAA,CAAW,WAAA,CAAc,YAAA,CAEzB,IAAMI,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAC,CAAAA,CAAW,GAAGJ,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BC,6BAAAA,IAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWI,gCAAAA,wFACT,CACAD,CACF,CAAA,CACC,GAAGJ,CAAAA,CACN,CACD,CAAA,CACDG,CAAAA,CAAe,WAAA,CAAc,gBAAA,CAE7B,IAAMG,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAG3B,CAAC,CAAE,SAAA,CAAAF,CAAAA,CAAW,GAAGJ,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAC1BC,6BAAAA,IAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,SAAA,CAAWI,gCAAAA,kCAAG,CAAoCD,CAAS,CAAA,CAC1D,GAAGJ,CAAAA,CACN,CACD,CAAA,CACDM,CAAAA,CAAe,WAAA,CAAc,gBAAA,CAE7B,IAAMC,CAAAA,CAAuB,CAAA,CAAA,UAAA,CAK3B,CAAC,CAAE,OAAA,CAAAC,CAAAA,CAAS,SAAA,CAAAJ,CAAAA,CAAW,GAAGJ,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAIjCC,6BAAAA,GAAC,CAAA,
|
|
1
|
+
{"version":3,"sources":["/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/components/breadcrumb.js","../../src/components/breadcrumb.tsx"],"names":["Breadcrumb","props","ref","jsx","BreadcrumbList","className","cn","BreadcrumbItem","BreadcrumbLink","asChild","BreadcrumbPage","BreadcrumbSeparator","children","ChevronRight","BreadcrumbEllipsis","jsxs","MoreHorizontal"],"mappings":"AAAA,2cAAY;AACZ,uDAAwC,gCAA6B,uECD9C,2CACsB,+CASpB,IALnBA,CAAAA,CAAmB,CAAA,CAAA,UAAA,CAKvB,CAAC,CAAE,GAAGC,CAAM,CAAA,CAAGC,CAAAA,CAAAA,EAAQC,6BAAAA,KAAC,CAAA,CAAI,GAAA,CAAKD,CAAA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AA,MAAC,CAAA,CACC,GAAA,CAAKD,CAAAA,CACL,IAAA,CAAK,MAAA,CACL,eAAA,CAAc,MAAA,CACd,cAAA,CAAa,MAAA,CACb,SAAA,CAAWI,gCAAAA,iCAAG,CAAmCD,CAAS,CAAA,CACzD,GAAGJ,CAAAA,CACN,CACD,CAAA,CACDS,CAAAA,CAAe,WAAA,CAAc,gBAAA,CAE7B,IAAMC,CAAAA,CAAsB,CAAC,CAC3B,QAAA,CAAAC,CAAAA,CACA,SAAA,CAAAP,CAAAA,CACA,GAAGJ,CACL,CAAA,CAAA,EACEE,6BAAAA,IAAC,CAAA,CACC,IAAA,CAAK,cAAA,CACL,aAAA,CAAY,MAAA,CACZ,SAAA,CAAWG,gCAAAA,kBAAG,CAAoBD,CAAS,CAAA,CAC1C,GAAGJ,CAAAA,CAEH,QAAA,kBAAAW,CAAAA,SAAYT,6BAAAA,yBAACU,CAAA,CAAA,CAAa,GAAA,CAC7B,CAAA,CAEFF,CAAAA,CAAoB,WAAA,CAAc,qBAAA,CAElC,IAAMG,CAAAA,CAAqB,CAAC,CAC1B,SAAA,CAAAT,CAAAA,CACA,GAAGJ,CACL,CAAA,CAAA,EACEc,8BAAAA,MAAC,CAAA,CACC,IAAA,CAAK,cAAA,CACL,aAAA,CAAY,MAAA,CACZ,SAAA,CAAWT,gCAAAA,0CAAG,CAA4CD,CAAS,CAAA,CAClE,GAAGJ,CAAAA,CAEJ,QAAA,CAAA,CAAAE,6BAAAA,2BAACa,CAAA,CAAe,SAAA,CAAU,SAAA,CAAU,CAAA,CACpCb,6BAAAA,MAAC,CAAA,CAAK,SAAA,CAAU,SAAA,CAAU,QAAA,CAAA,MAAA,CAAI,CAAA,CAAA,CAChC,CAAA,CAEFW,CAAAA,CAAmB,WAAA,CAAc,oBAAA,CAAA,wMAAA","file":"/Users/admin/Desktop/PROJECTS/alkimi-ui-kit/dist/components/breadcrumb.js","sourcesContent":[null,"import * as React from \"react\"\nimport { ChevronRight, MoreHorizontal } from \"lucide-react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst Breadcrumb = React.forwardRef<\n HTMLElement,\n React.ComponentPropsWithoutRef<\"nav\"> & {\n separator?: React.ReactNode\n }\n>(({ ...props }, ref) => <nav ref={ref} aria-label=\"breadcrumb\" {...props} />)\nBreadcrumb.displayName = \"Breadcrumb\"\n\nconst BreadcrumbList = React.forwardRef<\n HTMLOListElement,\n React.ComponentPropsWithoutRef<\"ol\">\n>(({ className, ...props }, ref) => (\n <ol\n ref={ref}\n className={cn(\n \"flex flex-wrap items-center gap-1.5 break-words text-sm text-secondary-text sm:gap-2.5\",\n className\n )}\n {...props}\n />\n))\nBreadcrumbList.displayName = \"BreadcrumbList\"\n\nconst BreadcrumbItem = React.forwardRef<\n HTMLLIElement,\n React.ComponentPropsWithoutRef<\"li\">\n>(({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\"inline-flex items-center gap-1.5\", className)}\n {...props}\n />\n))\nBreadcrumbItem.displayName = \"BreadcrumbItem\"\n\nconst BreadcrumbLink = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentPropsWithoutRef<\"a\"> & {\n asChild?: boolean\n }\n>(({ asChild, className, ...props }, ref) => {\n const Comp = \"a\"\n\n return (\n <Comp\n ref={ref}\n className={cn(\"transition-colors hover:text-hover-link\", className)}\n {...props}\n />\n )\n})\nBreadcrumbLink.displayName = \"BreadcrumbLink\"\n\nconst BreadcrumbPage = React.forwardRef<\n HTMLSpanElement,\n React.ComponentPropsWithoutRef<\"span\">\n>(({ className, ...props }, ref) => (\n <span\n ref={ref}\n role=\"link\"\n aria-disabled=\"true\"\n aria-current=\"page\"\n className={cn(\"font-normal text-primary-accent\", className)}\n {...props}\n />\n))\nBreadcrumbPage.displayName = \"BreadcrumbPage\"\n\nconst BreadcrumbSeparator = ({\n children,\n className,\n ...props\n}: React.ComponentProps<\"li\">) => (\n <li\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"[&>svg]:size-3.5\", className)}\n {...props}\n >\n {children ?? <ChevronRight />}\n </li>\n)\nBreadcrumbSeparator.displayName = \"BreadcrumbSeparator\"\n\nconst BreadcrumbEllipsis = ({\n className,\n ...props\n}: React.ComponentProps<\"span\">) => (\n <span\n role=\"presentation\"\n aria-hidden=\"true\"\n className={cn(\"flex h-9 w-9 items-center justify-center\", className)}\n {...props}\n >\n <MoreHorizontal className=\"h-4 w-4\" />\n <span className=\"sr-only\">More</span>\n </span>\n)\nBreadcrumbEllipsis.displayName = \"BreadcrumbEllipsis\"\n\nexport {\n Breadcrumb,\n BreadcrumbList,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbPage,\n BreadcrumbSeparator,\n BreadcrumbEllipsis,\n}\n"]}
|