@verifiedinc-public/shared-ui-elements 5.0.4 → 5.1.1
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/animation/AnimatedHeight.d.ts +2 -0
- package/dist/components/animation/index.d.ts +1 -0
- package/dist/components/animation/index.mjs +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/shared/useNavigatorOnline-LJuH4983.mjs +1 -0
- package/dist/shared/useResizeObserver-D434c1uN.mjs +1 -0
- package/dist/utils/wrapPromise/index.mjs +1 -0
- package/dist/utils/wrapPromise.d.ts +2 -2
- package/package.json +1 -1
- package/dist/shared/useNavigatorOnline-D2MaaBCr.mjs +0 -1
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{C as
|
1
|
+
"use strict";import{C as i,M as n,f as r,a as e,d as m,c as l,b as f,e as h}from"../../shared/motions-BBPeWBPV.mjs";import{j as t}from"../../shared/jsx-runtime-DHlBLioN.mjs";import{useRef as p}from"react";import{motion as u}from"framer-motion";import{u as d}from"../../shared/useResizeObserver-D434c1uN.mjs";function M(s){const o=p(null),[,a]=d(o);return t.jsx(u.div,{style:{height:a,transition:"height 75ms ease-out"},children:t.jsx("div",{ref:o,children:s.children})})}export{M as AnimateHeight,i as Counter,n as MotionBox,r as MotionButton,e as MotionStack,m as MotionTableCell,l as MotionTableRow,f as MotionTbody,h as MotionTypography};
|
package/dist/hooks/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{b as s,d as a,a as e,j as u,u as o,
|
1
|
+
"use strict";import{b as s,d as a,a as e,j as u,u as o,k as r,e as i,c as t,f as l,g as m,h as c,i as n}from"../shared/useNavigatorOnline-LJuH4983.mjs";import{u as p,a as f}from"../shared/useCopyToClipboard-_Ur9Q8Gv.mjs";import{a as b,u as C}from"../shared/useOnClickOutside-P5GTcgh8.mjs";import{u as d}from"../shared/useCounter-BV32zXDQ.mjs";import{u as O}from"../shared/useResizeObserver-D434c1uN.mjs";export{s as useCallbackRef,p as useCopyToClipboard,d as useCounter,a as useDebounceValue,e as useDisclosure,u as useIntersectionObserver,o as useLocalStorage,r as useNavigatorOnline,b as useOnClickOutside,f as usePrevious,C as useQRCode,O as useResizeObserver,i as useScript,t as useSearchParams,l as useThrottle,m as useToggle,c as useWindowScroll,n as useWindowSize};
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{A as
|
1
|
+
"use strict";import{A as s,c as e,l as r,B as t,n as o,m as i,C as n,D as m,f as l,E as u,j as p,F as d,I as c,b as h,L as S,O as g,h as C,e as f,P as k,Q as P,R as b,S as y,d as B,k as D,T,g as I,a as v,V as O,i as R,o as w,t as L,u as N}from"./shared/index-Cj3wekcx.mjs";import{a as M,b as E,P as Y,S as x}from"./shared/PageSectionHeader-DdpDhBZG.mjs";import{B as F,C as z,i as A,E as G,L as W,j as U,M as V,g as j,O as H,P as q,R as Q,e as $,d as J,S as K,a as X,b as Z,k as _,c as aa,f as sa,W as ea,l as ra,o as ta,n as oa,p as ia,h as na,m as ma,u as la,q as ua}from"./shared/SignupBigNumbers-8kKjFq0L.mjs";import{b as pa,d as da,a as ca,j as ha,u as Sa,k as ga,e as Ca,c as fa,f as ka,g as Pa,h as ba,i as ya}from"./shared/useNavigatorOnline-LJuH4983.mjs";import{u as Ba,a as Da}from"./shared/useCopyToClipboard-_Ur9Q8Gv.mjs";import{a as Ta,u as Ia}from"./shared/useOnClickOutside-P5GTcgh8.mjs";import{u as va}from"./shared/useCounter-BV32zXDQ.mjs";import{u as Oa}from"./shared/useResizeObserver-D434c1uN.mjs";import{b as Ra,a as wa,v as La,e as Na,d as Ma,p as Ea,u as Ya,h as xa,j as Fa,g as za,o as Aa,s as Ga,m as Wa,c as Ua,l as Va,n as ja,q as Ha,f as qa,i as Qa,r as $a,z as Ja,t as Ka,x as Xa,k as Za,w as _a,y as as}from"./shared/shadows-Dhd7FrwF.mjs";import{wrapPromise as ss}from"./utils/wrapPromise/index.mjs";import{c as es,g as rs,a as ts,p as os,s as is,v as ns}from"./shared/phone-D5XIxT7-.mjs";import{masks as ms}from"./utils/masks/index.mjs";import{toCapitalize as ls,toSentenceCase as us}from"./utils/string/index.mjs";import{k as ps}from"./shared/formatKebabToPretty-Du43TgPC.mjs";import{M as ds,S as cs,U as hs,d as Ss,e as gs,f as Cs,g as fs,a as ks,s as Ps}from"./shared/unix.schema-CMYTtXco.mjs";import{p as bs}from"./shared/phone.schema-XBbyizhq.mjs";import{SnackbarProvider as ys}from"notistack";const Bs=a=>a.replace(/(\d{3})-?(\d{2})-?(\d{4})/,"\u2022\u2022\u2022-\u2022\u2022-$3");export{s as AcceptTermsNotice,e as Alert,r as Backdrop,t as Banner,F as BigNumber,o as BrandFilterInput,i as Button,n as CredentialRequestsEditor,z as CustomAlertComponent,m as DateInput,l as DateRangeInput,u as EmailInput,A as EmptyChartSection,G as ErrorCodesChart,p as ExactBirthdayBanner,d as FullWidthAlert,c as Image,h as LegalLink,S as LinkButton,W as LoadingChartSection,ds as MaskedAndUnmaskedSSNSchema,U as MetricLastUpdated,V as MonthlySignupsOverviewTable,g as OTPInput,C as OneClickForm,j as OneClickOverTimeChart,H as OneClickPercentageChart,M as PageHeader,E as PageSectionHeader,Y as Paragraph,f as PhoneInput,q as PieChart,k as PrivacyPolicyNotice,P as QRCodeDisplay,Q as ReasonCodesChart,b as ResendPhoneBanner,$ as RiskScoreBarChart,J as RiskScorePieChart,y as SSNInput,cs as SSNSchema,x as SectionHeader,B as SelectInput,K as SeriesChart,X as SeriesChartLegend,Z as SeriesPercentageChart,_ as SignupBigNumbers,aa as SimpleBarChart,sa as SimpleLegend,ys as SnackbarProvider,D as TestPhoneNumbersBanner,T as TextButton,I as TimezoneInput,v as Typography,hs as USDateSchema,O as VerifiedImage,R as VerifiedIncLogo,ea as When,Ra as black,wa as blue,La as colors,es as countries,Na as darkBlue,Ma as darkGreen,Ea as darkGrey,Ya as darkGreyContrast,xa as darkRed,Fa as darkYellow,Ss as descriptionSchema,gs as emailSchema,Cs as fieldSchema,ra as formatDateMMDDYYYY,ta as formatDateMMYY,oa as formatDateToTimestamp,ia as formatExtendedDate,fs as getDateSchemaWithPastValidation,rs as getPhoneData,ts as getPhoneDataByFieldName,ks as getUnixSchema,za as green,Aa as grey,Ga as greyContrast,Wa as infoContrast,ps as kebabCaseToPretty,Ua as lightBlue,Va as lightGreen,ja as lightGrey,Ha as lightGreyContrast,qa as lightRed,Qa as lightYellow,na as mapMonthlySignupsOverviewTableData,ma as mapTimeSeriesData,ms as masks,w as omitProperties,os as parseToPhoneNational,bs as phoneSchema,$a as red,Ja as shadows,is as sortByCountryName,Bs as ssnFormatter,Ps as stateSchema,Ka as textDisabled,Xa as theme,ls as toCapitalize,L as toOption,us as toSentenceCase,N as useBrandFilterInput,pa as useCallbackRef,Ba as useCopyToClipboard,va as useCounter,da as useDebounceValue,ca as useDisclosure,ha as useIntersectionObserver,Sa as useLocalStorage,ga as useNavigatorOnline,Ta as useOnClickOutside,Da as usePrevious,Ia as useQRCode,Oa as useResizeObserver,Ca as useScript,fa as useSearchParams,la as useSnackbar,ka as useThrottle,Pa as useToggle,ba as useWindowScroll,ya as useWindowSize,ua as uuidToHashedColor,ns as validatePhone,Za as warningContrast,_a as white,ss as wrapPromise,as as yellow};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";import{useRef as y,useInsertionEffect as C,useCallback as w,useState as d,useId as x,useEffect as g,useLayoutEffect as I,useSyncExternalStore as A}from"react";function k(e){return{set:r=>{const o=typeof r=="string"?r:JSON.stringify(r);localStorage.setItem(e,o)},get:()=>{const r=localStorage.getItem(e);if(r)try{return JSON.parse(r)}catch{return r}return null},remove:()=>{localStorage.removeItem(e)}}}function E(e,r=[]){const o=y(()=>{throw new Error("Cannot call an event handler while rendering.")});return C(()=>{o.current=e}),w((...t)=>{var i;return(i=o.current)==null?void 0:i.call(o,...t)},r)}function z(e={}){const{onClose:r,onOpen:o,open:t,id:i}=e,n=E(o),s=E(r),[a,l]=d(e.defaultOpen??!1),c=t??a,u=t!==void 0,m=x(),f=i??`disclosure-${m}`,h=w(()=>{u||l(!1),s?.()},[u,s]),p=w(()=>{u||l(!0),n?.()},[u,n]),b=w(()=>{c?h():p()},[c,p,h]);function S(v={}){return{...v,"aria-expanded":c,"aria-controls":f,onClick(O){var L;(L=v.onClick)==null||L.call(v,O),b()}}}function T(v={}){return{...v,hidden:!c,id:f}}return{open:c,onOpen:p,onClose:h,onToggle:b,isControlled:u,getButtonProps:S,getDisclosureProps:T}}function D(e){return new URLSearchParams(e??window.location.search)}function P(e,r=250){const[o,t]=d(e);return g(()=>{const i=setTimeout(()=>{t(e)},r);return()=>{clearTimeout(i)}},[e,r]),o}function W(e,r={removeOnUnmount:!1}){const[o,t]=d("loading"),i=y(r);return g(()=>{let n=document.querySelector(`script[src="${e}"]`);const s=n?.getAttribute("data-status");if(s){t(s);return}if(n===null){n=document.createElement("script"),n.src=e,n.async=!0,n.setAttribute("data-status","loading"),document.body.appendChild(n);const a=()=>{n?.setAttribute("data-status","ready"),t("ready"),c()},l=()=>{n?.setAttribute("data-status","error"),t("error"),c()},c=()=>{n?.removeEventListener("load",a),n?.removeEventListener("error",l)};n.addEventListener("load",a),n.addEventListener("error",l);const u=i.current.removeOnUnmount;return()=>{u&&(n?.remove(),c())}}else t("unknown")},[e]),o}function j(e,r=500){const[o,t]=d(e),i=y(Date.now());return g(()=>{const n=Date.now(),s=n-i.current;if(s>=r)i.current=n,t(e);else{const a=r-s,l=window.setTimeout(()=>{i.current=Date.now(),t(e)},a);return()=>{window.clearTimeout(l)}}},[e,r]),o}function U(e){const[r,o]=d(()=>typeof e=="boolean"?e:!!e),t=w(i=>{if(typeof i=="boolean"){o(i);return}o(n=>!n)},[]);return[r,t]}function H(){const[e,r]=d({x:0,y:0}),o=w((...t)=>{if(t.length===1&&typeof t[0]=="object")window.scrollTo(t[0]);else if(t.length===2)window.scrollTo(t[0],t[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 I(()=>{const t=()=>{r({x:window.scrollX,y:window.scrollY})};return t(),window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)}},[]),{...e,scrollTo:o}}function J(){const[e,r]=d({width:window.innerWidth,height:window.innerHeight});return I(()=>{const o=()=>{r({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),e}function N(e,{threshold:r=0,root:o=null,rootMargin:t="0%",freezeOnceVisible:i=!1}={}){const[n,s]=d({isIntersecting:!1,entry:null});return g(()=>{const a=e?.current;let l;if(a){if(i&&n.isIntersecting)return;const c=m=>{const[f]=m;s({isIntersecting:f.isIntersecting,entry:f})},u=new IntersectionObserver(c,{threshold:r,root:o,rootMargin:t});u.observe(a),l=()=>{u.disconnect()}}return()=>{l&&l()}},[e,r,o,t,i,n.isIntersecting]),n}function $(){return A(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)}export{z as a,E as b,D as c,P as d,W as e,j as f,U as g,H as h,J as i,N as j,$ as k,k as u};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";import{useRef as i,useSyncExternalStore as c}from"react";function s(n){const e=i(["auto","auto"]);return c(t=>{if(typeof window>"u"||typeof ResizeObserver>"u")return()=>{};if(!n.current)return()=>{};const r=new ResizeObserver(t);return r.observe(n.current),()=>{r.disconnect()}},()=>{var t;if(typeof window>"u")return e.current;const r=(t=n.current)==null?void 0:t.getBoundingClientRect(),u=r?.width??"auto",o=r?.height??"auto";return(e.current[0]!==u||e.current[1]!==o)&&(e.current=[u,o]),e.current},()=>e.current)}export{s as u};
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";async function n(r){try{return[await r,null]}catch(a){return[null,a]}}export{n as wrapPromise};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
type WrappedPromiseEitherResponse<D,
|
1
|
+
type WrappedPromiseEitherResponse<D, E> = [Awaited<D>, null] | [null, E];
|
2
2
|
/**
|
3
3
|
* Wrap a promise to return an array with the data and the error.
|
4
4
|
* @param promise The promise to wrap
|
5
5
|
* @returns
|
6
6
|
*/
|
7
|
-
export declare function wrapPromise<D,
|
7
|
+
export declare function wrapPromise<D, E = object>(promise: PromiseLike<D>): Promise<WrappedPromiseEitherResponse<D, E>>;
|
8
8
|
export {};
|
package/package.json
CHANGED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";import{useRef as g,useInsertionEffect as x,useCallback as w,useState as d,useId as z,useEffect as h,useLayoutEffect as I,useSyncExternalStore as S}from"react";function A(e){return{set:t=>{const o=typeof t=="string"?t:JSON.stringify(t);localStorage.setItem(e,o)},get:()=>{const t=localStorage.getItem(e);if(t)try{return JSON.parse(t)}catch{return t}return null},remove:()=>{localStorage.removeItem(e)}}}function E(e,t=[]){const o=g(()=>{throw new Error("Cannot call an event handler while rendering.")});return x(()=>{o.current=e}),w((...n)=>{var i;return(i=o.current)==null?void 0:i.call(o,...n)},t)}function R(e={}){const{onClose:t,onOpen:o,open:n,id:i}=e,r=E(o),s=E(t),[a,u]=d(e.defaultOpen??!1),c=n??a,l=n!==void 0,m=z(),f=i??`disclosure-${m}`,p=w(()=>{l||u(!1),s?.()},[l,s]),y=w(()=>{l||u(!0),r?.()},[l,r]),b=w(()=>{c?p():y()},[c,y,p]);function O(v={}){return{...v,"aria-expanded":c,"aria-controls":f,onClick(C){var L;(L=v.onClick)==null||L.call(v,C),b()}}}function T(v={}){return{...v,hidden:!c,id:f}}return{open:c,onOpen:y,onClose:p,onToggle:b,isControlled:l,getButtonProps:O,getDisclosureProps:T}}function k(e){return new URLSearchParams(e??window.location.search)}function D(e,t=250){const[o,n]=d(e);return h(()=>{const i=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(i)}},[e,t]),o}function P(e,t={removeOnUnmount:!1}){const[o,n]=d("loading"),i=g(t);return h(()=>{let r=document.querySelector(`script[src="${e}"]`);const s=r?.getAttribute("data-status");if(s){n(s);return}if(r===null){r=document.createElement("script"),r.src=e,r.async=!0,r.setAttribute("data-status","loading"),document.body.appendChild(r);const a=()=>{r?.setAttribute("data-status","ready"),n("ready"),c()},u=()=>{r?.setAttribute("data-status","error"),n("error"),c()},c=()=>{r?.removeEventListener("load",a),r?.removeEventListener("error",u)};r.addEventListener("load",a),r.addEventListener("error",u);const l=i.current.removeOnUnmount;return()=>{l&&(r?.remove(),c())}}else n("unknown")},[e]),o}function U(e,t=500){const[o,n]=d(e),i=g(Date.now());return h(()=>{const r=Date.now(),s=r-i.current;if(s>=t)i.current=r,n(e);else{const a=t-s,u=window.setTimeout(()=>{i.current=Date.now(),n(e)},a);return()=>{window.clearTimeout(u)}}},[e,t]),o}function W(e){const[t,o]=d(()=>typeof e=="boolean"?e:!!e),n=w(i=>{if(typeof i=="boolean"){o(i);return}o(r=>!r)},[]);return[t,n]}function j(){const[e,t]=d({x:0,y:0}),o=w((...n)=>{if(n.length===1&&typeof n[0]=="object")window.scrollTo(n[0]);else if(n.length===2)window.scrollTo(n[0],n[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 I(()=>{const n=()=>{t({x:window.scrollX,y:window.scrollY})};return n(),window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}},[]),{...e,scrollTo:o}}function B(){const[e,t]=d({width:window.innerWidth,height:window.innerHeight});return I(()=>{const o=()=>{t({width:window.innerWidth,height:window.innerHeight})};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o)}},[]),e}function H(e,{threshold:t=0,root:o=null,rootMargin:n="0%",freezeOnceVisible:i=!1}={}){const[r,s]=d({isIntersecting:!1,entry:null});return h(()=>{const a=e?.current;let u;if(a){if(i&&r.isIntersecting)return;const c=m=>{const[f]=m;s({isIntersecting:f.isIntersecting,entry:f})},l=new IntersectionObserver(c,{threshold:t,root:o,rootMargin:n});l.observe(a),u=()=>{l.disconnect()}}return()=>{u&&u()}},[e,t,o,n,i,r.isIntersecting]),r}function J(e){const t=g(["auto","auto"]);return S(o=>{if(typeof window>"u"||typeof ResizeObserver>"u")return()=>{};if(!e.current)return()=>{};const n=new ResizeObserver(o);return n.observe(e.current),()=>{n.disconnect()}},()=>{var o;if(typeof window>"u")return t.current;const n=(o=e.current)==null?void 0:o.getBoundingClientRect(),i=n?.width??"auto",r=n?.height??"auto";return(t.current[0]!==i||t.current[1]!==r)&&(t.current=[i,r]),t.current},()=>t.current)}function N(){return S(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)}export{R as a,E as b,k as c,D as d,P as e,U as f,W as g,j as h,B as i,H as j,J as k,N as l,A as u};
|