@m1kapp/ui 0.1.12 → 0.1.13

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/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  0% { transform: rotate(-12deg) scale(2) translate(0, 0); }
6
6
  100% { transform: rotate(-12deg) scale(2) translate(180px, 100px); }
7
7
  }
8
- `,J=!1;function St(){if(J||typeof document>"u")return;let t=document.createElement("style");t.textContent=Nt,document.head.appendChild(t),J=!0}function Q({children:t,color:e="#0f172a",text:r="m1k",maxWidth:o=430,padding:a=12,sponsor:l,speed:h=20}){St();let s=Math.max(14,Math.min(28,Math.floor(160/r.length))),w=l?Math.max(14,Math.min(28,Math.floor(160/l.name.length))):s,f=180,d=100,n=16,c=16,E=n*f/2,R=c*d/2;return(0,z.jsxs)("div",{className:"h-dvh w-full relative overflow-hidden",style:{backgroundColor:e,transition:"background-color 0.5s ease"},children:[(0,z.jsx)("div",{className:"absolute inset-0 select-none",style:{transformOrigin:"center center",animation:h>0?`watermark-drift ${h}s linear infinite`:void 0,transform:"rotate(-12deg) scale(2)",pointerEvents:"none"},children:Array.from({length:c}).flatMap((L,m)=>Array.from({length:n}).map((W,k)=>{let N=k*f-E+f/2,A=m*d-R+d/2,$=(m+k)%2===1&&l,g={position:"absolute",left:N,top:A,transform:"translate(-50%, -50%)",fontWeight:900,color:"rgba(255,255,255,0.12)",whiteSpace:"nowrap",lineHeight:1,pointerEvents:"auto",cursor:"pointer"};return $?(0,z.jsx)("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...g,fontSize:w,textDecoration:"none"},children:l.name},`${m}-${k}`):(0,z.jsx)("a",{href:"https://m1k.app",target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...g,fontSize:s,textDecoration:"none"},children:r},`${m}-${k}`)}))}),(0,z.jsx)("div",{className:"relative z-10 h-full flex items-center justify-center mx-auto",style:{maxWidth:o,padding:a},children:t})]})}var j={blue:"#3b82f6",purple:"#8b5cf6",green:"#10b981",orange:"#f97316",pink:"#ec4899",red:"#ef4444",yellow:"#eab308",cyan:"#06b6d4",slate:"#0f172a",zinc:"#27272a"};var C=require("react"),tt=require("react-dom");var i=require("react/jsx-runtime"),Pt="(function(){try{var c=document.cookie.split('; ').find(function(r){return r.startsWith('theme=')});var t=c?c.split('=')[1]:null;if(t==='light'){document.documentElement.classList.remove('dark')}else{document.documentElement.classList.add('dark')}}catch(e){}})()";function et(){return(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:Pt}})}function Ct(t){try{document.cookie=`theme=${t?"dark":"light"};path=/;max-age=31536000;SameSite=Lax`}catch{}}function rt(t){let[e,r]=(0,C.useState)(()=>typeof document<"u"?document.documentElement.classList.contains("dark"):!0);(0,C.useEffect)(()=>{if(t!==void 0)return;let a=new MutationObserver(()=>{r(document.documentElement.classList.contains("dark"))});return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[t]);function o(){let a=!e;document.documentElement.classList.toggle("dark",a),Ct(a),r(a)}return[t!==void 0?t:e,o]}function at({color:t,dark:e,onClick:r,className:o=""}){let[a]=rt(e),l=a?"#000":"#fff",h=a?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.12)";return(0,i.jsx)("button",{onClick:r,className:`w-7 h-7 rounded-full transition-all active:scale-90 hover:scale-110 overflow-hidden cursor-pointer ${o}`,style:{boxShadow:`0 2px 10px ${t}55`},title:"Theme",children:(0,i.jsxs)("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",children:[(0,i.jsx)("path",{d:"M0 0 L100 0 L0 100 Z",fill:l}),(0,i.jsx)("path",{d:"M100 0 L100 100 L0 100 Z",fill:t}),(0,i.jsx)("circle",{cx:"50",cy:"50",r:"49",fill:"none",stroke:h,strokeWidth:"2"})]})})}function ot({open:t,onClose:e,current:r,onSelect:o,dark:a,onDarkToggle:l,palette:h=j}){let[s,w]=rt(a);function f(){l?l():w()}if((0,C.useEffect)(()=>{if(!t)return;let n=c=>{c.key==="Escape"&&e()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,e]),!t||typeof document>"u")return null;let d=Object.entries(h);return(0,tt.createPortal)((0,i.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-end justify-center",onClick:e,children:[(0,i.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,i.jsxs)("div",{className:"relative z-10 w-full max-w-[430px] mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:n=>n.stopPropagation(),children:[(0,i.jsxs)("div",{className:"px-4 pt-4 pb-3",children:[(0,i.jsx)("p",{className:"text-sm font-bold text-zinc-900 dark:text-white mb-3",children:"\uD14C\uB9C8"}),(0,i.jsx)("div",{className:"flex gap-2 mb-4",children:[{label:"\uB77C\uC774\uD2B8",isDark:!1},{label:"\uB2E4\uD06C",isDark:!0}].map(n=>{let c=s===n.isDark;return(0,i.jsxs)("button",{onClick:()=>{c||f()},className:`flex-1 flex items-center justify-center gap-2 py-2.5 rounded-2xl transition-all ${c?"bg-zinc-900 dark:bg-white ring-2 ring-zinc-900 dark:ring-white ring-offset-2 ring-offset-white dark:ring-offset-zinc-900":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:[n.isDark?(0,i.jsx)("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"#18181b":"#71717a",children:(0,i.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"})}):(0,i.jsxs)("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"white":"#71717a",children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,i.jsx)("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42",stroke:c?"white":"#71717a",strokeWidth:"2",strokeLinecap:"round"})]}),(0,i.jsx)("span",{className:`text-sm font-semibold ${c?"text-white dark:text-zinc-900":"text-zinc-400 dark:text-zinc-500"}`,children:n.label})]},n.label)})})]}),(0,i.jsx)("div",{className:"px-4 pb-3 grid grid-cols-5 gap-3 justify-items-center",children:d.map(([,n])=>(0,i.jsx)("button",{onClick:()=>{o(n),e()},className:"relative w-11 h-11 rounded-full transition-all hover:scale-110",style:{backgroundColor:n,boxShadow:r===n?`0 0 0 2px #fff, 0 0 0 4px ${n}`:"0 0 0 1.5px rgba(255,255,255,0.5), 0 2px 8px rgba(255,255,255,0.2)"},children:r===n&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("polyline",{points:"20 6 9 17 4 12"})})})},n))}),(0,i.jsx)("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:(0,i.jsx)("button",{onClick:e,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"Close"})})]})]}),document.body)}var it={tossface:"https://cdn.jsdelivr.net/gh/toss/tossface/dist/tossface.css",pretendard:"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css",inter:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap"},nt={default:'"Pretendard Variable", "Pretendard", system-ui, -apple-system, sans-serif, "Tossface"',pretendard:'"Pretendard Variable", "Pretendard", system-ui, sans-serif',inter:'"Inter", system-ui, sans-serif'};var v=require("react"),u=require("react/jsx-runtime");function st({words:t,color:e="currentColor",speed:r=80,deleteSpeed:o=30,pauseMs:a=2200,gapMs:l=400,cursorColor:h,className:s=""}){let[w,f]=(0,v.useState)(0),[d,n]=(0,v.useState)(0),[c,E]=(0,v.useState)(!1),[R,L]=(0,v.useState)(!0),m=t[w]||"",W=h||e,k=c?d>0:d<m.length;(0,v.useEffect)(()=>{if(k){L(!0);return}let g=setInterval(()=>L(y=>!y),530);return()=>clearInterval(g)},[k]),(0,v.useEffect)(()=>{if(!c&&d<m.length){let g=Math.random()*r,y=m[d-1]===" "?r*.4:0,mt=setTimeout(()=>n(ft=>ft+1),r*.75+g+y);return()=>clearTimeout(mt)}if(!c&&d===m.length){let g=setTimeout(()=>E(!0),a);return()=>clearTimeout(g)}if(c&&d>0){let g=setTimeout(()=>n(y=>y-1),o+Math.random()*o*.6);return()=>clearTimeout(g)}if(c&&d===0){let g=setTimeout(()=>{E(!1),f(y=>(y+1)%t.length)},l);return()=>clearTimeout(g)}},[d,c,m,r,o,a,l,t.length]);let N=m.slice(0,d),A=N[N.length-1],$=N.slice(0,-1);return(0,u.jsxs)("span",{className:s,style:{color:e},children:[d>0&&(0,u.jsxs)(u.Fragment,{children:[$,(0,u.jsx)("span",{className:"inline-block",style:{animation:c?void 0:"m1k-char-pop 0.1s ease-out"},children:A},`${w}-${d}`)]}),(0,u.jsx)("span",{className:"inline-block w-0.5 h-[1em] ml-px align-middle rounded-full",style:{backgroundColor:W,opacity:R?1:0,transition:"opacity 0.1s"}}),(0,u.jsx)("style",{children:`
8
+ `,J=!1;function St(){if(J||typeof document>"u")return;let t=document.createElement("style");t.textContent=Nt,document.head.appendChild(t),J=!0}function Q({children:t,color:e="#0f172a",text:r="m1k",maxWidth:o=430,padding:a=12,sponsor:l,speed:h=20}){St();let s=Math.max(14,Math.min(28,Math.floor(160/r.length))),w=l?Math.max(14,Math.min(28,Math.floor(160/l.name.length))):s,f=180,d=100,n=16,c=16,E=n*f/2,R=c*d/2;return(0,z.jsxs)("div",{className:"h-dvh w-full relative overflow-hidden",style:{backgroundColor:e,transition:"background-color 0.5s ease"},children:[(0,z.jsx)("div",{className:"absolute inset-0 select-none",style:{transformOrigin:"center center",animation:h>0?`watermark-drift ${h}s linear infinite`:void 0,transform:"rotate(-12deg) scale(2)",pointerEvents:"none"},children:Array.from({length:c}).flatMap((L,m)=>Array.from({length:n}).map((W,k)=>{let N=k*f-E+f/2,A=m*d-R+d/2,$=(m+k)%2===1&&l,g={position:"absolute",left:N,top:A,transform:"translate(-50%, -50%)",fontWeight:900,color:"rgba(255,255,255,0.12)",whiteSpace:"nowrap",lineHeight:1,pointerEvents:"auto",cursor:"pointer"};return $?(0,z.jsx)("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...g,fontSize:w,textDecoration:"none"},children:l.name},`${m}-${k}`):(0,z.jsx)("a",{href:"https://m1k.app",target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...g,fontSize:s,textDecoration:"none"},children:r},`${m}-${k}`)}))}),(0,z.jsx)("div",{className:"relative z-10 h-full flex items-center justify-center mx-auto",style:{maxWidth:o,padding:a},children:t})]})}var j={blue:"#3b82f6",purple:"#8b5cf6",green:"#10b981",orange:"#f97316",pink:"#ec4899",red:"#ef4444",yellow:"#eab308",cyan:"#06b6d4",slate:"#0f172a",zinc:"#27272a"};var C=require("react"),tt=require("react-dom");var i=require("react/jsx-runtime"),Pt="(function(){try{var c=document.cookie.split('; ').find(function(r){return r.startsWith('theme=')});var t=c?c.split('=')[1]:null;if(t==='dark'){document.documentElement.classList.add('dark')}else{document.documentElement.classList.remove('dark')}}catch(e){}})()";function et(){return(0,i.jsx)("script",{dangerouslySetInnerHTML:{__html:Pt}})}function Ct(t){try{document.cookie=`theme=${t?"dark":"light"};path=/;max-age=31536000;SameSite=Lax`}catch{}}function rt(t){let[e,r]=(0,C.useState)(()=>typeof document<"u"?document.documentElement.classList.contains("dark"):!1);(0,C.useEffect)(()=>{if(t!==void 0)return;r(document.documentElement.classList.contains("dark"));let a=new MutationObserver(()=>{r(document.documentElement.classList.contains("dark"))});return a.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[t]);function o(){let a=!e;document.documentElement.classList.toggle("dark",a),Ct(a),r(a)}return[t!==void 0?t:e,o]}function at({color:t,dark:e,onClick:r,className:o=""}){let[a]=rt(e),l=a?"#000":"#fff",h=a?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.12)";return(0,i.jsx)("button",{onClick:r,className:`w-7 h-7 rounded-full transition-all active:scale-90 hover:scale-110 overflow-hidden cursor-pointer ${o}`,style:{boxShadow:`0 2px 10px ${t}55`},title:"Theme",children:(0,i.jsxs)("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",children:[(0,i.jsx)("path",{d:"M0 0 L100 0 L0 100 Z",fill:l}),(0,i.jsx)("path",{d:"M100 0 L100 100 L0 100 Z",fill:t}),(0,i.jsx)("circle",{cx:"50",cy:"50",r:"49",fill:"none",stroke:h,strokeWidth:"2"})]})})}function ot({open:t,onClose:e,current:r,onSelect:o,dark:a,onDarkToggle:l,palette:h=j}){let[s,w]=rt(a);function f(){l?l():w()}if((0,C.useEffect)(()=>{if(!t)return;let n=c=>{c.key==="Escape"&&e()};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[t,e]),!t||typeof document>"u")return null;let d=Object.entries(h);return(0,tt.createPortal)((0,i.jsxs)("div",{className:"fixed inset-0 z-[9999] flex items-end justify-center",onClick:e,children:[(0,i.jsx)("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),(0,i.jsxs)("div",{className:"relative z-10 w-full max-w-[430px] mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:n=>n.stopPropagation(),children:[(0,i.jsxs)("div",{className:"px-4 pt-4 pb-3",children:[(0,i.jsx)("p",{className:"text-sm font-bold text-zinc-900 dark:text-white mb-3",children:"\uD14C\uB9C8"}),(0,i.jsx)("div",{className:"flex gap-2 mb-4",children:[{label:"\uB77C\uC774\uD2B8",isDark:!1},{label:"\uB2E4\uD06C",isDark:!0}].map(n=>{let c=s===n.isDark;return(0,i.jsxs)("button",{onClick:()=>{c||f()},className:`flex-1 flex items-center justify-center gap-2 py-2.5 rounded-2xl transition-all ${c?"bg-zinc-900 dark:bg-white ring-2 ring-zinc-900 dark:ring-white ring-offset-2 ring-offset-white dark:ring-offset-zinc-900":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:[n.isDark?(0,i.jsx)("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"#18181b":"#71717a",children:(0,i.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"})}):(0,i.jsxs)("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"white":"#71717a",children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,i.jsx)("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42",stroke:c?"white":"#71717a",strokeWidth:"2",strokeLinecap:"round"})]}),(0,i.jsx)("span",{className:`text-sm font-semibold ${c?"text-white dark:text-zinc-900":"text-zinc-400 dark:text-zinc-500"}`,children:n.label})]},n.label)})})]}),(0,i.jsx)("div",{className:"px-4 pb-3 grid grid-cols-5 gap-3 justify-items-center",children:d.map(([,n])=>(0,i.jsx)("button",{onClick:()=>{o(n),e()},className:"relative w-11 h-11 rounded-full transition-all hover:scale-110",style:{backgroundColor:n,boxShadow:r===n?`0 0 0 2px #fff, 0 0 0 4px ${n}`:"0 0 0 1.5px rgba(255,255,255,0.5), 0 2px 8px rgba(255,255,255,0.2)"},children:r===n&&(0,i.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:(0,i.jsx)("polyline",{points:"20 6 9 17 4 12"})})})},n))}),(0,i.jsx)("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:(0,i.jsx)("button",{onClick:e,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"Close"})})]})]}),document.body)}var it={tossface:"https://cdn.jsdelivr.net/gh/toss/tossface/dist/tossface.css",pretendard:"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css",inter:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap"},nt={default:'"Pretendard Variable", "Pretendard", system-ui, -apple-system, sans-serif, "Tossface"',pretendard:'"Pretendard Variable", "Pretendard", system-ui, sans-serif',inter:'"Inter", system-ui, sans-serif'};var v=require("react"),u=require("react/jsx-runtime");function st({words:t,color:e="currentColor",speed:r=80,deleteSpeed:o=30,pauseMs:a=2200,gapMs:l=400,cursorColor:h,className:s=""}){let[w,f]=(0,v.useState)(0),[d,n]=(0,v.useState)(0),[c,E]=(0,v.useState)(!1),[R,L]=(0,v.useState)(!0),m=t[w]||"",W=h||e,k=c?d>0:d<m.length;(0,v.useEffect)(()=>{if(k){L(!0);return}let g=setInterval(()=>L(y=>!y),530);return()=>clearInterval(g)},[k]),(0,v.useEffect)(()=>{if(!c&&d<m.length){let g=Math.random()*r,y=m[d-1]===" "?r*.4:0,mt=setTimeout(()=>n(ft=>ft+1),r*.75+g+y);return()=>clearTimeout(mt)}if(!c&&d===m.length){let g=setTimeout(()=>E(!0),a);return()=>clearTimeout(g)}if(c&&d>0){let g=setTimeout(()=>n(y=>y-1),o+Math.random()*o*.6);return()=>clearTimeout(g)}if(c&&d===0){let g=setTimeout(()=>{E(!1),f(y=>(y+1)%t.length)},l);return()=>clearTimeout(g)}},[d,c,m,r,o,a,l,t.length]);let N=m.slice(0,d),A=N[N.length-1],$=N.slice(0,-1);return(0,u.jsxs)("span",{className:s,style:{color:e},children:[d>0&&(0,u.jsxs)(u.Fragment,{children:[$,(0,u.jsx)("span",{className:"inline-block",style:{animation:c?void 0:"m1k-char-pop 0.1s ease-out"},children:A},`${w}-${d}`)]}),(0,u.jsx)("span",{className:"inline-block w-0.5 h-[1em] ml-px align-middle rounded-full",style:{backgroundColor:W,opacity:R?1:0,transition:"opacity 0.1s"}}),(0,u.jsx)("style",{children:`
9
9
  @keyframes m1k-char-pop {
10
10
  0% { opacity: 0; transform: translateY(4px); }
11
11
  100% { opacity: 1; transform: translateY(0); }
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ var $=`/*! tailwindcss v4.2.2 | MIT License | https://tailwindcss.com */
5
5
  0% { transform: rotate(-12deg) scale(2) translate(0, 0); }
6
6
  100% { transform: rotate(-12deg) scale(2) translate(180px, 100px); }
7
7
  }
8
- `,H=!1;function dt(){if(H||typeof document>"u")return;let t=document.createElement("style");t.textContent=lt,document.head.appendChild(t),H=!0}function pt({children:t,color:e="#0f172a",text:r="m1k",maxWidth:a=430,padding:o=12,sponsor:l,speed:p=20}){dt();let n=Math.max(14,Math.min(28,Math.floor(160/r.length))),h=l?Math.max(14,Math.min(28,Math.floor(160/l.name.length))):n,f=180,d=100,i=16,c=16,y=i*f/2,S=c*d/2;return ht("div",{className:"h-dvh w-full relative overflow-hidden",style:{backgroundColor:e,transition:"background-color 0.5s ease"},children:[z("div",{className:"absolute inset-0 select-none",style:{transformOrigin:"center center",animation:p>0?`watermark-drift ${p}s linear infinite`:void 0,transform:"rotate(-12deg) scale(2)",pointerEvents:"none"},children:Array.from({length:c}).flatMap((P,g)=>Array.from({length:i}).map((A,b)=>{let x=b*f-y+f/2,C=g*d-S+d/2,E=(g+b)%2===1&&l,w={position:"absolute",left:x,top:C,transform:"translate(-50%, -50%)",fontWeight:900,color:"rgba(255,255,255,0.12)",whiteSpace:"nowrap",lineHeight:1,pointerEvents:"auto",cursor:"pointer"};return E?z("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...w,fontSize:h,textDecoration:"none"},children:l.name},`${g}-${b}`):z("a",{href:"https://m1k.app",target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...w,fontSize:n,textDecoration:"none"},children:r},`${g}-${b}`)}))}),z("div",{className:"relative z-10 h-full flex items-center justify-center mx-auto",style:{maxWidth:a,padding:o},children:t})]})}var M={blue:"#3b82f6",purple:"#8b5cf6",green:"#10b981",orange:"#f97316",pink:"#ec4899",red:"#ef4444",yellow:"#eab308",cyan:"#06b6d4",slate:"#0f172a",zinc:"#27272a"};import{useEffect as F,useState as wt}from"react";import{createPortal as gt}from"react-dom";import{jsx as s,jsxs as v}from"react/jsx-runtime";var mt="(function(){try{var c=document.cookie.split('; ').find(function(r){return r.startsWith('theme=')});var t=c?c.split('=')[1]:null;if(t==='light'){document.documentElement.classList.remove('dark')}else{document.documentElement.classList.add('dark')}}catch(e){}})()";function ft(){return s("script",{dangerouslySetInnerHTML:{__html:mt}})}function bt(t){try{document.cookie=`theme=${t?"dark":"light"};path=/;max-age=31536000;SameSite=Lax`}catch{}}function _(t){let[e,r]=wt(()=>typeof document<"u"?document.documentElement.classList.contains("dark"):!0);F(()=>{if(t!==void 0)return;let o=new MutationObserver(()=>{r(document.documentElement.classList.contains("dark"))});return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>o.disconnect()},[t]);function a(){let o=!e;document.documentElement.classList.toggle("dark",o),bt(o),r(o)}return[t!==void 0?t:e,a]}function ut({color:t,dark:e,onClick:r,className:a=""}){let[o]=_(e),l=o?"#000":"#fff",p=o?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.12)";return s("button",{onClick:r,className:`w-7 h-7 rounded-full transition-all active:scale-90 hover:scale-110 overflow-hidden cursor-pointer ${a}`,style:{boxShadow:`0 2px 10px ${t}55`},title:"Theme",children:v("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",children:[s("path",{d:"M0 0 L100 0 L0 100 Z",fill:l}),s("path",{d:"M100 0 L100 100 L0 100 Z",fill:t}),s("circle",{cx:"50",cy:"50",r:"49",fill:"none",stroke:p,strokeWidth:"2"})]})})}function vt({open:t,onClose:e,current:r,onSelect:a,dark:o,onDarkToggle:l,palette:p=M}){let[n,h]=_(o);function f(){l?l():h()}if(F(()=>{if(!t)return;let i=c=>{c.key==="Escape"&&e()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,e]),!t||typeof document>"u")return null;let d=Object.entries(p);return gt(v("div",{className:"fixed inset-0 z-[9999] flex items-end justify-center",onClick:e,children:[s("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),v("div",{className:"relative z-10 w-full max-w-[430px] mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:i=>i.stopPropagation(),children:[v("div",{className:"px-4 pt-4 pb-3",children:[s("p",{className:"text-sm font-bold text-zinc-900 dark:text-white mb-3",children:"\uD14C\uB9C8"}),s("div",{className:"flex gap-2 mb-4",children:[{label:"\uB77C\uC774\uD2B8",isDark:!1},{label:"\uB2E4\uD06C",isDark:!0}].map(i=>{let c=n===i.isDark;return v("button",{onClick:()=>{c||f()},className:`flex-1 flex items-center justify-center gap-2 py-2.5 rounded-2xl transition-all ${c?"bg-zinc-900 dark:bg-white ring-2 ring-zinc-900 dark:ring-white ring-offset-2 ring-offset-white dark:ring-offset-zinc-900":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:[i.isDark?s("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"#18181b":"#71717a",children:s("path",{d:"M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"})}):v("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"white":"#71717a",children:[s("circle",{cx:"12",cy:"12",r:"5"}),s("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42",stroke:c?"white":"#71717a",strokeWidth:"2",strokeLinecap:"round"})]}),s("span",{className:`text-sm font-semibold ${c?"text-white dark:text-zinc-900":"text-zinc-400 dark:text-zinc-500"}`,children:i.label})]},i.label)})})]}),s("div",{className:"px-4 pb-3 grid grid-cols-5 gap-3 justify-items-center",children:d.map(([,i])=>s("button",{onClick:()=>{a(i),e()},className:"relative w-11 h-11 rounded-full transition-all hover:scale-110",style:{backgroundColor:i,boxShadow:r===i?`0 0 0 2px #fff, 0 0 0 4px ${i}`:"0 0 0 1.5px rgba(255,255,255,0.5), 0 2px 8px rgba(255,255,255,0.2)"},children:r===i&&s("div",{className:"absolute inset-0 flex items-center justify-center",children:s("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:s("polyline",{points:"20 6 9 17 4 12"})})})},i))}),s("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:s("button",{onClick:e,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"Close"})})]})]}),document.body)}var xt={tossface:"https://cdn.jsdelivr.net/gh/toss/tossface/dist/tossface.css",pretendard:"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css",inter:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap"},kt={default:'"Pretendard Variable", "Pretendard", system-ui, -apple-system, sans-serif, "Tossface"',pretendard:'"Pretendard Variable", "Pretendard", system-ui, sans-serif',inter:'"Inter", system-ui, sans-serif'};import{useState as N,useEffect as O}from"react";import{Fragment as zt,jsx as R,jsxs as Y}from"react/jsx-runtime";function yt({words:t,color:e="currentColor",speed:r=80,deleteSpeed:a=30,pauseMs:o=2200,gapMs:l=400,cursorColor:p,className:n=""}){let[h,f]=N(0),[d,i]=N(0),[c,y]=N(!1),[S,P]=N(!0),g=t[h]||"",A=p||e,b=c?d>0:d<g.length;O(()=>{if(b){P(!0);return}let w=setInterval(()=>P(u=>!u),530);return()=>clearInterval(w)},[b]),O(()=>{if(!c&&d<g.length){let w=Math.random()*r,u=g[d-1]===" "?r*.4:0,X=setTimeout(()=>i(V=>V+1),r*.75+w+u);return()=>clearTimeout(X)}if(!c&&d===g.length){let w=setTimeout(()=>y(!0),o);return()=>clearTimeout(w)}if(c&&d>0){let w=setTimeout(()=>i(u=>u-1),a+Math.random()*a*.6);return()=>clearTimeout(w)}if(c&&d===0){let w=setTimeout(()=>{y(!1),f(u=>(u+1)%t.length)},l);return()=>clearTimeout(w)}},[d,c,g,r,a,o,l,t.length]);let x=g.slice(0,d),C=x[x.length-1],E=x.slice(0,-1);return Y("span",{className:n,style:{color:e},children:[d>0&&Y(zt,{children:[E,R("span",{className:"inline-block",style:{animation:c?void 0:"m1k-char-pop 0.1s ease-out"},children:C},`${h}-${d}`)]}),R("span",{className:"inline-block w-0.5 h-[1em] ml-px align-middle rounded-full",style:{backgroundColor:A,opacity:S?1:0,transition:"opacity 0.1s"}}),R("style",{children:`
8
+ `,H=!1;function dt(){if(H||typeof document>"u")return;let t=document.createElement("style");t.textContent=lt,document.head.appendChild(t),H=!0}function pt({children:t,color:e="#0f172a",text:r="m1k",maxWidth:a=430,padding:o=12,sponsor:l,speed:p=20}){dt();let n=Math.max(14,Math.min(28,Math.floor(160/r.length))),h=l?Math.max(14,Math.min(28,Math.floor(160/l.name.length))):n,f=180,d=100,i=16,c=16,y=i*f/2,S=c*d/2;return ht("div",{className:"h-dvh w-full relative overflow-hidden",style:{backgroundColor:e,transition:"background-color 0.5s ease"},children:[z("div",{className:"absolute inset-0 select-none",style:{transformOrigin:"center center",animation:p>0?`watermark-drift ${p}s linear infinite`:void 0,transform:"rotate(-12deg) scale(2)",pointerEvents:"none"},children:Array.from({length:c}).flatMap((P,g)=>Array.from({length:i}).map((A,b)=>{let x=b*f-y+f/2,C=g*d-S+d/2,E=(g+b)%2===1&&l,w={position:"absolute",left:x,top:C,transform:"translate(-50%, -50%)",fontWeight:900,color:"rgba(255,255,255,0.12)",whiteSpace:"nowrap",lineHeight:1,pointerEvents:"auto",cursor:"pointer"};return E?z("a",{href:l.url,target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...w,fontSize:h,textDecoration:"none"},children:l.name},`${g}-${b}`):z("a",{href:"https://m1k.app",target:"_blank",rel:"noopener noreferrer",className:"hover:opacity-30 transition-opacity",style:{...w,fontSize:n,textDecoration:"none"},children:r},`${g}-${b}`)}))}),z("div",{className:"relative z-10 h-full flex items-center justify-center mx-auto",style:{maxWidth:a,padding:o},children:t})]})}var M={blue:"#3b82f6",purple:"#8b5cf6",green:"#10b981",orange:"#f97316",pink:"#ec4899",red:"#ef4444",yellow:"#eab308",cyan:"#06b6d4",slate:"#0f172a",zinc:"#27272a"};import{useEffect as F,useState as wt}from"react";import{createPortal as gt}from"react-dom";import{jsx as s,jsxs as v}from"react/jsx-runtime";var mt="(function(){try{var c=document.cookie.split('; ').find(function(r){return r.startsWith('theme=')});var t=c?c.split('=')[1]:null;if(t==='dark'){document.documentElement.classList.add('dark')}else{document.documentElement.classList.remove('dark')}}catch(e){}})()";function ft(){return s("script",{dangerouslySetInnerHTML:{__html:mt}})}function bt(t){try{document.cookie=`theme=${t?"dark":"light"};path=/;max-age=31536000;SameSite=Lax`}catch{}}function _(t){let[e,r]=wt(()=>typeof document<"u"?document.documentElement.classList.contains("dark"):!1);F(()=>{if(t!==void 0)return;r(document.documentElement.classList.contains("dark"));let o=new MutationObserver(()=>{r(document.documentElement.classList.contains("dark"))});return o.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>o.disconnect()},[t]);function a(){let o=!e;document.documentElement.classList.toggle("dark",o),bt(o),r(o)}return[t!==void 0?t:e,a]}function ut({color:t,dark:e,onClick:r,className:a=""}){let[o]=_(e),l=o?"#000":"#fff",p=o?"rgba(255,255,255,0.15)":"rgba(0,0,0,0.12)";return s("button",{onClick:r,className:`w-7 h-7 rounded-full transition-all active:scale-90 hover:scale-110 overflow-hidden cursor-pointer ${a}`,style:{boxShadow:`0 2px 10px ${t}55`},title:"Theme",children:v("svg",{width:"100%",height:"100%",viewBox:"0 0 100 100",children:[s("path",{d:"M0 0 L100 0 L0 100 Z",fill:l}),s("path",{d:"M100 0 L100 100 L0 100 Z",fill:t}),s("circle",{cx:"50",cy:"50",r:"49",fill:"none",stroke:p,strokeWidth:"2"})]})})}function vt({open:t,onClose:e,current:r,onSelect:a,dark:o,onDarkToggle:l,palette:p=M}){let[n,h]=_(o);function f(){l?l():h()}if(F(()=>{if(!t)return;let i=c=>{c.key==="Escape"&&e()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,e]),!t||typeof document>"u")return null;let d=Object.entries(p);return gt(v("div",{className:"fixed inset-0 z-[9999] flex items-end justify-center",onClick:e,children:[s("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),v("div",{className:"relative z-10 w-full max-w-[430px] mb-3 mx-3 rounded-2xl bg-white dark:bg-zinc-900 shadow-2xl overflow-hidden",onClick:i=>i.stopPropagation(),children:[v("div",{className:"px-4 pt-4 pb-3",children:[s("p",{className:"text-sm font-bold text-zinc-900 dark:text-white mb-3",children:"\uD14C\uB9C8"}),s("div",{className:"flex gap-2 mb-4",children:[{label:"\uB77C\uC774\uD2B8",isDark:!1},{label:"\uB2E4\uD06C",isDark:!0}].map(i=>{let c=n===i.isDark;return v("button",{onClick:()=>{c||f()},className:`flex-1 flex items-center justify-center gap-2 py-2.5 rounded-2xl transition-all ${c?"bg-zinc-900 dark:bg-white ring-2 ring-zinc-900 dark:ring-white ring-offset-2 ring-offset-white dark:ring-offset-zinc-900":"bg-zinc-100 dark:bg-zinc-800 hover:bg-zinc-200 dark:hover:bg-zinc-700"}`,children:[i.isDark?s("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"#18181b":"#71717a",children:s("path",{d:"M21 12.79A9 9 0 1 1 11.21 3a7 7 0 0 0 9.79 9.79z"})}):v("svg",{width:"15",height:"15",viewBox:"-1 -1 26 26",fill:c?"white":"#71717a",children:[s("circle",{cx:"12",cy:"12",r:"5"}),s("path",{d:"M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42",stroke:c?"white":"#71717a",strokeWidth:"2",strokeLinecap:"round"})]}),s("span",{className:`text-sm font-semibold ${c?"text-white dark:text-zinc-900":"text-zinc-400 dark:text-zinc-500"}`,children:i.label})]},i.label)})})]}),s("div",{className:"px-4 pb-3 grid grid-cols-5 gap-3 justify-items-center",children:d.map(([,i])=>s("button",{onClick:()=>{a(i),e()},className:"relative w-11 h-11 rounded-full transition-all hover:scale-110",style:{backgroundColor:i,boxShadow:r===i?`0 0 0 2px #fff, 0 0 0 4px ${i}`:"0 0 0 1.5px rgba(255,255,255,0.5), 0 2px 8px rgba(255,255,255,0.2)"},children:r===i&&s("div",{className:"absolute inset-0 flex items-center justify-center",children:s("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:s("polyline",{points:"20 6 9 17 4 12"})})})},i))}),s("div",{className:"px-4 py-3 border-t border-zinc-100 dark:border-zinc-800",children:s("button",{onClick:e,className:"w-full py-2.5 rounded-xl bg-zinc-100 dark:bg-zinc-800 text-sm font-medium text-zinc-600 dark:text-zinc-400 hover:bg-zinc-200 dark:hover:bg-zinc-700 transition-colors",children:"Close"})})]})]}),document.body)}var xt={tossface:"https://cdn.jsdelivr.net/gh/toss/tossface/dist/tossface.css",pretendard:"https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css",inter:"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap"},kt={default:'"Pretendard Variable", "Pretendard", system-ui, -apple-system, sans-serif, "Tossface"',pretendard:'"Pretendard Variable", "Pretendard", system-ui, sans-serif',inter:'"Inter", system-ui, sans-serif'};import{useState as N,useEffect as O}from"react";import{Fragment as zt,jsx as R,jsxs as Y}from"react/jsx-runtime";function yt({words:t,color:e="currentColor",speed:r=80,deleteSpeed:a=30,pauseMs:o=2200,gapMs:l=400,cursorColor:p,className:n=""}){let[h,f]=N(0),[d,i]=N(0),[c,y]=N(!1),[S,P]=N(!0),g=t[h]||"",A=p||e,b=c?d>0:d<g.length;O(()=>{if(b){P(!0);return}let w=setInterval(()=>P(u=>!u),530);return()=>clearInterval(w)},[b]),O(()=>{if(!c&&d<g.length){let w=Math.random()*r,u=g[d-1]===" "?r*.4:0,X=setTimeout(()=>i(V=>V+1),r*.75+w+u);return()=>clearTimeout(X)}if(!c&&d===g.length){let w=setTimeout(()=>y(!0),o);return()=>clearTimeout(w)}if(c&&d>0){let w=setTimeout(()=>i(u=>u-1),a+Math.random()*a*.6);return()=>clearTimeout(w)}if(c&&d===0){let w=setTimeout(()=>{y(!1),f(u=>(u+1)%t.length)},l);return()=>clearTimeout(w)}},[d,c,g,r,a,o,l,t.length]);let x=g.slice(0,d),C=x[x.length-1],E=x.slice(0,-1);return Y("span",{className:n,style:{color:e},children:[d>0&&Y(zt,{children:[E,R("span",{className:"inline-block",style:{animation:c?void 0:"m1k-char-pop 0.1s ease-out"},children:C},`${h}-${d}`)]}),R("span",{className:"inline-block w-0.5 h-[1em] ml-px align-middle rounded-full",style:{backgroundColor:A,opacity:S?1:0,transition:"opacity 0.1s"}}),R("style",{children:`
9
9
  @keyframes m1k-char-pop {
10
10
  0% { opacity: 0; transform: translateY(4px); }
11
11
  100% { opacity: 1; transform: translateY(0); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m1kapp/ui",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Mobile-first app shell UI components for side projects",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",