@verifiedinc-public/shared-ui-elements 7.0.3 → 7.1.4
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/components/chart/index.mjs +1 -1
- package/dist/components/form/BasePhoneInput.d.ts +3 -1
- package/dist/components/form/TextMaskCustom.d.ts +1 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.mjs +1 -1
- package/dist/components/text-to-signup/index.d.ts +2 -0
- package/dist/components/text-to-signup/magic-button.d.ts +10 -0
- package/dist/components/text-to-signup/magic-qr-code.d.ts +9 -0
- package/dist/components/verified/index.d.ts +1 -0
- package/dist/components/verified/powered-by-verified.d.ts +4 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks/text-to-signup/index.d.ts +4 -0
- package/dist/hooks/text-to-signup/magic-link.d.ts +1 -0
- package/dist/hooks/text-to-signup/magic-qr-code-options.d.ts +34 -0
- package/dist/hooks/text-to-signup/magic-qr-code.d.ts +11 -0
- package/dist/hooks/text-to-signup/magic-text.d.ts +11 -0
- package/dist/index.mjs +1 -1
- package/dist/shared/{SignupBigNumbers-DpIvs8zO.mjs → SignupBigNumbers-CroHWk9_.mjs} +2 -2
- package/dist/shared/{_baseGetTag-B6tQMIzM.mjs → _baseGetTag-CrjEuriT.mjs} +1 -1
- package/dist/shared/generateKeyFromString-D1AuwK4y.mjs +1 -0
- package/dist/shared/magic-link-J1X2QOgb.mjs +1 -0
- package/dist/shared/magic-qr-code-BO1wSciL.mjs +1 -0
- package/dist/shared/magic-qr-code-D94nWKOZ.mjs +155 -0
- package/dist/shared/{phone-DCga5nUC.mjs → phone-PcoIqJru.mjs} +1 -1
- package/dist/shared/{ssn-K2aFHNWy.mjs → ssn-DDHkK5vg.mjs} +1 -1
- package/dist/shared/toNumber-B6a0B29A.mjs +1 -0
- package/dist/shared/{uuidColor-e3OxEKbO.mjs → uuidColor-DbOBO7Il.mjs} +1 -1
- package/dist/utils/index.mjs +1 -1
- package/dist/utils/phone/index.mjs +1 -1
- package/dist/utils/string/generateKeyFromString.d.ts +7 -0
- package/dist/utils/string/index.d.ts +1 -0
- package/dist/utils/string/index.mjs +1 -1
- package/package.json +3 -2
- package/dist/shared/ContentWithLoader-DglehNiE.mjs +0 -155
- package/dist/shared/toNumber-BUb3rTFh.mjs +0 -1
- package/dist/shared/useOnClickOutside-LHfgekbP.mjs +0 -1
- package/dist/shared/useStyledQRCode-BN5wt-Zb.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{a as s}from"./_baseGetTag-B6tQMIzM.mjs";function c(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var a=c,l=/\s/;function r(t){for(var e=t.length;e--&&l.test(t.charAt(e)););return e}var v=r,p=v,b=/^\s+/;function y(t){return t&&t.slice(0,p(t)+1).replace(b,"")}var m=y;function j(t){return t!=null&&typeof t=="object"}var o=j,$=s,h=o,x="[object Symbol]";function N(t){return typeof t=="symbol"||h(t)&&$(t)==x}var f=N,O=m,u=a,g=f,i=NaN,A=/^[-+]0x[0-9a-f]+$/i,I=/^0b[01]+$/i,S=/^0o[0-7]+$/i,d=parseInt;function k(t){if(typeof t=="number")return t;if(g(t))return i;if(u(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=u(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=O(t);var n=I.test(t);return n||S.test(t)?d(t.slice(2),n?2:8):A.test(t)?i:+t}var B=k;export{o as a,f as b,a as i,B as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{_ as W,g as b}from"./_baseGetTag-B6tQMIzM.mjs";import{t as B,i as C}from"./toNumber-BUb3rTFh.mjs";import{useMemo as M,useState as D,useEffect as z}from"react";import*as _ from"qrcode";var j=W,k=function(){return j.Date.now()},F=k,I=C,p=F,E=B,J="Expected a function",K=Math.max,N=Math.min;function P(t,r,i){var o,s,c,a,n,u,f=0,v=!1,l=!1,d=!0;if(typeof t!="function")throw new TypeError(J);r=E(r)||0,I(i)&&(v=!!i.leading,l="maxWait"in i,c=l?K(E(i.maxWait)||0,r):c,d="trailing"in i?!!i.trailing:d);function w(e){var m=o,g=s;return o=s=void 0,f=e,a=t.apply(g,m),a}function q(e){return f=e,n=setTimeout(h,r),v?w(e):a}function A(e){var m=e-u,g=e-f,y=r-m;return l?N(y,c-g):y}function T(e){var m=e-u,g=e-f;return u===void 0||m>=r||m<0||l&&g>=c}function h(){var e=p();if(T(e))return $(e);n=setTimeout(h,A(e))}function $(e){return n=void 0,d&&o?w(e):(o=s=void 0,a)}function L(){n!==void 0&&clearTimeout(n),f=0,o=u=s=n=void 0}function S(){return n===void 0?a:$(p())}function x(){var e=p(),m=T(e);if(o=arguments,s=this,u=e,m){if(n===void 0)return q(u);if(l)return clearTimeout(n),n=setTimeout(h,r),w(u)}return n===void 0&&(n=setTimeout(h,r)),a}return x.cancel=L,x.flush=S,x}var Q=P;const R=b(Q);function U(t){const r=M(()=>_.create(t.data),[t.data]).modules.data;return M(()=>{const i=t.size/Math.sqrt(r.length);let o=`<svg viewBox="0 0 ${t.size} ${t.size}" xmlns="http://www.w3.org/2000/svg">`;const s=t.imageSize,c=(t.size-s)/2,a=(t.size-s)/2;for(let n=0;n<r.length;n++){const u=n%Math.sqrt(r.length)*i,f=Math.floor(n/Math.sqrt(r.length))*i,v=i/2,l=r[n]===1,d=u+i>=c&&u<c+s&&f+i>=a&&f<a+s;!l||d||(o+=`<rect x="${u}" y="${f}" width="${i}" height="${i}" rx="${v}" ry="${v}" fill='${t.fill||"#000000"}' />`)}return o+="</svg>",o},[r,t])}function V(t,r=250){const[i,o]=D(t);return z(()=>{const s=setTimeout(()=>{o(t)},r);return()=>{clearTimeout(s)}},[t,r]),i}function X(t,r,i="mousedown",o={},s=null){z(()=>{const c=a=>{const n=a.target;!n||!n.isConnected||(Array.isArray(t)?t.filter(u=>!!u.current).every(u=>u.current&&!u.current.contains(n)):t.current&&!t.current.contains(n))&&r(a)};return(s??window).addEventListener(i,c,o),()=>{(s??window).removeEventListener(i,c,o)}},[o,i,r,t])}export{V as a,X as b,R as d,U as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";import{useRef as m,useInsertionEffect as k,useCallback as f,useState as d,useId as D,useEffect as w,useLayoutEffect as L,useSyncExternalStore as q,useMemo as S}from"react";import{d as I}from"./useOnClickOutside-LHfgekbP.mjs";import A from"qr-code-styling";import{j as N}from"./jsx-runtime-Bwwz4kRH.mjs";function P(e){return{set:r=>{const i=typeof r=="string"?r:JSON.stringify(r);localStorage.setItem(e,i)},get:()=>{const r=localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return r}return null},remove:()=>{localStorage.removeItem(e)}}}function O(e,r=[]){const i=m(()=>{throw new Error("Cannot call an event handler while rendering.")});return k(()=>{i.current=e}),f((...o)=>{var s;return(s=i.current)==null?void 0:s.call(i,...o)},r)}function j(e={}){const{onClose:r,onOpen:i,open:o,id:s}=e,n=O(i),a=O(r),[l,u]=d(e.defaultOpen??!1),t=o??l,c=o!==void 0,g=D(),p=s??`disclosure-${g}`,h=f(()=>{c||u(!1),a?.()},[c,a]),y=f(()=>{c||u(!0),n?.()},[c,n]),E=f(()=>{t?h():y()},[t,y,h]);function C(v={}){return{...v,"aria-expanded":t,"aria-controls":p,onClick(x){var b;(b=v.onClick)==null||b.call(v,x),E()}}}function T(v={}){return{...v,hidden:!t,id:p}}return{open:t,onOpen:y,onClose:h,onToggle:E,isControlled:c,getButtonProps:C,getDisclosureProps:T}}function H(e){return new URLSearchParams(e??window.location.search)}function R(e,r={addToHead:!1,removeOnUnmount:!1,nonce:void 0}){const[i,o]=d("loading"),s=m(r);return w(()=>{let n=document.querySelector(`script[src="${e}"]`);const a=n?.getAttribute("data-status");if(a){o(a);return}if(n===null){n=document.createElement("script"),n.src=e,n.async=!0,n.setAttribute("data-status","loading"),s.current.nonce&&n.setAttribute("nonce",s.current.nonce),s.current.addToHead?document.head.appendChild(n):document.body.appendChild(n);const l=()=>{n?.setAttribute("data-status","ready"),o("ready"),t()},u=()=>{n?.setAttribute("data-status","error"),o("error"),t()},t=()=>{n?.removeEventListener("load",l),n?.removeEventListener("error",u)};n.addEventListener("load",l),n.addEventListener("error",u);const c=s.current.removeOnUnmount;return()=>{c&&(n?.remove(),t())}}else o("unknown")},[e]),i}function U(e,r=500){const[i,o]=d(e),s=m(Date.now());return w(()=>{const n=Date.now(),a=n-s.current;if(a>=r)s.current=n,o(e);else{const l=r-a,u=window.setTimeout(()=>{s.current=Date.now(),o(e)},l);return()=>{window.clearTimeout(u)}}},[e,r]),i}function W(e){const[r,i]=d(()=>typeof e=="boolean"?e:!!e),o=f(s=>{if(typeof s=="boolean"){i(s);return}i(n=>!n)},[]);return[r,o]}function z(){const[e,r]=d({x:0,y:0}),i=f((...o)=>{if(o.length===1&&typeof o[0]=="object")window.scrollTo(o[0]);else if(o.length===2)window.scrollTo(o[0],o[1]);else throw new Error("Invalid arguments passed to scrollTo. Expected either ScrollToOptions object or x,y coordinates. See https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo")},[]);return L(()=>{const o=()=>{r({x:window.scrollX,y:window.scrollY})};return o(),window.addEventListener("scroll",o),()=>{window.removeEventListener("scroll",o)}},[]),{...e,scrollTo:i}}function B(){const[e,r]=d({width:window.innerWidth,height:window.innerHeight});return L(()=>{const i=()=>{r({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[]),e}function J(e,{threshold:r=0,root:i=null,rootMargin:o="0%",freezeOnceVisible:s=!1}={}){const[n,a]=d({isIntersecting:!1,entry:null});return w(()=>{const l=e?.current;let u;if(l){if(s&&n.isIntersecting)return;const t=g=>{const[p]=g;a({isIntersecting:p.isIntersecting,entry:p})},c=new IntersectionObserver(t,{threshold:r,root:i,rootMargin:o});c.observe(l),u=()=>{c.disconnect()}}return()=>{u&&u()}},[e,r,i,o,s,n.isIntersecting]),n}function M(){return q(e=>typeof window>"u"?()=>{}:(window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}),()=>typeof navigator>"u"?!0:navigator.onLine,()=>!0)}function $(e,r=500,i){const o=m(),s=S(()=>{const n=I(e,r,i),a=(...l)=>n(...l);return a.cancel=()=>{n.cancel()},a.isPending=()=>!!o.current,a.flush=()=>n.flush(),a},[e,r,i]);return w(()=>{o.current=I(e,r,i)},[e,r,i]),w(()=>()=>{o.current&&o.current.cancel()},[]),s}function X({options:e,className:r}){function i(t){return{width:t?.width??300,height:t?.height??300,type:t?.type??"svg",data:t?.data,image:t?.image,qrOptions:{typeNumber:0,mode:"Byte",errorCorrectionLevel:"Q",...t?.qrOptions},imageOptions:{crossOrigin:"anonymous",margin:20,...t?.imageOptions},dotsOptions:{color:"#000000",type:"square",...t?.dotsOptions},cornersSquareOptions:t?.cornersSquareOptions,cornersDotOptions:t?.cornersDotOptions,backgroundOptions:{color:"#ffffff",...t?.backgroundOptions}}}const[o]=d(i(e)),[s]=d(new A(o)),n=m(null),a=S(()=>()=>N.jsx("div",{className:r,ref:n}),[r]),l=async t=>await s.getRawData(t),u=async(t,c)=>{await s.download({name:t,extension:c})};return w(()=>{n.current&&s.append(n.current)},[s,n]),w(()=>{s&&s.update(i(e))},[s,e]),{Component:a,getRawData:l,download:u}}export{j as a,O as b,H as c,R as d,U as e,W as f,z as g,B as h,J as i,M as j,$ as k,X as l,P as u};
|