@tuwaio/nova-core 1.0.0-fix-integrate-orbit-alpha.16.610f49e → 1.0.0-fix-integrate-orbit-alpha.18.4b877e5

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.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var framerMotion=require('framer-motion'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),m=require('react'),o=require('@radix-ui/react-dialog');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var m__namespace=/*#__PURE__*/_interopNamespace(m);var o__namespace=/*#__PURE__*/_interopNamespace(o);function l(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var c=e=>e&&typeof e=="object"&&!Array.isArray(e);function C(e,t){let i={...e};return c(e)&&c(t)&&Object.keys(t).forEach(r=>{let a=e[r],n=t[r];c(a)&&c(n)?i[r]=C(a,n):i[r]=n;}),i}function X(e,t,i){if(!e)return "";if(e.length<=t+i)return e;let r=e.slice(0,t),a=e.slice(e.length-i);return `${r}...${a}`}function oe({className:e,strokeWidth:t,isOpen:i}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:t??2,stroke:"currentColor",className:l("w-4 h-4 text-[var(--tuwa-text-secondary)]",e),children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:i&&jsxRuntime.jsx(framerMotion.motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5",variants:{hidden:{translateY:3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:!i&&jsxRuntime.jsx(framerMotion.motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5",className:"relative",variants:{hidden:{translateY:-3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})})]})}var M=m__namespace.forwardRef(({className:e,...t},i)=>jsxRuntime.jsxs("svg",{ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors",e),...t,children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]}));M.displayName="CloseIcon";var ue=o__namespace.Root,fe=o__namespace.Trigger,A=o__namespace.Portal,ve=o__namespace.Close,E={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},V={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},D=m__namespace.forwardRef(({className:e,backdropAnimation:t,...i},r)=>jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{variants:t??V,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsxRuntime.jsx(o__namespace.Overlay,{ref:r,className:l("fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150",e),...i})})}));D.displayName=o__namespace.Overlay.displayName;var S=m__namespace.forwardRef(({className:e,children:t,modalAnimation:i,backdropAnimation:r,...a},n)=>jsxRuntime.jsxs(A,{children:[jsxRuntime.jsx(D,{backdropAnimation:r}),jsxRuntime.jsx(o__namespace.Content,{"aria-describedby":"tuwa:modal-content",ref:n,className:l("fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none",e),...a,children:jsxRuntime.jsx(framerMotion.motion.div,{layout:true,className:"relative overflow-hidden",transition:{layout:{duration:.2,ease:[.1,.1,.2,1]}},children:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{variants:i??E,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsxRuntime.jsx("div",{className:l("relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl","border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]"),children:t})})})})})]}));S.displayName=o__namespace.Content.displayName;var L=({className:e,...t})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-header",className:l("sticky flex top-0 z-11 w-full flex-row items-center justify-between","border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4",e),...t});L.displayName="DialogHeader";var O=({className:e,...t})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-footer",className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O.displayName="DialogFooter";var W=m__namespace.forwardRef(({className:e,...t},i)=>jsxRuntime.jsx(o__namespace.Title,{ref:i,"aria-describedby":"tuwa:modal-title",className:l("text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0",e),...t}));W.displayName=o__namespace.Title.displayName;var Y=m__namespace.forwardRef(({className:e,...t},i)=>jsxRuntime.jsx(o__namespace.Description,{"aria-describedby":"tuwa:modal-description",ref:i,className:l("text-sm text-[var(--tuwa-text-secondary)]",e),...t}));Y.displayName=o__namespace.Description.displayName;function be({starsCount:e}){let[t,i]=m.useState(false);m.useEffect(()=>i(true),[]);let r=m.useMemo(()=>{if(!t)return [];let a=e??200;return Array.from({length:a}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5}))},[t]);return jsxRuntime.jsx("div",{className:"absolute inset-0 z-1 h-full w-full overflow-hidden",children:jsxRuntime.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("style",{children:`
1
+ 'use strict';var framerMotion=require('framer-motion'),clsx=require('clsx'),tailwindMerge=require('tailwind-merge'),jsxRuntime=require('react/jsx-runtime'),m=require('react'),o=require('@radix-ui/react-dialog');function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var m__namespace=/*#__PURE__*/_interopNamespace(m);var o__namespace=/*#__PURE__*/_interopNamespace(o);var Q="cursor-pointer rounded-md bg-[var(--tuwa-standart-button-bg)] px-3 py-2 flex items-center gap-1 text-sm font-semibold text-[var(--tuwa-text-primary)] transition-colors hover:bg-[var(--tuwa-standart-button-hover)] disabled:cursor-not-allowed disabled:opacity-50";function l(...e){return tailwindMerge.twMerge(clsx.clsx(e))}var c=e=>e&&typeof e=="object"&&!Array.isArray(e);function C(e,t){let a={...e};return c(e)&&c(t)&&Object.keys(t).forEach(r=>{let i=e[r],n=t[r];c(i)&&c(n)?a[r]=C(i,n):a[r]=n;}),a}function _(e,t,a){if(!e)return "";if(e.length<=t+a)return e;let r=e.slice(0,t),i=e.slice(e.length-a);return `${r}...${i}`}function se({className:e,strokeWidth:t,isOpen:a}){return jsxRuntime.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:t??2,stroke:"currentColor",className:l("w-4 h-4 text-[var(--tuwa-text-secondary)]",e),children:[jsxRuntime.jsx(framerMotion.AnimatePresence,{children:a&&jsxRuntime.jsx(framerMotion.motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5",variants:{hidden:{translateY:3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})}),jsxRuntime.jsx(framerMotion.AnimatePresence,{children:!a&&jsxRuntime.jsx(framerMotion.motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5",className:"relative",variants:{hidden:{translateY:-3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})})]})}var M=m__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsxs("svg",{ref:a,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors",e),...t,children:[jsxRuntime.jsx("path",{d:"M18 6 6 18"}),jsxRuntime.jsx("path",{d:"m6 6 12 12"})]}));M.displayName="CloseIcon";var ge=o__namespace.Root,ye=o__namespace.Trigger,A=o__namespace.Portal,we=o__namespace.Close,E={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},V={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},D=m__namespace.forwardRef(({className:e,backdropAnimation:t,...a},r)=>jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{variants:t??V,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsxRuntime.jsx(o__namespace.Overlay,{ref:r,className:l("fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150",e),...a})})}));D.displayName=o__namespace.Overlay.displayName;var S=m__namespace.forwardRef(({className:e,children:t,modalAnimation:a,backdropAnimation:r,...i},n)=>jsxRuntime.jsxs(A,{children:[jsxRuntime.jsx(D,{backdropAnimation:r}),jsxRuntime.jsx(o__namespace.Content,{"aria-describedby":"tuwa:modal-content",ref:n,className:l("fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none",e),...i,children:jsxRuntime.jsx(framerMotion.motion.div,{layout:true,className:"relative overflow-hidden",transition:{layout:{duration:.2,ease:[.1,.1,.2,1]}},children:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:jsxRuntime.jsx(framerMotion.motion.div,{variants:a??E,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsxRuntime.jsx("div",{className:l("relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl","border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]"),children:t})})})})})]}));S.displayName=o__namespace.Content.displayName;var L=({className:e,...t})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-header",className:l("sticky flex top-0 z-11 w-full flex-row items-center justify-between","border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4",e),...t});L.displayName="DialogHeader";var O=({className:e,...t})=>jsxRuntime.jsx("div",{"aria-describedby":"tuwa:modal-footer",className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O.displayName="DialogFooter";var W=m__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx(o__namespace.Title,{ref:a,"aria-describedby":"tuwa:modal-title",className:l("text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0",e),...t}));W.displayName=o__namespace.Title.displayName;var Y=m__namespace.forwardRef(({className:e,...t},a)=>jsxRuntime.jsx(o__namespace.Description,{"aria-describedby":"tuwa:modal-description",ref:a,className:l("text-sm text-[var(--tuwa-text-secondary)]",e),...t}));Y.displayName=o__namespace.Description.displayName;function De({starsCount:e}){let[t,a]=m.useState(false);m.useEffect(()=>a(true),[]);let r=m.useMemo(()=>{if(!t)return [];let i=e??200;return Array.from({length:i}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5}))},[t]);return jsxRuntime.jsx("div",{className:"absolute inset-0 z-1 h-full w-full overflow-hidden",children:jsxRuntime.jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntime.jsx("defs",{children:jsxRuntime.jsx("style",{children:`
2
2
  /* Pulse animation now includes scale for a more organic feel. */
3
3
  @keyframes pulse {
4
4
  0%, 100% {
@@ -44,5 +44,5 @@
44
44
  transform-origin: center;
45
45
  stroke-width: 2;
46
46
  }
47
- `})}),r.map((a,n)=>jsxRuntime.jsx("circle",{cx:a.x,cy:a.y,r:a.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:a.isSupernova?"supernova":"pulsar",style:{animationDelay:`${a.delay}s`,animationDuration:`${a.duration}s`}},n))]})})}function Pe(e=2e3){let[t,i]=m.useState(false),[r,a]=m.useState(null),n=m.useCallback(async f=>{if(f)try{await navigator.clipboard.writeText(f),i(!0),a(null),setTimeout(()=>i(!1),e);}catch(v){let g=v instanceof Error?v:new Error("Failed to copy text.");console.error(g),a(g),setTimeout(()=>a(null),e);}},[e]);return {isCopied:t,copy:n,error:r}}function Ce(e){let t=a=>typeof window<"u"?window.matchMedia(a).matches:false,[i,r]=m.useState(t(e));return m.useEffect(()=>{let a=window.matchMedia(e),n=()=>r(a.matches);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),i}exports.ChevronArrowWithAnim=oe;exports.CloseIcon=M;exports.Dialog=ue;exports.DialogClose=ve;exports.DialogContent=S;exports.DialogDescription=Y;exports.DialogFooter=O;exports.DialogHeader=L;exports.DialogOverlay=D;exports.DialogPortal=A;exports.DialogTitle=W;exports.DialogTrigger=fe;exports.StarsBackground=be;exports.cn=l;exports.deepMerge=C;exports.textCenterEllipsis=X;exports.useCopyToClipboard=Pe;exports.useMediaQuery=Ce;//# sourceMappingURL=index.cjs.map
47
+ `})}),r.map((i,n)=>jsxRuntime.jsx("circle",{cx:i.x,cy:i.y,r:i.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:i.isSupernova?"supernova":"pulsar",style:{animationDelay:`${i.delay}s`,animationDuration:`${i.duration}s`}},n))]})})}function Ce(e=2e3){let[t,a]=m.useState(false),[r,i]=m.useState(null),n=m.useCallback(async f=>{if(f)try{await navigator.clipboard.writeText(f),a(!0),i(null),setTimeout(()=>a(!1),e);}catch(v){let g=v instanceof Error?v:new Error("Failed to copy text.");console.error(g),i(g),setTimeout(()=>i(null),e);}},[e]);return {isCopied:t,copy:n,error:r}}function Te(e){let t=i=>typeof window<"u"?window.matchMedia(i).matches:false,[a,r]=m.useState(t(e));return m.useEffect(()=>{let i=window.matchMedia(e),n=()=>r(i.matches);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),a}exports.ChevronArrowWithAnim=se;exports.CloseIcon=M;exports.Dialog=ge;exports.DialogClose=we;exports.DialogContent=S;exports.DialogDescription=Y;exports.DialogFooter=O;exports.DialogHeader=L;exports.DialogOverlay=D;exports.DialogPortal=A;exports.DialogTitle=W;exports.DialogTrigger=ye;exports.StarsBackground=De;exports.cn=l;exports.deepMerge=C;exports.standardButtonClasses=Q;exports.textCenterEllipsis=_;exports.useCopyToClipboard=Ce;exports.useMediaQuery=Te;//# sourceMappingURL=index.cjs.map
48
48
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/cn.ts","../src/utils/deepMerge.ts","../src/utils/textCenterEllipsis.ts","../src/components/ChevronArrowWithAnim.tsx","../src/components/CloseIcon.tsx","../src/components/Modal.tsx","../src/components/StarsBackground.tsx","../src/hooks/useCopyToClipboard.ts","../src/hooks/useMediaQuery.ts"],"names":["cn","inputs","twMerge","clsx","isObject","item","deepMerge","target","source","output","key","targetValue","sourceValue","textCenterEllipsis","str","from","to","start","end","ChevronArrowWithAnim","className","strokeWidth","isOpen","jsxs","jsx","AnimatePresence","motion","CloseIcon","x","props","ref","Dialog","o","DialogTrigger","DialogPortal","DialogClose","defaultModalAnimation","defaultModalBackdropAnimation","DialogOverlay","m","backdropAnimation","DialogContent","children","modalAnimation","DialogHeader","DialogFooter","DialogTitle","DialogDescription","StarsBackground","starsCount","isMounted","setIsMounted","useState","useEffect","stars","useMemo","numStars","star","i","useCopyToClipboard","timeout","isCopied","setIsCopied","error","setError","copy","useCallback","text","e","copyError","useMediaQuery","query","getMatches","q","matches","setMatches","media","listener"],"mappings":"4mBAwBO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CChBA,IAAMG,CAAAA,CAAYC,GACTA,CAAAA,EAAQ,OAAOA,GAAS,QAAA,EAAY,CAAC,MAAM,OAAA,CAAQA,CAAI,EAkBzD,SAASC,CAAAA,CAA4BC,EAAWC,CAAAA,CAAuB,CAE5E,IAAMC,CAAAA,CAAS,CAAE,GAAGF,CAAO,CAAA,CAE3B,OAAIH,EAASG,CAAM,CAAA,EAAKH,EAASI,CAAM,CAAA,EAErC,OAAO,IAAA,CAAKA,CAAM,EAAE,OAAA,CAASE,CAAAA,EAAQ,CACnC,IAAMC,CAAAA,CAAcJ,EAAOG,CAAc,CAAA,CACnCE,EAAcJ,CAAAA,CAAOE,CAAc,CAAA,CAGrCN,CAAAA,CAASO,CAAW,CAAA,EAAKP,EAASQ,CAAW,CAAA,CAG9CH,EAA+BC,CAAG,CA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ACd,OAAO,MAAA,CAAW,IACb,MAAA,CAAO,UAAA,CAAWA,CAAC,CAAA,CAAE,OAAA,CAEvB,MAGH,CAACC,CAAAA,CAASC,CAAU,CAAA,CAAIvB,UAAAA,CAAkBoB,CAAAA,CAAWD,CAAK,CAAC,CAAA,CAEjE,OAAAlB,WAAAA,CAAU,IAAM,CACd,IAAMuB,CAAAA,CAAQ,MAAA,CAAO,UAAA,CAAWL,CAAK,CAAA,CAC/BM,EAAW,IAAMF,CAAAA,CAAWC,EAAM,OAAO,CAAA,CAG/C,OAAAC,CAAAA,EAAS,CACT,MAAA,CAAO,gBAAA,CAAiB,QAAA,CAAUA,CAAQ,EAEnC,IAAM,MAAA,CAAO,mBAAA,CAAoB,QAAA,CAAUA,CAAQ,CAC5D,EAAG,CAACN,CAAK,CAAC,CAAA,CAEHG,CACT","file":"index.cjs","sourcesContent":["/**\n * @file This file contains a utility function for conditionally merging Tailwind CSS classes.\n */\n\nimport { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * A utility function to conditionally join class names together and resolve\n * conflicting Tailwind CSS classes.\n *\n * It combines the functionality of `clsx` and `tailwind-merge`.\n *\n * @param {...ClassValue[]} inputs - A list of class values to be combined.\n * This can include strings, numbers, objects, arrays, and booleans.\n * @returns {string} The final, merged class name string.\n *\n * @example\n * cn('p-4', 'bg-red-500', { 'font-bold': true }); // => 'p-4 bg-red-500 font-bold'\n * cn('p-2', 'p-4'); // => 'p-4' (tailwind-merge resolves the conflict)\n *\n * @see https://github.com/dcastil/tailwind-merge\n * @see https://github.com/lukeed/clsx\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * @file This file contains a utility for performing a deep (recursive) merge of two objects.\n */\n\n/**\n * Checks if the provided item is a plain object (i.e., not null and not an array).\n *\n * @param {any} item - The item to check.\n * @returns {item is Record<string, any>} True if the item is a plain object, otherwise false.\n */\nconst isObject = (item: any): item is Record<string, any> => {\n return item && typeof item === 'object' && !Array.isArray(item);\n};\n\n/**\n * Recursively merges the properties of a source object into a target object.\n * This function creates a new object and does not mutate the original target.\n *\n * @template T - The type of the objects being merged.\n * @param {T} target - The base object.\n * @param {Partial<T>} source - The object with properties to merge into the target.\n * @returns {T} A new object representing the merged result.\n *\n * @example\n * const defaults = { a: 1, b: { c: 2, d: 3 } };\n * const custom = { b: { c: 99 } };\n * const result = deepMerge(defaults, custom);\n * // result will be { a: 1, b: { c: 99, d: 3 } }\n */\nexport function deepMerge<T extends object>(target: T, source: Partial<T>): T {\n // Start with a shallow copy of the target to avoid mutation.\n const output = { ...target };\n\n if (isObject(target) && isObject(source)) {\n // Iterate over the keys in the source object.\n Object.keys(source).forEach((key) => {\n const targetValue = target[key as keyof T];\n const sourceValue = source[key as keyof T];\n\n // If the value is an object in both target and source, merge them recursively.\n if (isObject(targetValue) && isObject(sourceValue)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n (output as Record<string, any>)[key] = deepMerge(targetValue, sourceValue);\n } else {\n // Otherwise, the source value overwrites the target value.\n (output as Record<string, any>)[key] = sourceValue;\n }\n });\n }\n\n return output;\n}\n","/**\n * @file This file contains a utility function for truncating a string with a center ellipsis.\n */\n\n/**\n * Truncates a string by showing a specified number of characters from the start and end,\n * with an ellipsis in the middle. If the string is too short to be truncated, it's returned as is.\n *\n * @param {string} str - The string to truncate.\n * @param {number} from - The number of characters to show from the beginning of the string.\n * @param {number} to - The number of characters to show from the end of the string.\n * @returns {string} The truncated string, or the original string if it's too short.\n *\n * @example\n * const hash = '0x1234567890abcdef1234567890abcdef';\n * textCenterEllipsis(hash, 6, 4); // => \"0x1234...cdef\"\n *\n * textCenterEllipsis('short', 6, 4); // => \"short\"\n */\nexport function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string {\n if (!str) {\n return '';\n }\n\n // If the string is short enough, don't truncate it.\n if (str.length <= from + to) {\n return str;\n }\n\n const start = str.slice(0, from);\n const end = str.slice(str.length - to);\n\n return `${start}...${end}`;\n}\n","import { AnimatePresence, motion } from 'framer-motion';\n\nimport { cn } from '../utils';\n\nexport function ChevronArrowWithAnim({\n className,\n strokeWidth,\n isOpen,\n}: {\n className?: string;\n strokeWidth?: number;\n isOpen?: boolean;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={strokeWidth ?? 2}\n stroke=\"currentColor\"\n className={cn('w-4 h-4 text-[var(--tuwa-text-secondary)]', className)}\n >\n <AnimatePresence>\n {isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n variants={{\n hidden: { translateY: 3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n\n <AnimatePresence>\n {!isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n className=\"relative\"\n variants={{\n hidden: { translateY: -3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n </svg>\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '../utils';\n\n/**\n * A reusable close button icon (X mark) styled with TUWA color scheme.\n */\nexport const CloseIcon = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGSVGElement>>(\n ({ className, ...props }, ref) => (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn('h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors', className)}\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n ),\n);\nCloseIcon.displayName = 'CloseIcon';\n","import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { AnimatePresence, motion, Variants } from 'framer-motion';\nimport * as React from 'react';\n\nimport { cn } from '../utils';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst defaultModalAnimation: Variants = {\n initial: { opacity: 0, scale: 0.9, y: 20 },\n animate: { opacity: 1, scale: 1, y: 0 },\n exit: {\n opacity: 0,\n scale: 0.9,\n transition: {\n duration: 0.2,\n },\n },\n};\n\nconst defaultModalBackdropAnimation: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n};\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> & {\n backdropAnimation?: Variants;\n }\n>(({ className, backdropAnimation, ...props }, ref) => (\n <AnimatePresence>\n <motion.div\n variants={backdropAnimation ?? defaultModalBackdropAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150', className)}\n {...props}\n />\n </motion.div>\n </AnimatePresence>\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n modalAnimation?: Variants;\n backdropAnimation?: Variants;\n }\n>(({ className, children, modalAnimation, backdropAnimation, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay backdropAnimation={backdropAnimation} />\n\n <DialogPrimitive.Content\n aria-describedby=\"tuwa:modal-content\"\n ref={ref}\n className={cn(\n 'fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none',\n className,\n )}\n {...props}\n >\n <motion.div\n layout\n className=\"relative overflow-hidden\"\n transition={{\n layout: {\n duration: 0.2,\n ease: [0.1, 0.1, 0.2, 1],\n },\n }}\n >\n <AnimatePresence>\n <motion.div\n variants={modalAnimation ?? defaultModalAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <div\n className={cn(\n 'relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl',\n 'border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]',\n )}\n >\n {children}\n </div>\n </motion.div>\n </AnimatePresence>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-header\"\n className={cn(\n 'sticky flex top-0 z-11 w-full flex-row items-center justify-between',\n 'border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-footer\"\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n aria-describedby=\"tuwa:modal-title\"\n className={cn('text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n aria-describedby=\"tuwa:modal-description\"\n ref={ref}\n className={cn('text-sm text-[var(--tuwa-text-secondary)]', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","import { useEffect, useMemo, useState } from 'react';\n\nexport function StarsBackground({ starsCount }: { starsCount?: number }) {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const stars = useMemo(() => {\n if (!isMounted) {\n return [];\n }\n\n const numStars = starsCount ?? 200;\n return Array.from({ length: numStars }).map(() => ({\n x: Math.random() * window.innerWidth,\n y: Math.random() * window.innerHeight,\n r: Math.random() * 1 + 0.5,\n isSupernova: Math.random() < 0.1,\n delay: Math.random() * 10,\n duration: 5 + Math.random() * 5,\n }));\n }, [isMounted]);\n\n return (\n <div className=\"absolute inset-0 z-1 h-full w-full overflow-hidden\">\n <svg width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <style>\n {`\n /* Pulse animation now includes scale for a more organic feel. */\n @keyframes pulse {\n 0%, 100% { \n opacity: 0.2;\n transform: scale(0.9);\n }\n 50% {\n opacity: 0.8;\n transform: scale(1.2);\n }\n }\n \n /* Supernova animation remains impactful. */\n @keyframes supernova {\n 0% { \n transform: scale(1);\n stroke: rgba(var(--tuwa-bg-primary), 0.5);\n opacity: 0.8;\n }\n 20% { \n transform: scale(3);\n stroke: var(--tuwa-button-gradient-from);\n opacity: 1;\n }\n 100% { \n transform: scale(0.8);\n stroke: var(--tuwa-button-gradient-to);\n opacity: 0;\n }\n }\n\n .pulsar {\n animation-name: pulse;\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n }\n\n .supernova {\n animation-name: supernova;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n stroke-width: 2;\n }\n `}\n </style>\n </defs>\n\n {stars.map((star, i) => (\n <circle\n key={i}\n cx={star.x}\n cy={star.y}\n r={star.r}\n fill={`rgba(var(--tuwa-bg-primary), 0.7)`}\n className={star.isSupernova ? 'supernova' : 'pulsar'}\n style={{\n animationDelay: `${star.delay}s`,\n animationDuration: `${star.duration}s`,\n }}\n />\n ))}\n </svg>\n </div>\n );\n}\n","/**\n * @file This file contains a custom React hook for copying text to the clipboard.\n */\n\nimport { useCallback, useState } from 'react';\n\n/**\n * A custom React hook that provides functionality to copy text to the clipboard.\n * It also manages a \"copied\" state with a timeout for user feedback.\n *\n * @param {number} [timeout=2000] - The duration in milliseconds to keep the `isCopied` state as true.\n * @returns {{\n * isCopied: boolean;\n * copy: (text: string) => Promise<void>;\n * error: Error | null;\n * }} An object containing the `isCopied` state, the `copy` function, and any potential error.\n *\n * @example\n * const MyComponent = () => {\n * const { isCopied, copy } = useCopyToClipboard();\n * const textToCopy = '0x123...';\n *\n * return (\n * <button onClick={() => copy(textToCopy)}>\n * {isCopied ? 'Copied!' : 'Copy Address'}\n * </button>\n * );\n * }\n */\nexport function useCopyToClipboard(timeout = 2000): {\n isCopied: boolean;\n copy: (text: string) => Promise<void>;\n error: Error | null;\n} {\n const [isCopied, setIsCopied] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const copy = useCallback(\n async (text: string) => {\n if (!text) return;\n\n try {\n await navigator.clipboard.writeText(text);\n setIsCopied(true);\n setError(null);\n\n setTimeout(() => setIsCopied(false), timeout);\n } catch (e) {\n const copyError = e instanceof Error ? e : new Error('Failed to copy text.');\n console.error(copyError);\n setError(copyError);\n\n // Reset error state after timeout as well\n setTimeout(() => setError(null), timeout);\n }\n },\n [timeout],\n );\n\n return { isCopied, copy, error };\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * A custom hook to detect if a media query matches the current screen dimensions.\n * Handles SSR gracefully.\n * @param {string} query - The media query string (e.g., '(max-width: 767px)').\n * @returns {boolean} Whether the query matches or not.\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatches = (q: string): boolean => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(q).matches;\n }\n return false;\n };\n\n const [matches, setMatches] = useState<boolean>(getMatches(query));\n\n useEffect(() => {\n const media = window.matchMedia(query);\n const listener = () => setMatches(media.matches);\n\n // Re-check on mount and subscribe to changes\n listener();\n window.addEventListener('resize', listener);\n\n return () => window.removeEventListener('resize', listener);\n }, [query]);\n\n return matches;\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/classes.ts","../src/utils/cn.ts","../src/utils/deepMerge.ts","../src/utils/textCenterEllipsis.ts","../src/components/ChevronArrowWithAnim.tsx","../src/components/CloseIcon.tsx","../src/components/Modal.tsx","../src/components/StarsBackground.tsx","../src/hooks/useCopyToClipboard.ts","../src/hooks/useMediaQuery.ts"],"names":["standardButtonClasses","cn","inputs","twMerge","clsx","isObject","item","deepMerge","target","source","output","key","targetValue","sourceValue","textCenterEllipsis","str","from","to","start","end","ChevronArrowWithAnim","className","strokeWidth","isOpen","jsxs","jsx","AnimatePresence","motion","CloseIcon","x","props","ref","Dialog","o","DialogTrigger","DialogPortal","DialogClose","defaultModalAnimation","defaultModalBackdropAnimation","DialogOverlay","m","backdropAnimation","DialogContent","children","modalAnimation","DialogHeader","DialogFooter","DialogTitle","DialogDescription","StarsBackground","starsCount","isMounted","setIsMounted","useState","useEffect","stars","useMemo","numStars","star","i","useCopyToClipboard","timeout","isCopied","setIsCopied","error","setError","copy","useCallback","text","e","copyError","useMediaQuery","query","getMatches","q","matches","setMatches","media","listener"],"mappings":"4mBAAO,IAAMA,CAAAA,CACX,uQCuBK,SAASC,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,qBAAAA,CAAQC,SAAAA,CAAKF,CAAM,CAAC,CAC7B,CChBA,IAAMG,CAAAA,CAAYC,GACTA,CAAAA,EAAQ,OAAOA,CAAAA,EAAS,QAAA,EAAY,CAAC,KAAA,CAAM,QAAQA,CAAI,CAAA,CAkBzD,SAASC,CAAAA,CAA4BC,CAAAA,CAAWC,EAAuB,CAE5E,IAAMC,CAAAA,CAAS,CAAE,GAAGF,CAAO,EAE3B,OAAIH,CAAAA,CAASG,CAAM,CAAA,EAAKH,CAAAA,CAASI,CAAM,CAAA,EAErC,MAAA,CAAO,KAAKA,CAAM,CAAA,CAAE,QAASE,CAAAA,EAAQ,CACnC,IAAMC,CAAAA,CAAcJ,CAAAA,CAAOG,CAAc,CAAA,CACnCE,CAAAA,CAAcJ,CAAAA,CAAOE,CAAc,CAAA,CAGrCN,CAAAA,CAASO,CAAW,CAAA,EAAKP,CAAAA,CAASQ,CAAW,CAAA,CAG9CH,CAAAA,CAA+BC,CAAG,CAAA,CAAIJ,CAAAA,CAAUK,CAAAA,CAAaC,CAAW,CAAA,CAGxEH,CAAAA,CAA+BC,CAAG,CAAA,CAAIE,EAE3C,CAAC,CAAA,CAGIH,CACT,CCjCO,SAASI,CAAAA,CAAmBC,CAAAA,CAAgCC,CAAAA,CAAcC,CAAAA,CAAoB,CACnG,GAAI,CAACF,CAAAA,CACH,OAAO,EAAA,CAIT,GAAIA,EAAI,MAAA,EAAUC,CAAAA,CAAOC,EACvB,OAAOF,CAAAA,CAGT,IAAMG,CAAAA,CAAQH,CAAAA,CAAI,MAAM,CAAA,CAAGC,CAAI,EACzBG,CAAA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O,CAAA,CAG/C,OAAAC,CAAAA,EAAS,CACT,MAAA,CAAO,gBAAA,CAAiB,QAAA,CAAUA,CAAQ,EAEnC,IAAM,MAAA,CAAO,mBAAA,CAAoB,QAAA,CAAUA,CAAQ,CAC5D,EAAG,CAACN,CAAK,CAAC,CAAA,CAEHG,CACT","file":"index.cjs","sourcesContent":["export const standardButtonClasses =\n 'cursor-pointer rounded-md bg-[var(--tuwa-standart-button-bg)] px-3 py-2 flex items-center gap-1 text-sm font-semibold text-[var(--tuwa-text-primary)] transition-colors hover:bg-[var(--tuwa-standart-button-hover)] disabled:cursor-not-allowed disabled:opacity-50';\n","/**\n * @file This file contains a utility function for conditionally merging Tailwind CSS classes.\n */\n\nimport { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * A utility function to conditionally join class names together and resolve\n * conflicting Tailwind CSS classes.\n *\n * It combines the functionality of `clsx` and `tailwind-merge`.\n *\n * @param {...ClassValue[]} inputs - A list of class values to be combined.\n * This can include strings, numbers, objects, arrays, and booleans.\n * @returns {string} The final, merged class name string.\n *\n * @example\n * cn('p-4', 'bg-red-500', { 'font-bold': true }); // => 'p-4 bg-red-500 font-bold'\n * cn('p-2', 'p-4'); // => 'p-4' (tailwind-merge resolves the conflict)\n *\n * @see https://github.com/dcastil/tailwind-merge\n * @see https://github.com/lukeed/clsx\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * @file This file contains a utility for performing a deep (recursive) merge of two objects.\n */\n\n/**\n * Checks if the provided item is a plain object (i.e., not null and not an array).\n *\n * @param {any} item - The item to check.\n * @returns {item is Record<string, any>} True if the item is a plain object, otherwise false.\n */\nconst isObject = (item: any): item is Record<string, any> => {\n return item && typeof item === 'object' && !Array.isArray(item);\n};\n\n/**\n * Recursively merges the properties of a source object into a target object.\n * This function creates a new object and does not mutate the original target.\n *\n * @template T - The type of the objects being merged.\n * @param {T} target - The base object.\n * @param {Partial<T>} source - The object with properties to merge into the target.\n * @returns {T} A new object representing the merged result.\n *\n * @example\n * const defaults = { a: 1, b: { c: 2, d: 3 } };\n * const custom = { b: { c: 99 } };\n * const result = deepMerge(defaults, custom);\n * // result will be { a: 1, b: { c: 99, d: 3 } }\n */\nexport function deepMerge<T extends object>(target: T, source: Partial<T>): T {\n // Start with a shallow copy of the target to avoid mutation.\n const output = { ...target };\n\n if (isObject(target) && isObject(source)) {\n // Iterate over the keys in the source object.\n Object.keys(source).forEach((key) => {\n const targetValue = target[key as keyof T];\n const sourceValue = source[key as keyof T];\n\n // If the value is an object in both target and source, merge them recursively.\n if (isObject(targetValue) && isObject(sourceValue)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n (output as Record<string, any>)[key] = deepMerge(targetValue, sourceValue);\n } else {\n // Otherwise, the source value overwrites the target value.\n (output as Record<string, any>)[key] = sourceValue;\n }\n });\n }\n\n return output;\n}\n","/**\n * @file This file contains a utility function for truncating a string with a center ellipsis.\n */\n\n/**\n * Truncates a string by showing a specified number of characters from the start and end,\n * with an ellipsis in the middle. If the string is too short to be truncated, it's returned as is.\n *\n * @param {string} str - The string to truncate.\n * @param {number} from - The number of characters to show from the beginning of the string.\n * @param {number} to - The number of characters to show from the end of the string.\n * @returns {string} The truncated string, or the original string if it's too short.\n *\n * @example\n * const hash = '0x1234567890abcdef1234567890abcdef';\n * textCenterEllipsis(hash, 6, 4); // => \"0x1234...cdef\"\n *\n * textCenterEllipsis('short', 6, 4); // => \"short\"\n */\nexport function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string {\n if (!str) {\n return '';\n }\n\n // If the string is short enough, don't truncate it.\n if (str.length <= from + to) {\n return str;\n }\n\n const start = str.slice(0, from);\n const end = str.slice(str.length - to);\n\n return `${start}...${end}`;\n}\n","import { AnimatePresence, motion } from 'framer-motion';\n\nimport { cn } from '../utils';\n\nexport function ChevronArrowWithAnim({\n className,\n strokeWidth,\n isOpen,\n}: {\n className?: string;\n strokeWidth?: number;\n isOpen?: boolean;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={strokeWidth ?? 2}\n stroke=\"currentColor\"\n className={cn('w-4 h-4 text-[var(--tuwa-text-secondary)]', className)}\n >\n <AnimatePresence>\n {isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n variants={{\n hidden: { translateY: 3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n\n <AnimatePresence>\n {!isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n className=\"relative\"\n variants={{\n hidden: { translateY: -3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n </svg>\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '../utils';\n\n/**\n * A reusable close button icon (X mark) styled with TUWA color scheme.\n */\nexport const CloseIcon = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGSVGElement>>(\n ({ className, ...props }, ref) => (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn('h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors', className)}\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n ),\n);\nCloseIcon.displayName = 'CloseIcon';\n","import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { AnimatePresence, motion, Variants } from 'framer-motion';\nimport * as React from 'react';\n\nimport { cn } from '../utils';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst defaultModalAnimation: Variants = {\n initial: { opacity: 0, scale: 0.9, y: 20 },\n animate: { opacity: 1, scale: 1, y: 0 },\n exit: {\n opacity: 0,\n scale: 0.9,\n transition: {\n duration: 0.2,\n },\n },\n};\n\nconst defaultModalBackdropAnimation: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n};\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> & {\n backdropAnimation?: Variants;\n }\n>(({ className, backdropAnimation, ...props }, ref) => (\n <AnimatePresence>\n <motion.div\n variants={backdropAnimation ?? defaultModalBackdropAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150', className)}\n {...props}\n />\n </motion.div>\n </AnimatePresence>\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n modalAnimation?: Variants;\n backdropAnimation?: Variants;\n }\n>(({ className, children, modalAnimation, backdropAnimation, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay backdropAnimation={backdropAnimation} />\n\n <DialogPrimitive.Content\n aria-describedby=\"tuwa:modal-content\"\n ref={ref}\n className={cn(\n 'fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none',\n className,\n )}\n {...props}\n >\n <motion.div\n layout\n className=\"relative overflow-hidden\"\n transition={{\n layout: {\n duration: 0.2,\n ease: [0.1, 0.1, 0.2, 1],\n },\n }}\n >\n <AnimatePresence>\n <motion.div\n variants={modalAnimation ?? defaultModalAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <div\n className={cn(\n 'relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl',\n 'border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]',\n )}\n >\n {children}\n </div>\n </motion.div>\n </AnimatePresence>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-header\"\n className={cn(\n 'sticky flex top-0 z-11 w-full flex-row items-center justify-between',\n 'border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-footer\"\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n aria-describedby=\"tuwa:modal-title\"\n className={cn('text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n aria-describedby=\"tuwa:modal-description\"\n ref={ref}\n className={cn('text-sm text-[var(--tuwa-text-secondary)]', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","import { useEffect, useMemo, useState } from 'react';\n\nexport function StarsBackground({ starsCount }: { starsCount?: number }) {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const stars = useMemo(() => {\n if (!isMounted) {\n return [];\n }\n\n const numStars = starsCount ?? 200;\n return Array.from({ length: numStars }).map(() => ({\n x: Math.random() * window.innerWidth,\n y: Math.random() * window.innerHeight,\n r: Math.random() * 1 + 0.5,\n isSupernova: Math.random() < 0.1,\n delay: Math.random() * 10,\n duration: 5 + Math.random() * 5,\n }));\n }, [isMounted]);\n\n return (\n <div className=\"absolute inset-0 z-1 h-full w-full overflow-hidden\">\n <svg width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <style>\n {`\n /* Pulse animation now includes scale for a more organic feel. */\n @keyframes pulse {\n 0%, 100% { \n opacity: 0.2;\n transform: scale(0.9);\n }\n 50% {\n opacity: 0.8;\n transform: scale(1.2);\n }\n }\n \n /* Supernova animation remains impactful. */\n @keyframes supernova {\n 0% { \n transform: scale(1);\n stroke: rgba(var(--tuwa-bg-primary), 0.5);\n opacity: 0.8;\n }\n 20% { \n transform: scale(3);\n stroke: var(--tuwa-button-gradient-from);\n opacity: 1;\n }\n 100% { \n transform: scale(0.8);\n stroke: var(--tuwa-button-gradient-to);\n opacity: 0;\n }\n }\n\n .pulsar {\n animation-name: pulse;\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n }\n\n .supernova {\n animation-name: supernova;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n stroke-width: 2;\n }\n `}\n </style>\n </defs>\n\n {stars.map((star, i) => (\n <circle\n key={i}\n cx={star.x}\n cy={star.y}\n r={star.r}\n fill={`rgba(var(--tuwa-bg-primary), 0.7)`}\n className={star.isSupernova ? 'supernova' : 'pulsar'}\n style={{\n animationDelay: `${star.delay}s`,\n animationDuration: `${star.duration}s`,\n }}\n />\n ))}\n </svg>\n </div>\n );\n}\n","/**\n * @file This file contains a custom React hook for copying text to the clipboard.\n */\n\nimport { useCallback, useState } from 'react';\n\n/**\n * A custom React hook that provides functionality to copy text to the clipboard.\n * It also manages a \"copied\" state with a timeout for user feedback.\n *\n * @param {number} [timeout=2000] - The duration in milliseconds to keep the `isCopied` state as true.\n * @returns {{\n * isCopied: boolean;\n * copy: (text: string) => Promise<void>;\n * error: Error | null;\n * }} An object containing the `isCopied` state, the `copy` function, and any potential error.\n *\n * @example\n * const MyComponent = () => {\n * const { isCopied, copy } = useCopyToClipboard();\n * const textToCopy = '0x123...';\n *\n * return (\n * <button onClick={() => copy(textToCopy)}>\n * {isCopied ? 'Copied!' : 'Copy Address'}\n * </button>\n * );\n * }\n */\nexport function useCopyToClipboard(timeout = 2000): {\n isCopied: boolean;\n copy: (text: string) => Promise<void>;\n error: Error | null;\n} {\n const [isCopied, setIsCopied] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const copy = useCallback(\n async (text: string) => {\n if (!text) return;\n\n try {\n await navigator.clipboard.writeText(text);\n setIsCopied(true);\n setError(null);\n\n setTimeout(() => setIsCopied(false), timeout);\n } catch (e) {\n const copyError = e instanceof Error ? e : new Error('Failed to copy text.');\n console.error(copyError);\n setError(copyError);\n\n // Reset error state after timeout as well\n setTimeout(() => setError(null), timeout);\n }\n },\n [timeout],\n );\n\n return { isCopied, copy, error };\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * A custom hook to detect if a media query matches the current screen dimensions.\n * Handles SSR gracefully.\n * @param {string} query - The media query string (e.g., '(max-width: 767px)').\n * @returns {boolean} Whether the query matches or not.\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatches = (q: string): boolean => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(q).matches;\n }\n return false;\n };\n\n const [matches, setMatches] = useState<boolean>(getMatches(query));\n\n useEffect(() => {\n const media = window.matchMedia(query);\n const listener = () => setMatches(media.matches);\n\n // Re-check on mount and subscribe to changes\n listener();\n window.addEventListener('resize', listener);\n\n return () => window.removeEventListener('resize', listener);\n }, [query]);\n\n return matches;\n}\n"]}
package/dist/index.css CHANGED
@@ -74,6 +74,9 @@
74
74
  .transform {
75
75
  transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
76
76
  }
77
+ .cursor-pointer {
78
+ cursor: pointer;
79
+ }
77
80
  .resize {
78
81
  resize: both;
79
82
  }
@@ -92,6 +95,9 @@
92
95
  .justify-between {
93
96
  justify-content: space-between;
94
97
  }
98
+ .gap-1 {
99
+ gap: calc(0.25rem * 1);
100
+ }
95
101
  .gap-3 {
96
102
  gap: calc(0.25rem * 3);
97
103
  }
@@ -106,6 +112,9 @@
106
112
  .overflow-y-auto {
107
113
  overflow-y: auto;
108
114
  }
115
+ .rounded-md {
116
+ border-radius: 0.375rem;
117
+ }
109
118
  .rounded-t-2xl {
110
119
  border-top-left-radius: 1rem;
111
120
  border-top-right-radius: 1rem;
@@ -127,6 +136,9 @@
127
136
  .bg-\[var\(--tuwa-color-primary\)\] {
128
137
  background-color: var(--tuwa-color-primary);
129
138
  }
139
+ .bg-\[var\(--tuwa-standart-button-bg\)\] {
140
+ background-color: var(--tuwa-standart-button-bg);
141
+ }
130
142
  .bg-black\/55 {
131
143
  background-color: color-mix(in oklab, #000 55%, transparent);
132
144
  }
@@ -145,6 +157,12 @@
145
157
  .p-\[var\(--tuwa-spacing-md\)\] {
146
158
  padding: var(--tuwa-spacing-md);
147
159
  }
160
+ .px-3 {
161
+ padding-inline: calc(0.25rem * 3);
162
+ }
163
+ .py-2 {
164
+ padding-block: calc(0.25rem * 2);
165
+ }
148
166
  .text-lg {
149
167
  font-size: 1.125rem;
150
168
  line-height: var(--tw-leading, calc(1.75 / 1.125));
@@ -161,6 +179,10 @@
161
179
  --tw-font-weight: 700;
162
180
  font-weight: 700;
163
181
  }
182
+ .font-semibold {
183
+ --tw-font-weight: 600;
184
+ font-weight: 600;
185
+ }
164
186
  .tracking-tight {
165
187
  --tw-tracking: -0.025em;
166
188
  letter-spacing: -0.025em;
@@ -200,6 +222,23 @@
200
222
  --tw-outline-style: none;
201
223
  outline-style: none;
202
224
  }
225
+ .hover\:bg-\[var\(--tuwa-standart-button-hover\)\] {
226
+ &:hover {
227
+ @media (hover: hover) {
228
+ background-color: var(--tuwa-standart-button-hover);
229
+ }
230
+ }
231
+ }
232
+ .disabled\:cursor-not-allowed {
233
+ &:disabled {
234
+ cursor: not-allowed;
235
+ }
236
+ }
237
+ .disabled\:opacity-50 {
238
+ &:disabled {
239
+ opacity: 50%;
240
+ }
241
+ }
203
242
  .sm\:top-\[50\%\] {
204
243
  @media (width >= 40rem) {
205
244
  top: 50%;
@@ -284,6 +323,8 @@
284
323
  --tuwa-button-gradient-to: oklch(55.8% 0.288 302.321);
285
324
  --tuwa-button-gradient-from-hover: oklch(48.8% 0.243 264.376);
286
325
  --tuwa-button-gradient-to-hover: oklch(49.6% 0.265 301.924);
326
+ --tuwa-standart-button-bg: oklch(96.7% 0.003 264.542);
327
+ --tuwa-standart-button-hover: oklch(92.8% 0.006 264.531);
287
328
  }
288
329
  .dark {
289
330
  --tuwa-success-bg: oklch(39.3% 0.095 152.535);
@@ -312,6 +353,8 @@
312
353
  --tuwa-button-gradient-to: oklch(62.7% 0.265 303.9);
313
354
  --tuwa-button-gradient-from-hover: oklch(54.6% 0.245 262.881);
314
355
  --tuwa-button-gradient-to-hover: oklch(55.8% 0.288 302.321);
356
+ --tuwa-standart-button-bg: oklch(37.3% 0.034 259.733);
357
+ --tuwa-standart-button-hover: oklch(27.8% 0.033 256.848);
315
358
  }
316
359
  @property --tw-rotate-x {
317
360
  syntax: "*";
package/dist/index.d.cts CHANGED
@@ -81,6 +81,8 @@ declare function useCopyToClipboard(timeout?: number): {
81
81
  */
82
82
  declare function useMediaQuery(query: string): boolean;
83
83
 
84
+ declare const standardButtonClasses = "cursor-pointer rounded-md bg-[var(--tuwa-standart-button-bg)] px-3 py-2 flex items-center gap-1 text-sm font-semibold text-[var(--tuwa-text-primary)] transition-colors hover:bg-[var(--tuwa-standart-button-hover)] disabled:cursor-not-allowed disabled:opacity-50";
85
+
84
86
  /**
85
87
  * @file This file contains a utility function for conditionally merging Tailwind CSS classes.
86
88
  */
@@ -144,4 +146,4 @@ declare function deepMerge<T extends object>(target: T, source: Partial<T>): T;
144
146
  */
145
147
  declare function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string;
146
148
 
147
- export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, StarsBackground, cn, deepMerge, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
149
+ export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, StarsBackground, cn, deepMerge, standardButtonClasses, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
package/dist/index.d.ts CHANGED
@@ -81,6 +81,8 @@ declare function useCopyToClipboard(timeout?: number): {
81
81
  */
82
82
  declare function useMediaQuery(query: string): boolean;
83
83
 
84
+ declare const standardButtonClasses = "cursor-pointer rounded-md bg-[var(--tuwa-standart-button-bg)] px-3 py-2 flex items-center gap-1 text-sm font-semibold text-[var(--tuwa-text-primary)] transition-colors hover:bg-[var(--tuwa-standart-button-hover)] disabled:cursor-not-allowed disabled:opacity-50";
85
+
84
86
  /**
85
87
  * @file This file contains a utility function for conditionally merging Tailwind CSS classes.
86
88
  */
@@ -144,4 +146,4 @@ declare function deepMerge<T extends object>(target: T, source: Partial<T>): T;
144
146
  */
145
147
  declare function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string;
146
148
 
147
- export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, StarsBackground, cn, deepMerge, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
149
+ export { ChevronArrowWithAnim, CloseIcon, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, StarsBackground, cn, deepMerge, standardButtonClasses, textCenterEllipsis, useCopyToClipboard, useMediaQuery };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import {AnimatePresence,motion}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';import*as m from'react';import {useState,useEffect,useMemo,useCallback}from'react';import*as o from'@radix-ui/react-dialog';function l(...e){return twMerge(clsx(e))}var c=e=>e&&typeof e=="object"&&!Array.isArray(e);function C(e,t){let i={...e};return c(e)&&c(t)&&Object.keys(t).forEach(r=>{let a=e[r],n=t[r];c(a)&&c(n)?i[r]=C(a,n):i[r]=n;}),i}function X(e,t,i){if(!e)return "";if(e.length<=t+i)return e;let r=e.slice(0,t),a=e.slice(e.length-i);return `${r}...${a}`}function oe({className:e,strokeWidth:t,isOpen:i}){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:t??2,stroke:"currentColor",className:l("w-4 h-4 text-[var(--tuwa-text-secondary)]",e),children:[jsx(AnimatePresence,{children:i&&jsx(motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5",variants:{hidden:{translateY:3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})}),jsx(AnimatePresence,{children:!i&&jsx(motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5",className:"relative",variants:{hidden:{translateY:-3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})})]})}var M=m.forwardRef(({className:e,...t},i)=>jsxs("svg",{ref:i,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors",e),...t,children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]}));M.displayName="CloseIcon";var ue=o.Root,fe=o.Trigger,A=o.Portal,ve=o.Close,E={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},V={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},D=m.forwardRef(({className:e,backdropAnimation:t,...i},r)=>jsx(AnimatePresence,{children:jsx(motion.div,{variants:t??V,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsx(o.Overlay,{ref:r,className:l("fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150",e),...i})})}));D.displayName=o.Overlay.displayName;var S=m.forwardRef(({className:e,children:t,modalAnimation:i,backdropAnimation:r,...a},n)=>jsxs(A,{children:[jsx(D,{backdropAnimation:r}),jsx(o.Content,{"aria-describedby":"tuwa:modal-content",ref:n,className:l("fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none",e),...a,children:jsx(motion.div,{layout:true,className:"relative overflow-hidden",transition:{layout:{duration:.2,ease:[.1,.1,.2,1]}},children:jsx(AnimatePresence,{children:jsx(motion.div,{variants:i??E,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsx("div",{className:l("relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl","border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]"),children:t})})})})})]}));S.displayName=o.Content.displayName;var L=({className:e,...t})=>jsx("div",{"aria-describedby":"tuwa:modal-header",className:l("sticky flex top-0 z-11 w-full flex-row items-center justify-between","border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4",e),...t});L.displayName="DialogHeader";var O=({className:e,...t})=>jsx("div",{"aria-describedby":"tuwa:modal-footer",className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O.displayName="DialogFooter";var W=m.forwardRef(({className:e,...t},i)=>jsx(o.Title,{ref:i,"aria-describedby":"tuwa:modal-title",className:l("text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0",e),...t}));W.displayName=o.Title.displayName;var Y=m.forwardRef(({className:e,...t},i)=>jsx(o.Description,{"aria-describedby":"tuwa:modal-description",ref:i,className:l("text-sm text-[var(--tuwa-text-secondary)]",e),...t}));Y.displayName=o.Description.displayName;function be({starsCount:e}){let[t,i]=useState(false);useEffect(()=>i(true),[]);let r=useMemo(()=>{if(!t)return [];let a=e??200;return Array.from({length:a}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5}))},[t]);return jsx("div",{className:"absolute inset-0 z-1 h-full w-full overflow-hidden",children:jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsx("defs",{children:jsx("style",{children:`
1
+ import {AnimatePresence,motion}from'framer-motion';import {clsx}from'clsx';import {twMerge}from'tailwind-merge';import {jsxs,jsx}from'react/jsx-runtime';import*as m from'react';import {useState,useEffect,useMemo,useCallback}from'react';import*as o from'@radix-ui/react-dialog';var Q="cursor-pointer rounded-md bg-[var(--tuwa-standart-button-bg)] px-3 py-2 flex items-center gap-1 text-sm font-semibold text-[var(--tuwa-text-primary)] transition-colors hover:bg-[var(--tuwa-standart-button-hover)] disabled:cursor-not-allowed disabled:opacity-50";function l(...e){return twMerge(clsx(e))}var c=e=>e&&typeof e=="object"&&!Array.isArray(e);function C(e,t){let a={...e};return c(e)&&c(t)&&Object.keys(t).forEach(r=>{let i=e[r],n=t[r];c(i)&&c(n)?a[r]=C(i,n):a[r]=n;}),a}function _(e,t,a){if(!e)return "";if(e.length<=t+a)return e;let r=e.slice(0,t),i=e.slice(e.length-a);return `${r}...${i}`}function se({className:e,strokeWidth:t,isOpen:a}){return jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:t??2,stroke:"currentColor",className:l("w-4 h-4 text-[var(--tuwa-text-secondary)]",e),children:[jsx(AnimatePresence,{children:a&&jsx(motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5",variants:{hidden:{translateY:3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})}),jsx(AnimatePresence,{children:!a&&jsx(motion.path,{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5",className:"relative",variants:{hidden:{translateY:-3,scaleY:.8,opacity:0},visible:{translateY:0,scaleY:1,opacity:1}},initial:"hidden",animate:"visible",transition:{duration:.4}})})]})}var M=m.forwardRef(({className:e,...t},a)=>jsxs("svg",{ref:a,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors",e),...t,children:[jsx("path",{d:"M18 6 6 18"}),jsx("path",{d:"m6 6 12 12"})]}));M.displayName="CloseIcon";var ge=o.Root,ye=o.Trigger,A=o.Portal,we=o.Close,E={initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,transition:{duration:.2}}},V={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0}},D=m.forwardRef(({className:e,backdropAnimation:t,...a},r)=>jsx(AnimatePresence,{children:jsx(motion.div,{variants:t??V,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsx(o.Overlay,{ref:r,className:l("fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150",e),...a})})}));D.displayName=o.Overlay.displayName;var S=m.forwardRef(({className:e,children:t,modalAnimation:a,backdropAnimation:r,...i},n)=>jsxs(A,{children:[jsx(D,{backdropAnimation:r}),jsx(o.Content,{"aria-describedby":"tuwa:modal-content",ref:n,className:l("fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none",e),...i,children:jsx(motion.div,{layout:true,className:"relative overflow-hidden",transition:{layout:{duration:.2,ease:[.1,.1,.2,1]}},children:jsx(AnimatePresence,{children:jsx(motion.div,{variants:a??E,transition:{duration:.2,ease:"easeInOut"},animate:"animate",initial:"initial",exit:"exit",className:"relative rounded-t-2xl sm:rounded-2xl overflow-hidden",children:jsx("div",{className:l("relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl","border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]"),children:t})})})})})]}));S.displayName=o.Content.displayName;var L=({className:e,...t})=>jsx("div",{"aria-describedby":"tuwa:modal-header",className:l("sticky flex top-0 z-11 w-full flex-row items-center justify-between","border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4",e),...t});L.displayName="DialogHeader";var O=({className:e,...t})=>jsx("div",{"aria-describedby":"tuwa:modal-footer",className:l("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});O.displayName="DialogFooter";var W=m.forwardRef(({className:e,...t},a)=>jsx(o.Title,{ref:a,"aria-describedby":"tuwa:modal-title",className:l("text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0",e),...t}));W.displayName=o.Title.displayName;var Y=m.forwardRef(({className:e,...t},a)=>jsx(o.Description,{"aria-describedby":"tuwa:modal-description",ref:a,className:l("text-sm text-[var(--tuwa-text-secondary)]",e),...t}));Y.displayName=o.Description.displayName;function De({starsCount:e}){let[t,a]=useState(false);useEffect(()=>a(true),[]);let r=useMemo(()=>{if(!t)return [];let i=e??200;return Array.from({length:i}).map(()=>({x:Math.random()*window.innerWidth,y:Math.random()*window.innerHeight,r:Math.random()*1+.5,isSupernova:Math.random()<.1,delay:Math.random()*10,duration:5+Math.random()*5}))},[t]);return jsx("div",{className:"absolute inset-0 z-1 h-full w-full overflow-hidden",children:jsxs("svg",{width:"100%",height:"100%",xmlns:"http://www.w3.org/2000/svg",children:[jsx("defs",{children:jsx("style",{children:`
2
2
  /* Pulse animation now includes scale for a more organic feel. */
3
3
  @keyframes pulse {
4
4
  0%, 100% {
@@ -44,5 +44,5 @@ import {AnimatePresence,motion}from'framer-motion';import {clsx}from'clsx';impor
44
44
  transform-origin: center;
45
45
  stroke-width: 2;
46
46
  }
47
- `})}),r.map((a,n)=>jsx("circle",{cx:a.x,cy:a.y,r:a.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:a.isSupernova?"supernova":"pulsar",style:{animationDelay:`${a.delay}s`,animationDuration:`${a.duration}s`}},n))]})})}function Pe(e=2e3){let[t,i]=useState(false),[r,a]=useState(null),n=useCallback(async f=>{if(f)try{await navigator.clipboard.writeText(f),i(!0),a(null),setTimeout(()=>i(!1),e);}catch(v){let g=v instanceof Error?v:new Error("Failed to copy text.");console.error(g),a(g),setTimeout(()=>a(null),e);}},[e]);return {isCopied:t,copy:n,error:r}}function Ce(e){let t=a=>typeof window<"u"?window.matchMedia(a).matches:false,[i,r]=useState(t(e));return useEffect(()=>{let a=window.matchMedia(e),n=()=>r(a.matches);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),i}export{oe as ChevronArrowWithAnim,M as CloseIcon,ue as Dialog,ve as DialogClose,S as DialogContent,Y as DialogDescription,O as DialogFooter,L as DialogHeader,D as DialogOverlay,A as DialogPortal,W as DialogTitle,fe as DialogTrigger,be as StarsBackground,l as cn,C as deepMerge,X as textCenterEllipsis,Pe as useCopyToClipboard,Ce as useMediaQuery};//# sourceMappingURL=index.js.map
47
+ `})}),r.map((i,n)=>jsx("circle",{cx:i.x,cy:i.y,r:i.r,fill:"rgba(var(--tuwa-bg-primary), 0.7)",className:i.isSupernova?"supernova":"pulsar",style:{animationDelay:`${i.delay}s`,animationDuration:`${i.duration}s`}},n))]})})}function Ce(e=2e3){let[t,a]=useState(false),[r,i]=useState(null),n=useCallback(async f=>{if(f)try{await navigator.clipboard.writeText(f),a(!0),i(null),setTimeout(()=>a(!1),e);}catch(v){let g=v instanceof Error?v:new Error("Failed to copy text.");console.error(g),i(g),setTimeout(()=>i(null),e);}},[e]);return {isCopied:t,copy:n,error:r}}function Te(e){let t=i=>typeof window<"u"?window.matchMedia(i).matches:false,[a,r]=useState(t(e));return useEffect(()=>{let i=window.matchMedia(e),n=()=>r(i.matches);return n(),window.addEventListener("resize",n),()=>window.removeEventListener("resize",n)},[e]),a}export{se as ChevronArrowWithAnim,M as CloseIcon,ge as Dialog,we as DialogClose,S as DialogContent,Y as DialogDescription,O as DialogFooter,L as DialogHeader,D as DialogOverlay,A as DialogPortal,W as DialogTitle,ye as DialogTrigger,De as StarsBackground,l as cn,C as deepMerge,Q as standardButtonClasses,_ as textCenterEllipsis,Ce as useCopyToClipboard,Te as useMediaQuery};//# sourceMappingURL=index.js.map
48
48
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/cn.ts","../src/utils/deepMerge.ts","../src/utils/textCenterEllipsis.ts","../src/components/ChevronArrowWithAnim.tsx","../src/components/CloseIcon.tsx","../src/components/Modal.tsx","../src/components/StarsBackground.tsx","../src/hooks/useCopyToClipboard.ts","../src/hooks/useMediaQuery.ts"],"names":["cn","inputs","twMerge","clsx","isObject","item","deepMerge","target","source","output","key","targetValue","sourceValue","textCenterEllipsis","str","from","to","start","end","ChevronArrowWithAnim","className","strokeWidth","isOpen","jsxs","jsx","AnimatePresence","motion","CloseIcon","x","props","ref","Dialog","DialogTrigger","DialogPortal","DialogClose","defaultModalAnimation","defaultModalBackdropAnimation","DialogOverlay","backdropAnimation","DialogContent","children","modalAnimation","DialogHeader","DialogFooter","DialogTitle","DialogDescription","StarsBackground","starsCount","isMounted","setIsMounted","useState","useEffect","stars","useMemo","numStars","star","i","useCopyToClipboard","timeout","isCopied","setIsCopied","error","setError","copy","useCallback","text","e","copyError","useMediaQuery","query","getMatches","q","matches","setMatches","media","listener"],"mappings":"qRAwBO,SAASA,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CChBA,IAAMG,CAAAA,CAAYC,GACTA,CAAAA,EAAQ,OAAOA,GAAS,QAAA,EAAY,CAAC,MAAM,OAAA,CAAQA,CAAI,EAkBzD,SAASC,CAAA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M,sBAAsB,EAC3E,OAAA,CAAQ,KAAA,CAAMC,CAAS,CAAA,CACvBL,CAAAA,CAASK,CAAS,EAGlB,UAAA,CAAW,IAAML,EAAS,IAAI,CAAA,CAAGJ,CAAO,EAC1C,CACF,CAAA,CACA,CAACA,CAAO,CACV,EAEA,OAAO,CAAE,SAAAC,CAAAA,CAAU,IAAA,CAAAI,EAAM,KAAA,CAAAF,CAAM,CACjC,CCpDO,SAASO,EAAAA,CAAcC,EAAwB,CACpD,IAAMC,CAAAA,CAAcC,CAAAA,EACd,OAAO,MAAA,CAAW,IACb,MAAA,CAAO,UAAA,CAAWA,CAAC,CAAA,CAAE,OAAA,CAEvB,MAGH,CAACC,CAAAA,CAASC,CAAU,CAAA,CAAIvB,QAAAA,CAAkBoB,CAAAA,CAAWD,CAAK,CAAC,CAAA,CAEjE,OAAAlB,SAAAA,CAAU,IAAM,CACd,IAAMuB,CAAAA,CAAQ,MAAA,CAAO,UAAA,CAAWL,CAAK,CAAA,CAC/BM,EAAW,IAAMF,CAAAA,CAAWC,EAAM,OAAO,CAAA,CAG/C,OAAAC,CAAAA,EAAS,CACT,MAAA,CAAO,gBAAA,CAAiB,QAAA,CAAUA,CAAQ,EAEnC,IAAM,MAAA,CAAO,mBAAA,CAAoB,QAAA,CAAUA,CAAQ,CAC5D,EAAG,CAACN,CAAK,CAAC,CAAA,CAEHG,CACT","file":"index.js","sourcesContent":["/**\n * @file This file contains a utility function for conditionally merging Tailwind CSS classes.\n */\n\nimport { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * A utility function to conditionally join class names together and resolve\n * conflicting Tailwind CSS classes.\n *\n * It combines the functionality of `clsx` and `tailwind-merge`.\n *\n * @param {...ClassValue[]} inputs - A list of class values to be combined.\n * This can include strings, numbers, objects, arrays, and booleans.\n * @returns {string} The final, merged class name string.\n *\n * @example\n * cn('p-4', 'bg-red-500', { 'font-bold': true }); // => 'p-4 bg-red-500 font-bold'\n * cn('p-2', 'p-4'); // => 'p-4' (tailwind-merge resolves the conflict)\n *\n * @see https://github.com/dcastil/tailwind-merge\n * @see https://github.com/lukeed/clsx\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * @file This file contains a utility for performing a deep (recursive) merge of two objects.\n */\n\n/**\n * Checks if the provided item is a plain object (i.e., not null and not an array).\n *\n * @param {any} item - The item to check.\n * @returns {item is Record<string, any>} True if the item is a plain object, otherwise false.\n */\nconst isObject = (item: any): item is Record<string, any> => {\n return item && typeof item === 'object' && !Array.isArray(item);\n};\n\n/**\n * Recursively merges the properties of a source object into a target object.\n * This function creates a new object and does not mutate the original target.\n *\n * @template T - The type of the objects being merged.\n * @param {T} target - The base object.\n * @param {Partial<T>} source - The object with properties to merge into the target.\n * @returns {T} A new object representing the merged result.\n *\n * @example\n * const defaults = { a: 1, b: { c: 2, d: 3 } };\n * const custom = { b: { c: 99 } };\n * const result = deepMerge(defaults, custom);\n * // result will be { a: 1, b: { c: 99, d: 3 } }\n */\nexport function deepMerge<T extends object>(target: T, source: Partial<T>): T {\n // Start with a shallow copy of the target to avoid mutation.\n const output = { ...target };\n\n if (isObject(target) && isObject(source)) {\n // Iterate over the keys in the source object.\n Object.keys(source).forEach((key) => {\n const targetValue = target[key as keyof T];\n const sourceValue = source[key as keyof T];\n\n // If the value is an object in both target and source, merge them recursively.\n if (isObject(targetValue) && isObject(sourceValue)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n (output as Record<string, any>)[key] = deepMerge(targetValue, sourceValue);\n } else {\n // Otherwise, the source value overwrites the target value.\n (output as Record<string, any>)[key] = sourceValue;\n }\n });\n }\n\n return output;\n}\n","/**\n * @file This file contains a utility function for truncating a string with a center ellipsis.\n */\n\n/**\n * Truncates a string by showing a specified number of characters from the start and end,\n * with an ellipsis in the middle. If the string is too short to be truncated, it's returned as is.\n *\n * @param {string} str - The string to truncate.\n * @param {number} from - The number of characters to show from the beginning of the string.\n * @param {number} to - The number of characters to show from the end of the string.\n * @returns {string} The truncated string, or the original string if it's too short.\n *\n * @example\n * const hash = '0x1234567890abcdef1234567890abcdef';\n * textCenterEllipsis(hash, 6, 4); // => \"0x1234...cdef\"\n *\n * textCenterEllipsis('short', 6, 4); // => \"short\"\n */\nexport function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string {\n if (!str) {\n return '';\n }\n\n // If the string is short enough, don't truncate it.\n if (str.length <= from + to) {\n return str;\n }\n\n const start = str.slice(0, from);\n const end = str.slice(str.length - to);\n\n return `${start}...${end}`;\n}\n","import { AnimatePresence, motion } from 'framer-motion';\n\nimport { cn } from '../utils';\n\nexport function ChevronArrowWithAnim({\n className,\n strokeWidth,\n isOpen,\n}: {\n className?: string;\n strokeWidth?: number;\n isOpen?: boolean;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={strokeWidth ?? 2}\n stroke=\"currentColor\"\n className={cn('w-4 h-4 text-[var(--tuwa-text-secondary)]', className)}\n >\n <AnimatePresence>\n {isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n variants={{\n hidden: { translateY: 3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n\n <AnimatePresence>\n {!isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n className=\"relative\"\n variants={{\n hidden: { translateY: -3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n </svg>\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '../utils';\n\n/**\n * A reusable close button icon (X mark) styled with TUWA color scheme.\n */\nexport const CloseIcon = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGSVGElement>>(\n ({ className, ...props }, ref) => (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn('h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors', className)}\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n ),\n);\nCloseIcon.displayName = 'CloseIcon';\n","import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { AnimatePresence, motion, Variants } from 'framer-motion';\nimport * as React from 'react';\n\nimport { cn } from '../utils';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst defaultModalAnimation: Variants = {\n initial: { opacity: 0, scale: 0.9, y: 20 },\n animate: { opacity: 1, scale: 1, y: 0 },\n exit: {\n opacity: 0,\n scale: 0.9,\n transition: {\n duration: 0.2,\n },\n },\n};\n\nconst defaultModalBackdropAnimation: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n};\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> & {\n backdropAnimation?: Variants;\n }\n>(({ className, backdropAnimation, ...props }, ref) => (\n <AnimatePresence>\n <motion.div\n variants={backdropAnimation ?? defaultModalBackdropAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150', className)}\n {...props}\n />\n </motion.div>\n </AnimatePresence>\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n modalAnimation?: Variants;\n backdropAnimation?: Variants;\n }\n>(({ className, children, modalAnimation, backdropAnimation, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay backdropAnimation={backdropAnimation} />\n\n <DialogPrimitive.Content\n aria-describedby=\"tuwa:modal-content\"\n ref={ref}\n className={cn(\n 'fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none',\n className,\n )}\n {...props}\n >\n <motion.div\n layout\n className=\"relative overflow-hidden\"\n transition={{\n layout: {\n duration: 0.2,\n ease: [0.1, 0.1, 0.2, 1],\n },\n }}\n >\n <AnimatePresence>\n <motion.div\n variants={modalAnimation ?? defaultModalAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <div\n className={cn(\n 'relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl',\n 'border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]',\n )}\n >\n {children}\n </div>\n </motion.div>\n </AnimatePresence>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-header\"\n className={cn(\n 'sticky flex top-0 z-11 w-full flex-row items-center justify-between',\n 'border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-footer\"\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n aria-describedby=\"tuwa:modal-title\"\n className={cn('text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n aria-describedby=\"tuwa:modal-description\"\n ref={ref}\n className={cn('text-sm text-[var(--tuwa-text-secondary)]', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","import { useEffect, useMemo, useState } from 'react';\n\nexport function StarsBackground({ starsCount }: { starsCount?: number }) {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const stars = useMemo(() => {\n if (!isMounted) {\n return [];\n }\n\n const numStars = starsCount ?? 200;\n return Array.from({ length: numStars }).map(() => ({\n x: Math.random() * window.innerWidth,\n y: Math.random() * window.innerHeight,\n r: Math.random() * 1 + 0.5,\n isSupernova: Math.random() < 0.1,\n delay: Math.random() * 10,\n duration: 5 + Math.random() * 5,\n }));\n }, [isMounted]);\n\n return (\n <div className=\"absolute inset-0 z-1 h-full w-full overflow-hidden\">\n <svg width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <style>\n {`\n /* Pulse animation now includes scale for a more organic feel. */\n @keyframes pulse {\n 0%, 100% { \n opacity: 0.2;\n transform: scale(0.9);\n }\n 50% {\n opacity: 0.8;\n transform: scale(1.2);\n }\n }\n \n /* Supernova animation remains impactful. */\n @keyframes supernova {\n 0% { \n transform: scale(1);\n stroke: rgba(var(--tuwa-bg-primary), 0.5);\n opacity: 0.8;\n }\n 20% { \n transform: scale(3);\n stroke: var(--tuwa-button-gradient-from);\n opacity: 1;\n }\n 100% { \n transform: scale(0.8);\n stroke: var(--tuwa-button-gradient-to);\n opacity: 0;\n }\n }\n\n .pulsar {\n animation-name: pulse;\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n }\n\n .supernova {\n animation-name: supernova;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n stroke-width: 2;\n }\n `}\n </style>\n </defs>\n\n {stars.map((star, i) => (\n <circle\n key={i}\n cx={star.x}\n cy={star.y}\n r={star.r}\n fill={`rgba(var(--tuwa-bg-primary), 0.7)`}\n className={star.isSupernova ? 'supernova' : 'pulsar'}\n style={{\n animationDelay: `${star.delay}s`,\n animationDuration: `${star.duration}s`,\n }}\n />\n ))}\n </svg>\n </div>\n );\n}\n","/**\n * @file This file contains a custom React hook for copying text to the clipboard.\n */\n\nimport { useCallback, useState } from 'react';\n\n/**\n * A custom React hook that provides functionality to copy text to the clipboard.\n * It also manages a \"copied\" state with a timeout for user feedback.\n *\n * @param {number} [timeout=2000] - The duration in milliseconds to keep the `isCopied` state as true.\n * @returns {{\n * isCopied: boolean;\n * copy: (text: string) => Promise<void>;\n * error: Error | null;\n * }} An object containing the `isCopied` state, the `copy` function, and any potential error.\n *\n * @example\n * const MyComponent = () => {\n * const { isCopied, copy } = useCopyToClipboard();\n * const textToCopy = '0x123...';\n *\n * return (\n * <button onClick={() => copy(textToCopy)}>\n * {isCopied ? 'Copied!' : 'Copy Address'}\n * </button>\n * );\n * }\n */\nexport function useCopyToClipboard(timeout = 2000): {\n isCopied: boolean;\n copy: (text: string) => Promise<void>;\n error: Error | null;\n} {\n const [isCopied, setIsCopied] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const copy = useCallback(\n async (text: string) => {\n if (!text) return;\n\n try {\n await navigator.clipboard.writeText(text);\n setIsCopied(true);\n setError(null);\n\n setTimeout(() => setIsCopied(false), timeout);\n } catch (e) {\n const copyError = e instanceof Error ? e : new Error('Failed to copy text.');\n console.error(copyError);\n setError(copyError);\n\n // Reset error state after timeout as well\n setTimeout(() => setError(null), timeout);\n }\n },\n [timeout],\n );\n\n return { isCopied, copy, error };\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * A custom hook to detect if a media query matches the current screen dimensions.\n * Handles SSR gracefully.\n * @param {string} query - The media query string (e.g., '(max-width: 767px)').\n * @returns {boolean} Whether the query matches or not.\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatches = (q: string): boolean => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(q).matches;\n }\n return false;\n };\n\n const [matches, setMatches] = useState<boolean>(getMatches(query));\n\n useEffect(() => {\n const media = window.matchMedia(query);\n const listener = () => setMatches(media.matches);\n\n // Re-check on mount and subscribe to changes\n listener();\n window.addEventListener('resize', listener);\n\n return () => window.removeEventListener('resize', listener);\n }, [query]);\n\n return matches;\n}\n"]}
1
+ {"version":3,"sources":["../src/utils/classes.ts","../src/utils/cn.ts","../src/utils/deepMerge.ts","../src/utils/textCenterEllipsis.ts","../src/components/ChevronArrowWithAnim.tsx","../src/components/CloseIcon.tsx","../src/components/Modal.tsx","../src/components/StarsBackground.tsx","../src/hooks/useCopyToClipboard.ts","../src/hooks/useMediaQuery.ts"],"names":["standardButtonClasses","cn","inputs","twMerge","clsx","isObject","item","deepMerge","target","source","output","key","targetValue","sourceValue","textCenterEllipsis","str","from","to","start","end","ChevronArrowWithAnim","className","strokeWidth","isOpen","jsxs","jsx","AnimatePresence","motion","CloseIcon","x","props","ref","Dialog","DialogTrigger","DialogPortal","DialogClose","defaultModalAnimation","defaultModalBackdropAnimation","DialogOverlay","backdropAnimation","DialogContent","children","modalAnimation","DialogHeader","DialogFooter","DialogTitle","DialogDescription","StarsBackground","starsCount","isMounted","setIsMounted","useState","useEffect","stars","useMemo","numStars","star","i","useCopyToClipboard","timeout","isCopied","setIsCopied","error","setError","copy","useCallback","text","e","copyError","useMediaQuery","query","getMatches","q","matches","setMatches","media","listener"],"mappings":"qRAAO,IAAMA,CAAAA,CACX,uQCuBK,SAASC,CAAAA,CAAAA,GAAMC,CAAAA,CAA8B,CAClD,OAAOC,OAAAA,CAAQC,IAAAA,CAAKF,CAAM,CAAC,CAC7B,CChBA,IAAMG,CAAAA,CAAYC,GACTA,CAAAA,EAAQ,OAAOA,CAAAA,EAAS,QAAA,EAAY,CAAC,KAAA,CAAM,QAAQA,CAAI,CAAA,CAkBzD,SAASC,CAAAA,CAA4BC,CAAAA,CAAWC,EAAuB,CAE5E,IAAMC,CAAAA,CAAS,CAAE,GAAGF,CAAO,EAE3B,OAAIH,CAAAA,CAASG,CAAM,CAAA,EAAKH,CAAAA,CAASI,CAAM,CAAA,EAErC,MAAA,CAAO,KAAKA,CAAM,CAAA,CAAE,QAASE,CAAAA,EAAQ,CACnC,IAAMC,CAAAA,CAAcJ,CAAAA,CAAOG,CAAc,CAAA,CACnCE,CAAAA,CAAcJ,CAAAA,CAAOE,CAAc,CAAA,CAGrCN,CAAAA,CAASO,CAAW,CAAA,EAAKP,CAAAA,CAASQ,CAAW,CAAA,CAG9CH,CAAAA,CAA+BC,CAAG,CAAA,CAAIJ,CAAAA,CAAUK,CAAAA,CAAaC,CAAW,CAAA,CAGxEH,CA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A,CAAC,CAAA,CAAE,OAAA,CAEvB,MAGH,CAACC,CAAAA,CAASC,CAAU,CAAA,CAAIvB,QAAAA,CAAkBoB,CAAAA,CAAWD,CAAK,CAAC,CAAA,CAEjE,OAAAlB,SAAAA,CAAU,IAAM,CACd,IAAMuB,CAAAA,CAAQ,MAAA,CAAO,UAAA,CAAWL,CAAK,CAAA,CAC/BM,EAAW,IAAMF,CAAAA,CAAWC,EAAM,OAAO,CAAA,CAG/C,OAAAC,CAAAA,EAAS,CACT,MAAA,CAAO,gBAAA,CAAiB,QAAA,CAAUA,CAAQ,EAEnC,IAAM,MAAA,CAAO,mBAAA,CAAoB,QAAA,CAAUA,CAAQ,CAC5D,EAAG,CAACN,CAAK,CAAC,CAAA,CAEHG,CACT","file":"index.js","sourcesContent":["export const standardButtonClasses =\n 'cursor-pointer rounded-md bg-[var(--tuwa-standart-button-bg)] px-3 py-2 flex items-center gap-1 text-sm font-semibold text-[var(--tuwa-text-primary)] transition-colors hover:bg-[var(--tuwa-standart-button-hover)] disabled:cursor-not-allowed disabled:opacity-50';\n","/**\n * @file This file contains a utility function for conditionally merging Tailwind CSS classes.\n */\n\nimport { type ClassValue, clsx } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * A utility function to conditionally join class names together and resolve\n * conflicting Tailwind CSS classes.\n *\n * It combines the functionality of `clsx` and `tailwind-merge`.\n *\n * @param {...ClassValue[]} inputs - A list of class values to be combined.\n * This can include strings, numbers, objects, arrays, and booleans.\n * @returns {string} The final, merged class name string.\n *\n * @example\n * cn('p-4', 'bg-red-500', { 'font-bold': true }); // => 'p-4 bg-red-500 font-bold'\n * cn('p-2', 'p-4'); // => 'p-4' (tailwind-merge resolves the conflict)\n *\n * @see https://github.com/dcastil/tailwind-merge\n * @see https://github.com/lukeed/clsx\n */\nexport function cn(...inputs: ClassValue[]): string {\n return twMerge(clsx(inputs));\n}\n","/**\n * @file This file contains a utility for performing a deep (recursive) merge of two objects.\n */\n\n/**\n * Checks if the provided item is a plain object (i.e., not null and not an array).\n *\n * @param {any} item - The item to check.\n * @returns {item is Record<string, any>} True if the item is a plain object, otherwise false.\n */\nconst isObject = (item: any): item is Record<string, any> => {\n return item && typeof item === 'object' && !Array.isArray(item);\n};\n\n/**\n * Recursively merges the properties of a source object into a target object.\n * This function creates a new object and does not mutate the original target.\n *\n * @template T - The type of the objects being merged.\n * @param {T} target - The base object.\n * @param {Partial<T>} source - The object with properties to merge into the target.\n * @returns {T} A new object representing the merged result.\n *\n * @example\n * const defaults = { a: 1, b: { c: 2, d: 3 } };\n * const custom = { b: { c: 99 } };\n * const result = deepMerge(defaults, custom);\n * // result will be { a: 1, b: { c: 99, d: 3 } }\n */\nexport function deepMerge<T extends object>(target: T, source: Partial<T>): T {\n // Start with a shallow copy of the target to avoid mutation.\n const output = { ...target };\n\n if (isObject(target) && isObject(source)) {\n // Iterate over the keys in the source object.\n Object.keys(source).forEach((key) => {\n const targetValue = target[key as keyof T];\n const sourceValue = source[key as keyof T];\n\n // If the value is an object in both target and source, merge them recursively.\n if (isObject(targetValue) && isObject(sourceValue)) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n (output as Record<string, any>)[key] = deepMerge(targetValue, sourceValue);\n } else {\n // Otherwise, the source value overwrites the target value.\n (output as Record<string, any>)[key] = sourceValue;\n }\n });\n }\n\n return output;\n}\n","/**\n * @file This file contains a utility function for truncating a string with a center ellipsis.\n */\n\n/**\n * Truncates a string by showing a specified number of characters from the start and end,\n * with an ellipsis in the middle. If the string is too short to be truncated, it's returned as is.\n *\n * @param {string} str - The string to truncate.\n * @param {number} from - The number of characters to show from the beginning of the string.\n * @param {number} to - The number of characters to show from the end of the string.\n * @returns {string} The truncated string, or the original string if it's too short.\n *\n * @example\n * const hash = '0x1234567890abcdef1234567890abcdef';\n * textCenterEllipsis(hash, 6, 4); // => \"0x1234...cdef\"\n *\n * textCenterEllipsis('short', 6, 4); // => \"short\"\n */\nexport function textCenterEllipsis(str: string | undefined | null, from: number, to: number): string {\n if (!str) {\n return '';\n }\n\n // If the string is short enough, don't truncate it.\n if (str.length <= from + to) {\n return str;\n }\n\n const start = str.slice(0, from);\n const end = str.slice(str.length - to);\n\n return `${start}...${end}`;\n}\n","import { AnimatePresence, motion } from 'framer-motion';\n\nimport { cn } from '../utils';\n\nexport function ChevronArrowWithAnim({\n className,\n strokeWidth,\n isOpen,\n}: {\n className?: string;\n strokeWidth?: number;\n isOpen?: boolean;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={strokeWidth ?? 2}\n stroke=\"currentColor\"\n className={cn('w-4 h-4 text-[var(--tuwa-text-secondary)]', className)}\n >\n <AnimatePresence>\n {isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m4.5 15.75 7.5-7.5 7.5 7.5\"\n variants={{\n hidden: { translateY: 3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n\n <AnimatePresence>\n {!isOpen && (\n <motion.path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"m19.5 8.25-7.5 7.5-7.5-7.5\"\n className=\"relative\"\n variants={{\n hidden: { translateY: -3, scaleY: 0.8, opacity: 0 },\n visible: { translateY: 0, scaleY: 1, opacity: 1 },\n }}\n initial=\"hidden\"\n animate=\"visible\"\n transition={{ duration: 0.4 }}\n />\n )}\n </AnimatePresence>\n </svg>\n );\n}\n","import * as React from 'react';\n\nimport { cn } from '../utils';\n\n/**\n * A reusable close button icon (X mark) styled with TUWA color scheme.\n */\nexport const CloseIcon = React.forwardRef<SVGSVGElement, React.SVGAttributes<SVGSVGElement>>(\n ({ className, ...props }, ref) => (\n <svg\n ref={ref}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n className={cn('h-5 w-5 text-[var(--tuwa-text-primary)] transition-colors', className)}\n {...props}\n >\n <path d=\"M18 6 6 18\" />\n <path d=\"m6 6 12 12\" />\n </svg>\n ),\n);\nCloseIcon.displayName = 'CloseIcon';\n","import * as DialogPrimitive from '@radix-ui/react-dialog';\nimport { AnimatePresence, motion, Variants } from 'framer-motion';\nimport * as React from 'react';\n\nimport { cn } from '../utils';\n\nconst Dialog = DialogPrimitive.Root;\nconst DialogTrigger = DialogPrimitive.Trigger;\nconst DialogPortal = DialogPrimitive.Portal;\nconst DialogClose = DialogPrimitive.Close;\n\nconst defaultModalAnimation: Variants = {\n initial: { opacity: 0, scale: 0.9, y: 20 },\n animate: { opacity: 1, scale: 1, y: 0 },\n exit: {\n opacity: 0,\n scale: 0.9,\n transition: {\n duration: 0.2,\n },\n },\n};\n\nconst defaultModalBackdropAnimation: Variants = {\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n};\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay> & {\n backdropAnimation?: Variants;\n }\n>(({ className, backdropAnimation, ...props }, ref) => (\n <AnimatePresence>\n <motion.div\n variants={backdropAnimation ?? defaultModalBackdropAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn('fixed inset-0 z-50 bg-black/55 backdrop-blur-sm backdrop-saturate-150', className)}\n {...props}\n />\n </motion.div>\n </AnimatePresence>\n));\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName;\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & {\n modalAnimation?: Variants;\n backdropAnimation?: Variants;\n }\n>(({ className, children, modalAnimation, backdropAnimation, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay backdropAnimation={backdropAnimation} />\n\n <DialogPrimitive.Content\n aria-describedby=\"tuwa:modal-content\"\n ref={ref}\n className={cn(\n 'fixed bottom-0 left-0 p-0 sm:bottom-auto sm:left-[50%] sm:top-[50%] sm:translate-x-[-50%] sm:translate-y-[-50%] z-50 sm:p-4 outline-none',\n className,\n )}\n {...props}\n >\n <motion.div\n layout\n className=\"relative overflow-hidden\"\n transition={{\n layout: {\n duration: 0.2,\n ease: [0.1, 0.1, 0.2, 1],\n },\n }}\n >\n <AnimatePresence>\n <motion.div\n variants={modalAnimation ?? defaultModalAnimation}\n transition={{ duration: 0.2, ease: 'easeInOut' }}\n animate=\"animate\"\n initial=\"initial\"\n exit=\"exit\"\n className=\"relative rounded-t-2xl sm:rounded-2xl overflow-hidden\"\n >\n <div\n className={cn(\n 'relative flex max-h-[98dvh] w-full flex-col gap-3 overflow-y-auto rounded-t-2xl sm:rounded-2xl shadow-2xl',\n 'border border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)]',\n )}\n >\n {children}\n </div>\n </motion.div>\n </AnimatePresence>\n </motion.div>\n </DialogPrimitive.Content>\n </DialogPortal>\n));\nDialogContent.displayName = DialogPrimitive.Content.displayName;\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-header\"\n className={cn(\n 'sticky flex top-0 z-11 w-full flex-row items-center justify-between',\n 'border-b border-[var(--tuwa-border-primary)] bg-[var(--tuwa-bg-primary)] p-4',\n className,\n )}\n {...props}\n />\n);\nDialogHeader.displayName = 'DialogHeader';\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n aria-describedby=\"tuwa:modal-footer\"\n className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)}\n {...props}\n />\n);\nDialogFooter.displayName = 'DialogFooter';\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n aria-describedby=\"tuwa:modal-title\"\n className={cn('text-lg font-bold leading-none tracking-tight text-[var(--tuwa-text-primary)] m-0', className)}\n {...props}\n />\n));\nDialogTitle.displayName = DialogPrimitive.Title.displayName;\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description\n aria-describedby=\"tuwa:modal-description\"\n ref={ref}\n className={cn('text-sm text-[var(--tuwa-text-secondary)]', className)}\n {...props}\n />\n));\nDialogDescription.displayName = DialogPrimitive.Description.displayName;\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n","import { useEffect, useMemo, useState } from 'react';\n\nexport function StarsBackground({ starsCount }: { starsCount?: number }) {\n const [isMounted, setIsMounted] = useState(false);\n useEffect(() => setIsMounted(true), []);\n\n const stars = useMemo(() => {\n if (!isMounted) {\n return [];\n }\n\n const numStars = starsCount ?? 200;\n return Array.from({ length: numStars }).map(() => ({\n x: Math.random() * window.innerWidth,\n y: Math.random() * window.innerHeight,\n r: Math.random() * 1 + 0.5,\n isSupernova: Math.random() < 0.1,\n delay: Math.random() * 10,\n duration: 5 + Math.random() * 5,\n }));\n }, [isMounted]);\n\n return (\n <div className=\"absolute inset-0 z-1 h-full w-full overflow-hidden\">\n <svg width=\"100%\" height=\"100%\" xmlns=\"http://www.w3.org/2000/svg\">\n <defs>\n <style>\n {`\n /* Pulse animation now includes scale for a more organic feel. */\n @keyframes pulse {\n 0%, 100% { \n opacity: 0.2;\n transform: scale(0.9);\n }\n 50% {\n opacity: 0.8;\n transform: scale(1.2);\n }\n }\n \n /* Supernova animation remains impactful. */\n @keyframes supernova {\n 0% { \n transform: scale(1);\n stroke: rgba(var(--tuwa-bg-primary), 0.5);\n opacity: 0.8;\n }\n 20% { \n transform: scale(3);\n stroke: var(--tuwa-button-gradient-from);\n opacity: 1;\n }\n 100% { \n transform: scale(0.8);\n stroke: var(--tuwa-button-gradient-to);\n opacity: 0;\n }\n }\n\n .pulsar {\n animation-name: pulse;\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n }\n\n .supernova {\n animation-name: supernova;\n animation-timing-function: ease-out;\n animation-iteration-count: infinite;\n transform-origin: center;\n stroke-width: 2;\n }\n `}\n </style>\n </defs>\n\n {stars.map((star, i) => (\n <circle\n key={i}\n cx={star.x}\n cy={star.y}\n r={star.r}\n fill={`rgba(var(--tuwa-bg-primary), 0.7)`}\n className={star.isSupernova ? 'supernova' : 'pulsar'}\n style={{\n animationDelay: `${star.delay}s`,\n animationDuration: `${star.duration}s`,\n }}\n />\n ))}\n </svg>\n </div>\n );\n}\n","/**\n * @file This file contains a custom React hook for copying text to the clipboard.\n */\n\nimport { useCallback, useState } from 'react';\n\n/**\n * A custom React hook that provides functionality to copy text to the clipboard.\n * It also manages a \"copied\" state with a timeout for user feedback.\n *\n * @param {number} [timeout=2000] - The duration in milliseconds to keep the `isCopied` state as true.\n * @returns {{\n * isCopied: boolean;\n * copy: (text: string) => Promise<void>;\n * error: Error | null;\n * }} An object containing the `isCopied` state, the `copy` function, and any potential error.\n *\n * @example\n * const MyComponent = () => {\n * const { isCopied, copy } = useCopyToClipboard();\n * const textToCopy = '0x123...';\n *\n * return (\n * <button onClick={() => copy(textToCopy)}>\n * {isCopied ? 'Copied!' : 'Copy Address'}\n * </button>\n * );\n * }\n */\nexport function useCopyToClipboard(timeout = 2000): {\n isCopied: boolean;\n copy: (text: string) => Promise<void>;\n error: Error | null;\n} {\n const [isCopied, setIsCopied] = useState(false);\n const [error, setError] = useState<Error | null>(null);\n\n const copy = useCallback(\n async (text: string) => {\n if (!text) return;\n\n try {\n await navigator.clipboard.writeText(text);\n setIsCopied(true);\n setError(null);\n\n setTimeout(() => setIsCopied(false), timeout);\n } catch (e) {\n const copyError = e instanceof Error ? e : new Error('Failed to copy text.');\n console.error(copyError);\n setError(copyError);\n\n // Reset error state after timeout as well\n setTimeout(() => setError(null), timeout);\n }\n },\n [timeout],\n );\n\n return { isCopied, copy, error };\n}\n","import { useEffect, useState } from 'react';\n\n/**\n * A custom hook to detect if a media query matches the current screen dimensions.\n * Handles SSR gracefully.\n * @param {string} query - The media query string (e.g., '(max-width: 767px)').\n * @returns {boolean} Whether the query matches or not.\n */\nexport function useMediaQuery(query: string): boolean {\n const getMatches = (q: string): boolean => {\n if (typeof window !== 'undefined') {\n return window.matchMedia(q).matches;\n }\n return false;\n };\n\n const [matches, setMatches] = useState<boolean>(getMatches(query));\n\n useEffect(() => {\n const media = window.matchMedia(query);\n const listener = () => setMatches(media.matches);\n\n // Re-check on mount and subscribe to changes\n listener();\n window.addEventListener('resize', listener);\n\n return () => window.removeEventListener('resize', listener);\n }, [query]);\n\n return matches;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tuwaio/nova-core",
3
- "version": "1.0.0-fix-integrate-orbit-alpha.16.610f49e",
3
+ "version": "1.0.0-fix-integrate-orbit-alpha.18.4b877e5",
4
4
  "private": false,
5
5
  "author": "Oleksandr Tkach",
6
6
  "license": "Apache-2.0",