@verifiedinc-public/shared-ui-elements 2.0.0 → 2.1.0

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.
@@ -1 +1 @@
1
- "use strict";import{A as a,a as s,g as e,e as r,B as n,C as t,d as o,D as i,E as p,F as d,I as u,O as c,P as m,Q as l,R as B,S as I,b as h,f as P,T as S,V as b,c as g,W as A,u as C}from"../shared/index-CTvz4BbG.mjs";import{SnackbarProvider as T}from"notistack";export{a as AcceptTermsNotice,s as Alert,e as Backdrop,r as Banner,n as Button,t as CredentialRequestsEditor,o as CustomAlertComponent,i as DateInput,p as ExactBirthdayBanner,d as FullWidthAlert,u as Image,c as OTPInput,m as PhoneInput,l as QRCodeDisplay,B as ResendPhoneBanner,I as SSNInput,h as SelectInput,T as SnackbarProvider,P as TestPhoneNumbersBanner,S as Typography,b as VerifiedImage,g as VerifiedIncLogo,A as When,C as useSnackbar};
1
+ "use strict";import{A as a,a as s,g as e,e as r,B as n,C as t,d as o,D as i,E as p,F as d,I as u,O as c,P as m,Q as l,R as B,S as I,b as h,f as P,T as S,V as b,c as g,W as A,u as C}from"../shared/index-C9nSeFPi.mjs";import{SnackbarProvider as T}from"notistack";export{a as AcceptTermsNotice,s as Alert,e as Backdrop,r as Banner,n as Button,t as CredentialRequestsEditor,o as CustomAlertComponent,i as DateInput,p as ExactBirthdayBanner,d as FullWidthAlert,u as Image,c as OTPInput,m as PhoneInput,l as QRCodeDisplay,B as ResendPhoneBanner,I as SSNInput,h as SelectInput,T as SnackbarProvider,P as TestPhoneNumbersBanner,S as Typography,b as VerifiedImage,g as VerifiedIncLogo,A as When,C as useSnackbar};
@@ -0,0 +1,23 @@
1
+ import { RefObject } from 'react';
2
+ /** Supported event types. */
3
+ type EventType = 'mousedown' | 'mouseup' | 'touchstart' | 'touchend' | 'focusin' | 'focusout';
4
+ /**
5
+ * Custom hook that handles clicks outside a specified element.
6
+ * @template T - The type of the element's reference.
7
+ * @param {RefObject<T> | RefObject<T>[]} ref - The React ref object(s) representing the element(s) to watch for outside clicks.
8
+ * @param {(event: MouseEvent | TouchEvent | FocusEvent) => void} handler - The callback function to be executed when a click outside the element occurs.
9
+ * @param {EventType} [eventType] - The mouse event type to listen for (optional, default is 'mousedown').
10
+ * @param {?AddEventListenerOptions} [eventListenerOptions] - The options object to be passed to the `addEventListener` method (optional).
11
+ * @returns {void}
12
+ * @public
13
+ * @see [Documentation](https://usehooks-ts.com/react-hook/use-on-click-outside)
14
+ * @example
15
+ * ```tsx
16
+ * const containerRef = useRef(null);
17
+ * useOnClickOutside([containerRef], () => {
18
+ * // Handle clicks outside the container.
19
+ * });
20
+ * ```
21
+ */
22
+ export declare function useOnClickOutside<T extends HTMLElement = HTMLElement>(ref: RefObject<T> | Array<RefObject<T>>, handler: (event: MouseEvent | TouchEvent | FocusEvent) => void, eventType?: EventType, eventListenerOptions?: AddEventListenerOptions): void;
23
+ export {};
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- "use strict";import{A as n,a as i,g as m,e as l,B as d,C as c,d as u,D as h,E as p,F as g,I as S,O as f,P as y,Q as D,R as k,S as C,b as P,f as w,T as b,V as B,c as T,W as I,h as N,i as R,j as Y,o as A,p as F,s as G,u as x,v as M}from"./shared/index-CTvz4BbG.mjs";import{c as U,a as v,b as V,u as W,d as j}from"./shared/useSearchParams-CW9y02Ym.mjs";import{u as E}from"./shared/useQRCode-DXiPIj-D.mjs";import{b as q,a as L,v as O,e as Q,d as z,p as H,u as J,h as X,j as Z,g as _,o as $,s as K,m as aa,c as sa,l as ea,n as ta,q as ra,f as oa,i as na,r as ia,z as ma,t as la,x as da,k as ca,w as ua,y as ha}from"./shared/shadows-fgmuXym6.mjs";import{masks as pa}from"./utils/masks/index.mjs";import{M as ga,S as Sa,U as fa,d as ya,e as Da,f as ka,g as Ca,a as Pa,s as wa}from"./shared/unix.schema-CMYTtXco.mjs";import{p as ba}from"./shared/phone.schema-XBbyizhq.mjs";import{SnackbarProvider as Ba}from"notistack";async function Ta(s){try{return[await s,null]}catch(a){return[null,a]}}const Ia=s=>{let a=new Date(Number(s));if(!s){const e=new Date;a=new Date(e.getFullYear(),e.getMonth(),e.getDate())}const t=String(a.getDate()).padStart(2,"0"),r=String(a.getMonth()+1).padStart(2,"0"),o=a.getFullYear();return[r,t,o].join("/")},Na=s=>{const a=new Date(s);return a.setUTCHours(12),String(+a)},Ra=s=>s.replace(/(\d{3})-?(\d{2})-?(\d{4})/,"\u2022\u2022\u2022-\u2022\u2022-$3");export{n as AcceptTermsNotice,i as Alert,m as Backdrop,l as Banner,d as Button,c as CredentialRequestsEditor,u as CustomAlertComponent,h as DateInput,p as ExactBirthdayBanner,g as FullWidthAlert,S as Image,ga as MaskedAndUnmaskedSSNSchema,f as OTPInput,y as PhoneInput,D as QRCodeDisplay,k as ResendPhoneBanner,C as SSNInput,Sa as SSNSchema,P as SelectInput,Ba as SnackbarProvider,w as TestPhoneNumbersBanner,b as Typography,fa as USDateSchema,B as VerifiedImage,T as VerifiedIncLogo,I as When,q as black,L as blue,O as colors,N as countries,Q as darkBlue,z as darkGreen,H as darkGrey,J as darkGreyContrast,X as darkRed,Z as darkYellow,ya as descriptionSchema,Da as emailSchema,ka as fieldSchema,Ia as formatDateMMDDYYYY,Na as formatDateToTimestamp,Ca as getDateSchemaWithPastValidation,R as getPhoneData,Y as getPhoneDataByFieldName,Pa as getUnixSchema,_ as green,$ as grey,K as greyContrast,aa as infoContrast,sa as lightBlue,ea as lightGreen,ta as lightGrey,ra as lightGreyContrast,oa as lightRed,na as lightYellow,pa as masks,A as omitProperties,F as parseToPhoneNational,ba as phoneSchema,ia as red,ma as shadows,G as sortByCountryName,Ra as ssnFormatter,wa as stateSchema,la as textDisabled,da as theme,U as useCallbackRef,v as useCopyToClipboard,V as useDisclosure,W as useLocalStorage,E as useQRCode,j as useSearchParams,x as useSnackbar,M as validatePhone,ca as warningContrast,ua as white,Ta as wrapPromise,ha as yellow};
1
+ "use strict";import{A as n,a as i,g as m,e as l,B as d,C as c,d as u,D as h,E as p,F as g,I as S,O as f,P as y,Q as D,R as k,S as C,b as P,f as w,T as b,V as B,c as T,W as I,h as N,i as R,j as Y,o as A,p as F,s as G,u as x,v as M}from"./shared/index-C9nSeFPi.mjs";import{c as U,a as v,b as V,u as W,d as j}from"./shared/useSearchParams-CW9y02Ym.mjs";import{u as E}from"./shared/useQRCode-DXiPIj-D.mjs";import{b as q,a as L,v as O,e as Q,d as z,p as H,u as J,h as X,j as Z,g as _,o as $,s as K,m as aa,c as sa,l as ea,n as ta,q as ra,f as oa,i as na,r as ia,z as ma,t as la,x as da,k as ca,w as ua,y as ha}from"./shared/shadows-fgmuXym6.mjs";import{masks as pa}from"./utils/masks/index.mjs";import{M as ga,S as Sa,U as fa,d as ya,e as Da,f as ka,g as Ca,a as Pa,s as wa}from"./shared/unix.schema-CMYTtXco.mjs";import{p as ba}from"./shared/phone.schema-XBbyizhq.mjs";import{SnackbarProvider as Ba}from"notistack";async function Ta(s){try{return[await s,null]}catch(a){return[null,a]}}const Ia=s=>{let a=new Date(Number(s));if(!s){const e=new Date;a=new Date(e.getFullYear(),e.getMonth(),e.getDate())}const t=String(a.getDate()).padStart(2,"0"),r=String(a.getMonth()+1).padStart(2,"0"),o=a.getFullYear();return[r,t,o].join("/")},Na=s=>{const a=new Date(s);return a.setUTCHours(12),String(+a)},Ra=s=>s.replace(/(\d{3})-?(\d{2})-?(\d{4})/,"\u2022\u2022\u2022-\u2022\u2022-$3");export{n as AcceptTermsNotice,i as Alert,m as Backdrop,l as Banner,d as Button,c as CredentialRequestsEditor,u as CustomAlertComponent,h as DateInput,p as ExactBirthdayBanner,g as FullWidthAlert,S as Image,ga as MaskedAndUnmaskedSSNSchema,f as OTPInput,y as PhoneInput,D as QRCodeDisplay,k as ResendPhoneBanner,C as SSNInput,Sa as SSNSchema,P as SelectInput,Ba as SnackbarProvider,w as TestPhoneNumbersBanner,b as Typography,fa as USDateSchema,B as VerifiedImage,T as VerifiedIncLogo,I as When,q as black,L as blue,O as colors,N as countries,Q as darkBlue,z as darkGreen,H as darkGrey,J as darkGreyContrast,X as darkRed,Z as darkYellow,ya as descriptionSchema,Da as emailSchema,ka as fieldSchema,Ia as formatDateMMDDYYYY,Na as formatDateToTimestamp,Ca as getDateSchemaWithPastValidation,R as getPhoneData,Y as getPhoneDataByFieldName,Pa as getUnixSchema,_ as green,$ as grey,K as greyContrast,aa as infoContrast,sa as lightBlue,ea as lightGreen,ta as lightGrey,ra as lightGreyContrast,oa as lightRed,na as lightYellow,pa as masks,A as omitProperties,F as parseToPhoneNational,ba as phoneSchema,ia as red,ma as shadows,G as sortByCountryName,Ra as ssnFormatter,wa as stateSchema,la as textDisabled,da as theme,U as useCallbackRef,v as useCopyToClipboard,V as useDisclosure,W as useLocalStorage,E as useQRCode,j as useSearchParams,x as useSnackbar,M as validatePhone,ca as warningContrast,ua as white,Ta as wrapPromise,ha as yellow};