@verifiedinc-public/shared-ui-elements 2.0.0 → 2.2.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.
- package/dist/components/animation/Counter.d.ts +8 -0
- package/dist/components/animation/index.d.ts +2 -0
- package/dist/components/animation/index.mjs +1 -0
- package/dist/components/animation/motions.d.ts +2220 -0
- package/dist/components/index.mjs +1 -1
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks/useCounter.d.ts +13 -0
- package/dist/hooks/useDebounceValue.d.ts +8 -0
- package/dist/hooks/useIntersectionObserver.d.ts +16 -0
- package/dist/hooks/useOnClickOutside.d.ts +23 -0
- package/dist/hooks/useScript.d.ts +9 -0
- package/dist/hooks/useThrottle.d.ts +7 -0
- package/dist/hooks/useToggle.d.ts +6 -0
- package/dist/hooks/useWindowScroll.d.ts +11 -0
- package/dist/hooks/useWindowSize.d.ts +10 -0
- package/dist/index.mjs +1 -1
- package/dist/shared/index-w5CoDyk5.mjs +105 -0
- package/dist/shared/jsx-runtime-jmtevAuS.mjs +1 -0
- package/dist/shared/useCounter-BV32zXDQ.mjs +1 -0
- package/dist/shared/useIntersectionObserver-BX_TdOtC.mjs +1 -0
- package/package.json +8 -14
- package/dist/shared/index-CTvz4BbG.mjs +0 -105
- package/dist/shared/useSearchParams-CW9y02Ym.mjs +0 -1
@@ -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-
|
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-w5CoDyk5.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};
|
package/dist/hooks/index.d.ts
CHANGED
@@ -4,3 +4,11 @@ export * from './useDisclosure';
|
|
4
4
|
export * from './useCallbackRef';
|
5
5
|
export * from './useQRCode';
|
6
6
|
export * from './useSearchParams';
|
7
|
+
export * from './useDebounceValue';
|
8
|
+
export * from './useScript';
|
9
|
+
export * from './useThrottle';
|
10
|
+
export * from './useToggle';
|
11
|
+
export * from './useWindowScroll';
|
12
|
+
export * from './useWindowSize';
|
13
|
+
export * from './useIntersectionObserver';
|
14
|
+
export * from './useCounter';
|
package/dist/hooks/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{c as a,
|
1
|
+
"use strict";import{c as s,a,e,b as o,k as u,u as r,f as i,d as t,g as l,h as c,i as p,j as m}from"../shared/useIntersectionObserver-BX_TdOtC.mjs";import{u as n}from"../shared/useQRCode-DXiPIj-D.mjs";import{u as b}from"../shared/useCounter-BV32zXDQ.mjs";export{s as useCallbackRef,a as useCopyToClipboard,b as useCounter,e as useDebounceValue,o as useDisclosure,u as useIntersectionObserver,r as useLocalStorage,n as useQRCode,i as useScript,t as useSearchParams,l as useThrottle,c as useToggle,p as useWindowScroll,m as useWindowSize};
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { AnimationPlaybackControls } from 'framer-motion';
|
2
|
+
interface UseCounterProps {
|
3
|
+
from: number;
|
4
|
+
to: number;
|
5
|
+
map?: (value: number) => string;
|
6
|
+
duration?: number;
|
7
|
+
}
|
8
|
+
interface UseCounterReturn {
|
9
|
+
ref: React.RefObject<HTMLElement>;
|
10
|
+
controls: React.MutableRefObject<AnimationPlaybackControls | null>;
|
11
|
+
}
|
12
|
+
export declare function useCounter({ from, to, duration, map, }: UseCounterProps): UseCounterReturn;
|
13
|
+
export {};
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { RefObject } from 'react';
|
2
|
+
interface IntersectionResult {
|
3
|
+
isIntersecting: boolean;
|
4
|
+
entry: IntersectionObserverEntry | null;
|
5
|
+
}
|
6
|
+
interface UseIntersectionObserverOptions extends IntersectionObserverInit {
|
7
|
+
freezeOnceVisible?: boolean;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* Hook that tracks the intersection of a DOM element with its containing element or viewport
|
11
|
+
* @param elementRef - React ref object for the target element
|
12
|
+
* @param options - IntersectionObserver options with additional hook-specific options
|
13
|
+
* @returns Object containing intersection state and the latest IntersectionObserverEntry
|
14
|
+
*/
|
15
|
+
export declare function useIntersectionObserver(elementRef: RefObject<Element>, { threshold, root, rootMargin, freezeOnceVisible, }?: UseIntersectionObserverOptions): IntersectionResult;
|
16
|
+
export {};
|
@@ -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 {};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/**
|
2
|
+
* A hook that throttles a value by delaying its update for a specified time.
|
3
|
+
* @param value The value to be throttled.
|
4
|
+
* @param interval The interval in milliseconds.
|
5
|
+
* @returns The throttled value.
|
6
|
+
*/
|
7
|
+
export declare function useThrottle<T>(value: T, interval?: number): T;
|
@@ -0,0 +1,6 @@
|
|
1
|
+
/**
|
2
|
+
* Hook that returns a toggle state and a function to toggle it.
|
3
|
+
* @param initialValue The initial value of the toggle state.
|
4
|
+
* @returns A tuple containing the current state and a function to toggle it.
|
5
|
+
*/
|
6
|
+
export declare function useToggle<T>(initialValue: T): [boolean, (value: T) => void];
|
@@ -0,0 +1,11 @@
|
|
1
|
+
type ScrollToArgs = [ScrollToOptions] | [number, number];
|
2
|
+
/**
|
3
|
+
* Hook to manage window scroll position and scrolling behavior
|
4
|
+
* @returns Object containing current scroll position and scrollTo function
|
5
|
+
*/
|
6
|
+
export declare function useWindowScroll(): {
|
7
|
+
x: number;
|
8
|
+
y: number;
|
9
|
+
scrollTo: (...args: ScrollToArgs) => void;
|
10
|
+
};
|
11
|
+
export {};
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{A as n,a as i,g as
|
1
|
+
"use strict";import{A as n,a as i,g as l,e as m,B as u,C as c,d,D as h,E as p,F as g,I as S,O as f,P as D,Q as k,R as y,S as C,b,f as w,T as P,V as B,c as T,W as I,h as N,i as R,j as Y,o as v,p as F,s as M,u as W,v as x}from"./shared/index-w5CoDyk5.mjs";import{c as A,a as G,e as U,b as V,k as j,u as E,f as Q,d as z,g as O,h as q,i as H,j as L}from"./shared/useIntersectionObserver-BX_TdOtC.mjs";import{u as $}from"./shared/useQRCode-DXiPIj-D.mjs";import{u as J}from"./shared/useCounter-BV32zXDQ.mjs";import{b as K,a as X,v as Z,e as _,d as aa,p as sa,u as ea,h as ta,j as ra,g as oa,o as na,s as ia,m as la,c as ma,l as ua,n as ca,q as da,f as ha,i as pa,r as ga,z as Sa,t as fa,x as Da,k as ka,w as ya,y as Ca}from"./shared/shadows-fgmuXym6.mjs";import{masks as ba}from"./utils/masks/index.mjs";import{M as wa,S as Pa,U as Ba,d as Ta,e as Ia,f as Na,g as Ra,a as Ya,s as va}from"./shared/unix.schema-CMYTtXco.mjs";import{p as Fa}from"./shared/phone.schema-XBbyizhq.mjs";import{SnackbarProvider as Ma}from"notistack";async function Wa(s){try{return[await s,null]}catch(a){return[null,a]}}const xa=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("/")},Aa=s=>{const a=new Date(s);return a.setUTCHours(12),String(+a)},Ga=s=>s.replace(/(\d{3})-?(\d{2})-?(\d{4})/,"\u2022\u2022\u2022-\u2022\u2022-$3");export{n as AcceptTermsNotice,i as Alert,l as Backdrop,m as Banner,u as Button,c as CredentialRequestsEditor,d as CustomAlertComponent,h as DateInput,p as ExactBirthdayBanner,g as FullWidthAlert,S as Image,wa as MaskedAndUnmaskedSSNSchema,f as OTPInput,D as PhoneInput,k as QRCodeDisplay,y as ResendPhoneBanner,C as SSNInput,Pa as SSNSchema,b as SelectInput,Ma as SnackbarProvider,w as TestPhoneNumbersBanner,P as Typography,Ba as USDateSchema,B as VerifiedImage,T as VerifiedIncLogo,I as When,K as black,X as blue,Z as colors,N as countries,_ as darkBlue,aa as darkGreen,sa as darkGrey,ea as darkGreyContrast,ta as darkRed,ra as darkYellow,Ta as descriptionSchema,Ia as emailSchema,Na as fieldSchema,xa as formatDateMMDDYYYY,Aa as formatDateToTimestamp,Ra as getDateSchemaWithPastValidation,R as getPhoneData,Y as getPhoneDataByFieldName,Ya as getUnixSchema,oa as green,na as grey,ia as greyContrast,la as infoContrast,ma as lightBlue,ua as lightGreen,ca as lightGrey,da as lightGreyContrast,ha as lightRed,pa as lightYellow,ba as masks,v as omitProperties,F as parseToPhoneNational,Fa as phoneSchema,ga as red,Sa as shadows,M as sortByCountryName,Ga as ssnFormatter,va as stateSchema,fa as textDisabled,Da as theme,A as useCallbackRef,G as useCopyToClipboard,J as useCounter,U as useDebounceValue,V as useDisclosure,j as useIntersectionObserver,E as useLocalStorage,$ as useQRCode,Q as useScript,z as useSearchParams,W as useSnackbar,O as useThrottle,q as useToggle,H as useWindowScroll,L as useWindowSize,x as validatePhone,ka as warningContrast,ya as white,Wa as wrapPromise,Ca as yellow};
|