@onepercentio/one-ui 0.29.2 → 0.29.5
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/Switch/Switch.d.ts +1 -1
- package/dist/components/Switch/Switch.js +1 -1
- package/dist/hooks/useHero.js +3 -2
- package/dist-ts/components/Switch/Switch.d.ts +1 -1
- package/dist-ts/hooks/useHero.js +5 -4
- package/dist-ts/hooks/useHero.js.map +1 -1
- package/package.json +5 -1
- package/src/assets/img/svg/checkbox.svg +0 -3
- package/src/assets/styles/index.scss +0 -2
- package/src/assets/styles/mixins.scss +0 -12
- package/src/assets/styles/variables.scss +0 -49
- package/src/components/AdaptiveButton/AdaptiveButton.module.scss +0 -7
- package/src/components/AdaptiveButton/AdaptiveButton.tsx +0 -26
- package/src/components/AdaptiveButton/index.tsx +0 -2
- package/src/components/AdaptiveContainer/AdaptiveContainer.module.scss +0 -53
- package/src/components/AdaptiveContainer/AdaptiveContainer.tsx +0 -200
- package/src/components/AdaptiveContainer/index.tsx +0 -2
- package/src/components/AdaptiveDialog/AdaptiveDialog.module.scss +0 -147
- package/src/components/AdaptiveDialog/AdaptiveDialog.tsx +0 -97
- package/src/components/AdaptiveDialog/index.tsx +0 -2
- package/src/components/AdaptiveSidebar/AdaptiveSidebar.module.scss +0 -49
- package/src/components/AdaptiveSidebar/AdaptiveSidebar.sample.tsx +0 -10
- package/src/components/AdaptiveSidebar/AdaptiveSidebar.tsx +0 -123
- package/src/components/AdaptiveSidebar/index.tsx +0 -2
- package/src/components/AnchoredTooltip/AnchoredTooltip.module.scss +0 -64
- package/src/components/AnchoredTooltip/AnchoredTooltip.tsx +0 -250
- package/src/components/AnchoredTooltip/index.tsx +0 -2
- package/src/components/AnimatedEntrance/AnimatedEntrance.module.scss +0 -108
- package/src/components/AnimatedEntrance/AnimatedEntrance.tsx +0 -227
- package/src/components/AnimatedEntrance/index.tsx +0 -2
- package/src/components/AsyncWrapper/AsyncWrapper.tsx +0 -38
- package/src/components/AsyncWrapper/index.tsx +0 -2
- package/src/components/Avatar/Avatar.module.scss +0 -22
- package/src/components/Avatar/Avatar.tsx +0 -31
- package/src/components/Avatar/index.tsx +0 -2
- package/src/components/BucketFill/BucketFill.module.scss +0 -36
- package/src/components/BucketFill/BucketFill.tsx +0 -65
- package/src/components/BucketFill/index.tsx +0 -2
- package/src/components/Button/Button.module.scss +0 -45
- package/src/components/Button/Button.tsx +0 -40
- package/src/components/Button/index.tsx +0 -2
- package/src/components/Card/Card.module.scss +0 -12
- package/src/components/Card/Card.tsx +0 -9
- package/src/components/Card/index.tsx +0 -2
- package/src/components/Chart/Chart.e2e.ts +0 -4
- package/src/components/Chart/Chart.logic.tsx +0 -8
- package/src/components/Chart/Chart.module.scss +0 -58
- package/src/components/Chart/Chart.tsx +0 -2
- package/src/components/Chart/Chart.types.ts +0 -35
- package/src/components/Chart/Chart.view.tsx +0 -241
- package/src/components/Chart/index.tsx +0 -2
- package/src/components/CheckBox/CheckBox.module.scss +0 -36
- package/src/components/CheckBox/CheckBox.tsx +0 -63
- package/src/components/CheckBox/index.tsx +0 -2
- package/src/components/CodeInput/CodeInput.module.scss +0 -5
- package/src/components/CodeInput/CodeInput.tsx +0 -84
- package/src/components/CodeInput/index.tsx +0 -2
- package/src/components/Collapsable/Collapsable.module.scss +0 -42
- package/src/components/Collapsable/Collapsable.tsx +0 -253
- package/src/components/Collapsable/index.tsx +0 -2
- package/src/components/Countdown/Countdown.tsx +0 -130
- package/src/components/Countdown/index.tsx +0 -2
- package/src/components/CurrencyInput/CurrencyInput.hook.ts +0 -37
- package/src/components/CurrencyInput/CurrencyInput.tsx +0 -25
- package/src/components/CurrencyInput/index.tsx +0 -2
- package/src/components/Divider/Divider.module.scss +0 -7
- package/src/components/Divider/Divider.tsx +0 -13
- package/src/components/Divider/index.tsx +0 -2
- package/src/components/EmailInput/EmailInput.module.scss +0 -0
- package/src/components/EmailInput/EmailInput.tsx +0 -51
- package/src/components/EmailInput/index.tsx +0 -2
- package/src/components/FadeIn/FadeIn.module.scss +0 -9
- package/src/components/FadeIn/FadeIn.tsx +0 -77
- package/src/components/FadeIn/index.tsx +0 -2
- package/src/components/FileInput/FileInput.module.scss +0 -6
- package/src/components/FileInput/FileInput.tsx +0 -75
- package/src/components/FileInput/View/BigFactory/BigFactory.module.scss +0 -20
- package/src/components/FileInput/View/BigFactory/BigFactory.tsx +0 -48
- package/src/components/FileInput/View/BigFactory/index.tsx +0 -2
- package/src/components/FileInput/View/Compact/Compact.module.scss +0 -68
- package/src/components/FileInput/View/Compact/Compact.tsx +0 -151
- package/src/components/FileInput/View/Compact/index.tsx +0 -2
- package/src/components/FileInput/View/View.types.ts +0 -12
- package/src/components/FileInput/index.tsx +0 -2
- package/src/components/FlowController/FlowController.module.scss +0 -47
- package/src/components/FlowController/FlowController.tsx +0 -93
- package/src/components/FlowController/index.tsx +0 -2
- package/src/components/Form/Form.tsx +0 -243
- package/src/components/Form/index.ts +0 -2
- package/src/components/Form/v2/Form.hook.ts +0 -341
- package/src/components/Form/v2/Form.module.scss +0 -0
- package/src/components/Form/v2/Form.tsx +0 -78
- package/src/components/Form/v2/Form.types.ts +0 -118
- package/src/components/Form/v2/FormField/Extensions/DateField/DateField.module.scss +0 -0
- package/src/components/Form/v2/FormField/Extensions/DateField/DateField.tsx +0 -73
- package/src/components/Form/v2/FormField/Extensions/DateField/index.tsx +0 -2
- package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.module.scss +0 -0
- package/src/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.tsx +0 -91
- package/src/components/Form/v2/FormField/Extensions/PhoneField/index.tsx +0 -2
- package/src/components/Form/v2/FormField/FormField.module.scss +0 -0
- package/src/components/Form/v2/FormField/FormField.tsx +0 -378
- package/src/components/Form/v2/FormField/FormField.types.ts +0 -129
- package/src/components/Form/v2/FormField/index.tsx +0 -2
- package/src/components/Form/v2/index.tsx +0 -2
- package/src/components/Freeze/Freeze.tsx +0 -9
- package/src/components/Freeze/index.tsx +0 -2
- package/src/components/HSForms/HSForms.tsx +0 -57
- package/src/components/HSForms/index.tsx +0 -2
- package/src/components/Header/Header.module.scss +0 -119
- package/src/components/Header/Header.tsx +0 -138
- package/src/components/Header/index.tsx +0 -2
- package/src/components/HeaderCloseBtn/HeaderCloseBtn.module.scss +0 -44
- package/src/components/HeaderCloseBtn/HeaderCloseBtn.tsx +0 -28
- package/src/components/HeaderCloseBtn/index.tsx +0 -2
- package/src/components/InfinityScroll/InfinityScroll.module.scss +0 -30
- package/src/components/InfinityScroll/InfinityScroll.tsx +0 -187
- package/src/components/InfinityScroll/index.tsx +0 -2
- package/src/components/Input/Input.module.scss +0 -71
- package/src/components/Input/Input.tsx +0 -134
- package/src/components/Input/index.tsx +0 -2
- package/src/components/InstantCounter/InstantCounter.tsx +0 -77
- package/src/components/InstantCounter/index.tsx +0 -2
- package/src/components/LavaLamp/LavaLamp.data.tsx +0 -114
- package/src/components/LavaLamp/LavaLamp.module.scss +0 -26
- package/src/components/LavaLamp/LavaLamp.tsx +0 -131
- package/src/components/LavaLamp/index.tsx +0 -2
- package/src/components/LavaLamp/v2/LavaLamp.module.scss +0 -23
- package/src/components/LavaLamp/v2/LavaLamp.tsx +0 -197
- package/src/components/LinkToId/LinkToId.module.scss +0 -4
- package/src/components/LinkToId/LinkToId.tsx +0 -51
- package/src/components/LinkToId/index.tsx +0 -2
- package/src/components/Loader/Loader.module.scss +0 -40
- package/src/components/Loader/Loader.tsx +0 -18
- package/src/components/Loader/index.tsx +0 -2
- package/src/components/LoaderDotsIndicator/LoaderDotsIndicator.tsx +0 -34
- package/src/components/LoaderDotsIndicator/index.tsx +0 -2
- package/src/components/LoopableVideo/LoopableVideo.tsx +0 -37
- package/src/components/LoopableVideo/index.tsx +0 -2
- package/src/components/MainGrid/MainGrid.module.scss +0 -28
- package/src/components/MainGrid/MainGrid.tsx +0 -68
- package/src/components/MainGrid/index.tsx +0 -2
- package/src/components/MutableHamburgerButton/MutableHamburgerButton.module.scss +0 -220
- package/src/components/MutableHamburgerButton/MutableHamburgerButton.tsx +0 -38
- package/src/components/MutableHamburgerButton/index.tsx +0 -2
- package/src/components/Notification/Notification.module.scss +0 -25
- package/src/components/Notification/Notification.tsx +0 -13
- package/src/components/Notification/index.tsx +0 -2
- package/src/components/OrderableList/OrderableList.module.scss +0 -98
- package/src/components/OrderableList/OrderableList.tsx +0 -564
- package/src/components/OrderableList/index.tsx +0 -2
- package/src/components/PaginationIndicator/PaginationIndicator.tsx +0 -365
- package/src/components/PaginationIndicator/index.tsx +0 -2
- package/src/components/Parallax/Parallax.module.scss +0 -28
- package/src/components/Parallax/Parallax.tsx +0 -225
- package/src/components/Parallax/index.tsx +0 -2
- package/src/components/Parallax/math/helpers.ts +0 -289
- package/src/components/PasswordInput/PasswordInput.module.scss +0 -17
- package/src/components/PasswordInput/PasswordInput.tsx +0 -154
- package/src/components/PasswordInput/index.tsx +0 -2
- package/src/components/PingPongText/PingPongText.module.scss +0 -4
- package/src/components/PingPongText/PingPongText.tsx +0 -83
- package/src/components/PingPongText/index.tsx +0 -2
- package/src/components/PixelatedScan/PixelatedScan.module.scss +0 -86
- package/src/components/PixelatedScan/PixelatedScan.tsx +0 -175
- package/src/components/PixelatedScan/index.tsx +0 -2
- package/src/components/Portal/Portal.module.scss +0 -3
- package/src/components/Portal/Portal.tsx +0 -68
- package/src/components/Portal/index.tsx +0 -2
- package/src/components/ProgressBar/ProgressBar.module.scss +0 -44
- package/src/components/ProgressBar/ProgressBar.tsx +0 -124
- package/src/components/ProgressBar/index.tsx +0 -2
- package/src/components/ProgressTexts/ProgressTexts.module.scss +0 -37
- package/src/components/ProgressTexts/ProgressTexts.tsx +0 -85
- package/src/components/ProgressTexts/index.tsx +0 -2
- package/src/components/Radio/Radio.module.scss +0 -36
- package/src/components/Radio/Radio.tsx +0 -53
- package/src/components/Radio/index.tsx +0 -2
- package/src/components/SectionContainer/SectionContainer.module.scss +0 -30
- package/src/components/SectionContainer/SectionContainer.tsx +0 -49
- package/src/components/SectionContainer/index.tsx +0 -2
- package/src/components/Select/Select.module.scss +0 -58
- package/src/components/Select/Select.tsx +0 -192
- package/src/components/Select/index.tsx +0 -2
- package/src/components/Skeleton/Skeleton.module.scss +0 -21
- package/src/components/Skeleton/Skeleton.tsx +0 -29
- package/src/components/Skeleton/index.tsx +0 -2
- package/src/components/Spacing/Spacing.module.scss +0 -13
- package/src/components/Spacing/Spacing.tsx +0 -24
- package/src/components/Spacing/index.tsx +0 -2
- package/src/components/StaticScroller/StaticScroller.module.scss +0 -14
- package/src/components/StaticScroller/StaticScroller.tsx +0 -83
- package/src/components/StaticScroller/index.tsx +0 -2
- package/src/components/Switch/Switch.module.scss +0 -43
- package/src/components/Switch/Switch.tsx +0 -41
- package/src/components/Switch/index.tsx +0 -2
- package/src/components/Table/Table.module.scss +0 -76
- package/src/components/Table/Table.tsx +0 -152
- package/src/components/Table/index.tsx +0 -2
- package/src/components/Tabs/Tabs.module.scss +0 -40
- package/src/components/Tabs/Tabs.tsx +0 -104
- package/src/components/Tabs/index.tsx +0 -2
- package/src/components/Text/Text.module.scss +0 -81
- package/src/components/Text/Text.tsx +0 -42
- package/src/components/Text/index.tsx +0 -2
- package/src/components/Transition/MasksFactory/DiagonalReveal.tsx +0 -47
- package/src/components/Transition/MasksFactory/DiagonalSquareToBalls.tsx +0 -78
- package/src/components/Transition/MasksFactory/PhysicsSquares.tsx +0 -106
- package/src/components/Transition/MasksFactory/SquareToBalls.tsx +0 -66
- package/src/components/Transition/MasksFactory/utils.ts +0 -35
- package/src/components/Transition/Transition.module.scss +0 -211
- package/src/components/Transition/Transition.tsx +0 -495
- package/src/components/Transition/index.tsx +0 -2
- package/src/components/UncontrolledTransition/UncontrolledTransition.ai.md +0 -9
- package/src/components/UncontrolledTransition/UncontrolledTransition.sample.tsx +0 -34
- package/src/components/UncontrolledTransition/UncontrolledTransition.tsx +0 -143
- package/src/components/UncontrolledTransition/index.tsx +0 -2
- package/src/components/WalletConnectionWrapper/WalletConnectionWrapper.tsx +0 -212
- package/src/components/WalletConnectionWrapper/index.tsx +0 -2
- package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.module.scss +0 -5
- package/src/components/utilitary/ScrollAndFocusLock/ScrollAndFocusLock.tsx +0 -52
- package/src/components/utilitary/ScrollAndFocusLock/index.tsx +0 -2
- package/src/context/AsyncProcess.tsx +0 -107
- package/src/context/ContextAsyncControl.tsx +0 -89
- package/src/context/CustomBrowserRouter.tsx +0 -55
- package/src/context/OneUIProvider.tsx +0 -308
- package/src/hooks/logs/useDependencyChangeDetection.ts +0 -25
- package/src/hooks/logs/useIsMounting.ts +0 -7
- package/src/hooks/persistence/useLocalStorage.ts +0 -45
- package/src/hooks/shims/ObjectWatchShim.ts +0 -56
- package/src/hooks/ui/useAdaptiveImage.tsx +0 -36
- package/src/hooks/ui/useAlternating.tsx +0 -22
- package/src/hooks/ui/useBreakpoint.tsx +0 -21
- package/src/hooks/ui/useCustomScrollbar.module.scss +0 -20
- package/src/hooks/ui/useCustomScrollbar.tsx +0 -22
- package/src/hooks/ui/useEffectIf.ts +0 -11
- package/src/hooks/ui/useMouseHover.tsx +0 -26
- package/src/hooks/ui/usePaginationControls.module.scss +0 -16
- package/src/hooks/ui/usePaginationControls.tsx +0 -176
- package/src/hooks/ui/useSnapToViewport.module.scss +0 -6
- package/src/hooks/ui/useSnapToViewport.ts +0 -28
- package/src/hooks/ui/useTilt.tsx +0 -219
- package/src/hooks/ui/useZoomable.module.scss +0 -34
- package/src/hooks/ui/useZoomable.tsx +0 -144
- package/src/hooks/useAsyncControl.ai.md +0 -25
- package/src/hooks/useAsyncControl.ts +0 -101
- package/src/hooks/useContainedRepositioning.ts +0 -110
- package/src/hooks/useCustomHistory.ts +0 -14
- package/src/hooks/useElementFit.ts +0 -82
- package/src/hooks/useFirestoreWatch.ts +0 -54
- package/src/hooks/useForm.ts +0 -49
- package/src/hooks/useFreeze.ts +0 -12
- package/src/hooks/useHero.module.scss +0 -41
- package/src/hooks/useHero.ts +0 -512
- package/src/hooks/useIntersection.ts +0 -32
- package/src/hooks/useMergeRefs.ts +0 -29
- package/src/hooks/useObserve.ts +0 -24
- package/src/hooks/usePagination.ts +0 -228
- package/src/hooks/usePooledOperation.ts +0 -54
- package/src/hooks/usePooling.ts +0 -46
- package/src/hooks/useRebound.ts +0 -23
- package/src/hooks/useShortIntl.ai.md +0 -5
- package/src/hooks/useShortIntl.ts +0 -97
- package/src/hooks/utility/useAsyncMemo.ts +0 -43
- package/src/hooks/utility/useDepChange.ts +0 -11
- package/src/hooks/utility/useEvents.ts +0 -33
- package/src/hooks/utility/useImmediate.ts +0 -8
- package/src/hooks/utility/useManualInit.ts +0 -24
- package/src/hooks/utility/useModule.ts +0 -15
- package/src/hooks/utility/useQuery.ts +0 -15
- package/src/hooks/utility/useUniqueEffect.ts +0 -22
- package/src/index.preprocess.ts +0 -82
- package/src/index.ts +0 -229
- package/src/models/DebugLogger.ts +0 -7
- package/src/models/GenericContract.ts +0 -169
- package/src/models/Orbs.ts +0 -97
- package/src/reac-app-env.d.ts +0 -6
- package/src/storybook/assets/video/txt-reversed.mp4 +0 -0
- package/src/storybookUtils/index.tsx +0 -53
- package/src/test.tsx +0 -0
- package/src/type-utils.ts +0 -49
- package/src/types.ts +0 -199
- package/src/utility.d.ts +0 -70
- package/src/utils/blockchain.ts +0 -43
- package/src/utils/e2e.ts +0 -55
- package/src/utils/flatten.ts +0 -17
- package/src/utils/formatters.ts +0 -36
- package/src/utils/html.utils.ts +0 -3
- package/src/utils/ownEvent.ts +0 -8
- package/src/utils/test.ts +0 -20
package/src/type-utils.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
type FieldValues = any;
|
|
2
|
-
type NestedValue = any;
|
|
3
|
-
export declare type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
4
|
-
export declare type EmptyObject = {
|
|
5
|
-
[K in string | number]: never;
|
|
6
|
-
};
|
|
7
|
-
export declare type NonUndefined<T> = T extends undefined ? never : T;
|
|
8
|
-
export declare type LiteralUnion<T extends U, U extends Primitive> = T | (U & {
|
|
9
|
-
_?: never;
|
|
10
|
-
});
|
|
11
|
-
export declare type DeepPartial<T> = T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
12
|
-
[key in keyof T]: T[key];
|
|
13
|
-
} ? {
|
|
14
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
15
|
-
} : T;
|
|
16
|
-
export declare type IsAny<T> = boolean extends (T extends never ? true : false) ? true : false;
|
|
17
|
-
export declare type DeepMap<T, TValue> = {
|
|
18
|
-
[K in keyof T]?: IsAny<T[K]> extends true ? any : NonNullable<T[K]> extends NestedValue | Date | FileList | File ? TValue : NonUndefined<T[K]> extends object | null ? DeepMap<T[K], TValue> : NonUndefined<T[K]> extends Array<infer U> ? IsAny<U> extends true ? Array<any> : U extends NestedValue | Date | FileList ? Array<TValue> : U extends object ? Array<DeepMap<U, TValue>> : Array<TValue> : TValue;
|
|
19
|
-
};
|
|
20
|
-
export declare type IsFlatObject<T extends object> = Extract<Exclude<T[keyof T], NestedValue | Date | FileList>, any[] | object> extends never ? true : false;
|
|
21
|
-
declare type IsTuple<T extends ReadonlyArray<any>> = number extends T['length'] ? false : true;
|
|
22
|
-
declare type TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, keyof any[]>;
|
|
23
|
-
declare type ArrayKey = number;
|
|
24
|
-
declare type PathImpl<K extends string | number, V> = V extends Primitive ? `${K}` : `${K}` | `${K}.${Path<V>}`;
|
|
25
|
-
export declare type Path<T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
26
|
-
[K in TupleKey<T>]-?: PathImpl<K & string, T[K]>;
|
|
27
|
-
}[TupleKey<T>] : PathImpl<ArrayKey, V> : {
|
|
28
|
-
[K in keyof T]-?: PathImpl<K & string, T[K]>;
|
|
29
|
-
}[keyof T];
|
|
30
|
-
export declare type FieldPath<TFieldValues extends FieldValues> = Path<TFieldValues>;
|
|
31
|
-
declare type ArrayPathImpl<K extends string | number, V> = V extends Primitive ? never : V extends ReadonlyArray<infer U> ? U extends Primitive ? never : `${K}` | `${K}.${ArrayPath<V>}` : `${K}.${ArrayPath<V>}`;
|
|
32
|
-
export declare type ArrayPath<T> = T extends ReadonlyArray<infer V> ? IsTuple<T> extends true ? {
|
|
33
|
-
[K in TupleKey<T>]-?: ArrayPathImpl<K & string, T[K]>;
|
|
34
|
-
}[TupleKey<T>] : ArrayPathImpl<ArrayKey, V> : {
|
|
35
|
-
[K in keyof T]-?: ArrayPathImpl<K & string, T[K]>;
|
|
36
|
-
}[keyof T];
|
|
37
|
-
export declare type FieldArrayPath<TFieldValues extends FieldValues> = ArrayPath<TFieldValues>;
|
|
38
|
-
export declare type PathValue<T, P extends Path<T> | ArrayPath<T>> = P extends `${infer K}.${infer R}` ? K extends keyof T ? R extends Path<T[K]> ? PathValue<T[K], R> : never : K extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? PathValue<V, R & Path<V>> : never : never : P extends keyof T ? T[P] : P extends `${ArrayKey}` ? T extends ReadonlyArray<infer V> ? V : never : never;
|
|
39
|
-
export declare type FieldPathValue<TFieldValues extends FieldValues, TFieldPath extends FieldPath<TFieldValues>> = PathValue<TFieldValues, TFieldPath>;
|
|
40
|
-
export declare type FieldArrayPathValue<TFieldValues extends FieldValues, TFieldArrayPath extends FieldArrayPath<TFieldValues>> = PathValue<TFieldValues, TFieldArrayPath>;
|
|
41
|
-
export declare type FieldPathValues<TFieldValues extends FieldValues, TPath extends FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[]> = {} & {
|
|
42
|
-
[K in keyof TPath]: FieldPathValue<TFieldValues, TPath[K] & FieldPath<TFieldValues>>;
|
|
43
|
-
};
|
|
44
|
-
/**
|
|
45
|
-
* Returns the type U when this type is resolved
|
|
46
|
-
* Or the fallback type F when type is no resolved
|
|
47
|
-
*/
|
|
48
|
-
export declare type UnresolvableOr<U, F> = keyof U extends U ? F : U
|
|
49
|
-
export {};
|
package/src/types.ts
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
type PrependNextNum<A extends Array<unknown>> = A["length"] extends infer T
|
|
2
|
-
? ((t: T, ...a: A) => void) extends (...x: infer X) => void
|
|
3
|
-
? X
|
|
4
|
-
: never
|
|
5
|
-
: never;
|
|
6
|
-
|
|
7
|
-
type EnumerateInternal<A extends Array<unknown>, N extends number> = {
|
|
8
|
-
0: A;
|
|
9
|
-
1: EnumerateInternal<PrependNextNum<A>, N>;
|
|
10
|
-
}[N extends A["length"] ? 0 : 1];
|
|
11
|
-
|
|
12
|
-
export type Enumerate<N extends number> = EnumerateInternal<
|
|
13
|
-
[],
|
|
14
|
-
N
|
|
15
|
-
> extends (infer E)[]
|
|
16
|
-
? E
|
|
17
|
-
: never;
|
|
18
|
-
|
|
19
|
-
export type Range<FROM extends number, TO extends number> = Exclude<
|
|
20
|
-
Enumerate<TO>,
|
|
21
|
-
Enumerate<FROM>
|
|
22
|
-
>;
|
|
23
|
-
|
|
24
|
-
export type CommonErrorCodes = "UNEXPECTED_ERROR";
|
|
25
|
-
|
|
26
|
-
type Decompose<O extends object> = O;
|
|
27
|
-
|
|
28
|
-
export type BasicContext<T extends object> = {
|
|
29
|
-
set: <P extends keyof T>(p: P, value: T[typeof p]) => void;
|
|
30
|
-
} & T;
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* This is usefull for omitting props from union
|
|
34
|
-
* Check whz contestation model to see an example
|
|
35
|
-
*
|
|
36
|
-
* If different models with different properties use the native Omit<O>
|
|
37
|
-
* Their differences are also omitted generating a single model
|
|
38
|
-
*
|
|
39
|
-
* This typing solves that
|
|
40
|
-
*/
|
|
41
|
-
export type DistributiveOmit<T, K extends keyof any> = T extends any
|
|
42
|
-
? Omit<T, K>
|
|
43
|
-
: never;
|
|
44
|
-
|
|
45
|
-
declare global {
|
|
46
|
-
interface Window {
|
|
47
|
-
ethereum: import("@metamask/providers").MetaMaskInpageProvider | undefined;
|
|
48
|
-
PRERENDER: boolean;
|
|
49
|
-
Cypress: any;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
type NestedValue = unknown;
|
|
53
|
-
type FieldValues = unknown;
|
|
54
|
-
|
|
55
|
-
export declare type Primitive =
|
|
56
|
-
| null
|
|
57
|
-
| undefined
|
|
58
|
-
| string
|
|
59
|
-
| number
|
|
60
|
-
| boolean
|
|
61
|
-
| symbol
|
|
62
|
-
| bigint;
|
|
63
|
-
export declare type EmptyObject = {
|
|
64
|
-
[K in string | number]: never;
|
|
65
|
-
};
|
|
66
|
-
export declare type NonUndefined<T> = T extends undefined ? never : T;
|
|
67
|
-
export declare type LiteralUnion<T extends U, U extends Primitive> =
|
|
68
|
-
| T
|
|
69
|
-
| (U & {
|
|
70
|
-
_?: never;
|
|
71
|
-
});
|
|
72
|
-
export declare type DeepPartial<T> = T extends Array<infer U>
|
|
73
|
-
? Array<DeepPartial<U>>
|
|
74
|
-
: T extends ReadonlyArray<infer U>
|
|
75
|
-
? ReadonlyArray<DeepPartial<U>>
|
|
76
|
-
: T extends {
|
|
77
|
-
[key in keyof T]: T[key];
|
|
78
|
-
}
|
|
79
|
-
? {
|
|
80
|
-
[K in keyof T]?: DeepPartial<T[K]>;
|
|
81
|
-
}
|
|
82
|
-
: T;
|
|
83
|
-
export declare type IsAny<T> = boolean extends (T extends never ? true : false)
|
|
84
|
-
? true
|
|
85
|
-
: false;
|
|
86
|
-
export declare type DeepMap<T, TValue> = {
|
|
87
|
-
[K in keyof T]?: IsAny<T[K]> extends true
|
|
88
|
-
? any
|
|
89
|
-
: NonNullable<T[K]> extends NestedValue | Date | FileList | File
|
|
90
|
-
? TValue
|
|
91
|
-
: NonUndefined<T[K]> extends object | null
|
|
92
|
-
? DeepMap<T[K], TValue>
|
|
93
|
-
: NonUndefined<T[K]> extends Array<infer U>
|
|
94
|
-
? IsAny<U> extends true
|
|
95
|
-
? Array<any>
|
|
96
|
-
: U extends NestedValue | Date | FileList
|
|
97
|
-
? Array<TValue>
|
|
98
|
-
: U extends object
|
|
99
|
-
? Array<DeepMap<U, TValue>>
|
|
100
|
-
: Array<TValue>
|
|
101
|
-
: TValue;
|
|
102
|
-
};
|
|
103
|
-
export declare type IsFlatObject<T extends object> = Extract<
|
|
104
|
-
Exclude<T[keyof T], NestedValue | Date | FileList>,
|
|
105
|
-
any[] | object
|
|
106
|
-
> extends never
|
|
107
|
-
? true
|
|
108
|
-
: false;
|
|
109
|
-
declare type IsTuple<T extends ReadonlyArray<any>> = number extends T["length"]
|
|
110
|
-
? false
|
|
111
|
-
: true;
|
|
112
|
-
declare type TupleKey<T extends ReadonlyArray<any>> = Exclude<
|
|
113
|
-
keyof T,
|
|
114
|
-
keyof any[]
|
|
115
|
-
>;
|
|
116
|
-
declare type ArrayKey = number;
|
|
117
|
-
declare type PathImpl<K extends string | number, V> = V extends Primitive
|
|
118
|
-
? `${K}`
|
|
119
|
-
: `${K}.${Path<V>}`;
|
|
120
|
-
export declare type Path<T> = T extends ReadonlyArray<infer V>
|
|
121
|
-
? IsTuple<T> extends true
|
|
122
|
-
? {
|
|
123
|
-
[K in TupleKey<T>]-?: PathImpl<K & string, T[K]>;
|
|
124
|
-
}[TupleKey<T>]
|
|
125
|
-
: PathImpl<ArrayKey, V>
|
|
126
|
-
: {
|
|
127
|
-
[K in keyof T]-?: PathImpl<K & string, T[K]>;
|
|
128
|
-
}[keyof T];
|
|
129
|
-
export declare type FieldPath<TFieldValues extends FieldValues> =
|
|
130
|
-
Path<TFieldValues>;
|
|
131
|
-
declare type ArrayPathImpl<K extends string | number, V> = V extends Primitive
|
|
132
|
-
? never
|
|
133
|
-
: V extends ReadonlyArray<infer U>
|
|
134
|
-
? U extends Primitive
|
|
135
|
-
? never
|
|
136
|
-
: `${K}` | `${K}.${ArrayPath<V>}`
|
|
137
|
-
: `${K}.${ArrayPath<V>}`;
|
|
138
|
-
export declare type ArrayPath<T> = T extends ReadonlyArray<infer V>
|
|
139
|
-
? IsTuple<T> extends true
|
|
140
|
-
? {
|
|
141
|
-
[K in TupleKey<T>]-?: ArrayPathImpl<K & string, T[K]>;
|
|
142
|
-
}[TupleKey<T>]
|
|
143
|
-
: ArrayPathImpl<ArrayKey, V>
|
|
144
|
-
: {
|
|
145
|
-
[K in keyof T]-?: ArrayPathImpl<K & string, T[K]>;
|
|
146
|
-
}[keyof T];
|
|
147
|
-
export declare type FieldArrayPath<TFieldValues extends FieldValues> =
|
|
148
|
-
ArrayPath<TFieldValues>;
|
|
149
|
-
export declare type PathValue<T, P extends Path<T> | ArrayPath<T>> =
|
|
150
|
-
P extends `${infer K}.${infer R}`
|
|
151
|
-
? K extends keyof T
|
|
152
|
-
? R extends Path<T[K]>
|
|
153
|
-
? PathValue<T[K], R>
|
|
154
|
-
: never
|
|
155
|
-
: K extends `${ArrayKey}`
|
|
156
|
-
? T extends ReadonlyArray<infer V>
|
|
157
|
-
? PathValue<V, R & Path<V>>
|
|
158
|
-
: never
|
|
159
|
-
: never
|
|
160
|
-
: P extends keyof T
|
|
161
|
-
? T[P]
|
|
162
|
-
: P extends `${ArrayKey}`
|
|
163
|
-
? T extends ReadonlyArray<infer V>
|
|
164
|
-
? V
|
|
165
|
-
: never
|
|
166
|
-
: never;
|
|
167
|
-
export declare type FieldPathValue<
|
|
168
|
-
TFieldValues extends FieldValues,
|
|
169
|
-
TFieldPath extends FieldPath<TFieldValues>
|
|
170
|
-
> = PathValue<TFieldValues, TFieldPath>;
|
|
171
|
-
export declare type FieldArrayPathValue<
|
|
172
|
-
TFieldValues extends FieldValues,
|
|
173
|
-
TFieldArrayPath extends FieldArrayPath<TFieldValues>
|
|
174
|
-
> = PathValue<TFieldValues, TFieldArrayPath>;
|
|
175
|
-
export declare type FieldPathValues<
|
|
176
|
-
TFieldValues extends FieldValues,
|
|
177
|
-
TPath extends FieldPath<TFieldValues>[] | readonly FieldPath<TFieldValues>[]
|
|
178
|
-
> = {} & {
|
|
179
|
-
[K in keyof TPath]: FieldPathValue<
|
|
180
|
-
TFieldValues,
|
|
181
|
-
TPath[K] & FieldPath<TFieldValues>
|
|
182
|
-
>;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
export type ToFirebaseType<B> = {
|
|
186
|
-
[k in keyof B]: B[k] extends Date
|
|
187
|
-
? import("firebase/firestore").Timestamp
|
|
188
|
-
: B[k] extends Object
|
|
189
|
-
? ToFirebaseType<B[k]>
|
|
190
|
-
: B[k];
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
export type FromFirebaseType<B> = {
|
|
194
|
-
[k in keyof B]: B[k] extends import("firebase/firestore").Timestamp
|
|
195
|
-
? Date
|
|
196
|
-
: B[k] extends Object
|
|
197
|
-
? FromFirebaseType<B[k]>
|
|
198
|
-
: B[k];
|
|
199
|
-
};
|
package/src/utility.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* These are typings made to support separated function and prevent excessive Generics usage accross the application
|
|
3
|
-
*
|
|
4
|
-
* Redeclare this namespace with the usefull typings for your project and enjoy intelisense :)
|
|
5
|
-
*/
|
|
6
|
-
namespace OnepercentUtility {
|
|
7
|
-
/** The ids used by the useShortIntl hooks */
|
|
8
|
-
type IntlIds = "generic.id";
|
|
9
|
-
/** A type hint to bind the LinkToId action and the SectionContainer identifier */
|
|
10
|
-
type PageSections = "example-section-1";
|
|
11
|
-
/** A type hint to autocomplete functions related to the AsyncProcess context */
|
|
12
|
-
namespace AsyncQueue {
|
|
13
|
-
/** These are the recovery types available */
|
|
14
|
-
type RecoveryTypes = {
|
|
15
|
-
[R: string]: any[];
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/** These are the available UI models */
|
|
19
|
-
type Processes = {
|
|
20
|
-
[k in "waitForBuild"]: [thash: string];
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
/** These are the extensible properties for the UI elements */
|
|
24
|
-
namespace UIElements {
|
|
25
|
-
type AdaptiveDialogVariants = "default";
|
|
26
|
-
type ButtonVariants = "transparent" | "filled" | "outline" | "link";
|
|
27
|
-
type TextVariants =
|
|
28
|
-
| "title"
|
|
29
|
-
| "description"
|
|
30
|
-
| "error"
|
|
31
|
-
| "caption"
|
|
32
|
-
| "highlightTitle"
|
|
33
|
-
| "highlight"
|
|
34
|
-
| "subtitle"
|
|
35
|
-
| "boldTitle"
|
|
36
|
-
| "link"
|
|
37
|
-
| "boldTitleBig"
|
|
38
|
-
| "content";
|
|
39
|
-
type SpacingVariants = "large" | "small";
|
|
40
|
-
type TextColors = "primary" | "error" | undefined;
|
|
41
|
-
type FormExtension = {
|
|
42
|
-
fields:
|
|
43
|
-
| {
|
|
44
|
-
type: "phone";
|
|
45
|
-
country: string;
|
|
46
|
-
}
|
|
47
|
-
| {
|
|
48
|
-
type: "date";
|
|
49
|
-
};
|
|
50
|
-
fieldAnswer: {
|
|
51
|
-
phone: [
|
|
52
|
-
phoneNumber: string,
|
|
53
|
-
isValid: boolean,
|
|
54
|
-
error: string | undefined
|
|
55
|
-
];
|
|
56
|
-
date: string
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
declare module "use-wallet" {
|
|
62
|
-
import * as UseWallet from "use-wallet";
|
|
63
|
-
export const useWallet: typeof UseWallet["use-wallet"];
|
|
64
|
-
export const UseWalletProvider: typeof UseWallet["UseWalletProvider"];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
declare module "*.mp4" {
|
|
68
|
-
const v: string;
|
|
69
|
-
export default v;
|
|
70
|
-
}
|
package/src/utils/blockchain.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { PromiEvent } from 'web3-core'
|
|
2
|
-
|
|
3
|
-
export async function isTransactionMined(transactionHash: string, provider: any) {
|
|
4
|
-
const transaction = await provider.eth.getTransactionReceipt(transactionHash)
|
|
5
|
-
|
|
6
|
-
if (
|
|
7
|
-
!transaction ||
|
|
8
|
-
!transaction.blockHash ||
|
|
9
|
-
transaction.status === undefined
|
|
10
|
-
)
|
|
11
|
-
return undefined // I still don't know if it's loaded
|
|
12
|
-
else return !!transaction.status === true
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export async function waitForConfirmation(tHash: string, provider: any) {
|
|
16
|
-
return new Promise<void>(async (r, rej) => {
|
|
17
|
-
while (true) {
|
|
18
|
-
const bought = await isTransactionMined(tHash, provider)
|
|
19
|
-
if (bought === undefined)
|
|
20
|
-
await new Promise<void>((r) => setTimeout(() => r(), 2000))
|
|
21
|
-
else {
|
|
22
|
-
if (bought) r()
|
|
23
|
-
else rej('TRANSACTION_FAILED')
|
|
24
|
-
break
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function dispatchAndWait(func: any) {
|
|
31
|
-
const _func = func as PromiEvent<any>
|
|
32
|
-
return new Promise<string>((r, rej) => {
|
|
33
|
-
_func.on('transactionHash', (tX) => {
|
|
34
|
-
r(tX)
|
|
35
|
-
})
|
|
36
|
-
_func.catch(rej)
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export async function sendAndWaitForConfirmation(func: Promise<void>, provider: any) {
|
|
41
|
-
const tHash = await dispatchAndWait(func)
|
|
42
|
-
await waitForConfirmation(tHash, provider)
|
|
43
|
-
}
|
package/src/utils/e2e.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import Module from "module";
|
|
2
|
-
|
|
3
|
-
function toSrcPath(str: string) {
|
|
4
|
-
const indexOfSrc = str.indexOf("src");
|
|
5
|
-
const modName = indexOfSrc === -1 ? str : str.slice(indexOfSrc);
|
|
6
|
-
return modName.replace("appclientecmascript", "");
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/** Try to make the string follow the snake case pattern (e.g. "SOME_ELEMENT") */
|
|
10
|
-
type IDENTIFIER = string
|
|
11
|
-
|
|
12
|
-
type PossibleT = (
|
|
13
|
-
| IDENTIFIER
|
|
14
|
-
| readonly [id: IDENTIFIER, func: (n: number) => `${string}-${number}`]
|
|
15
|
-
)[];
|
|
16
|
-
|
|
17
|
-
type T<IDS extends PossibleT> = {
|
|
18
|
-
[I in IDS[number] extends string
|
|
19
|
-
? IDS[number]
|
|
20
|
-
: IDS[number][0]]: I extends IDS[number] ? string : (id: any) => string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export function combineTestIds(...t: ReturnType<typeof testIDFactory>[]) {
|
|
24
|
-
return t.reduce((acc, i) => ({ ...acc, i }), {});
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Creates an data-testid map generator instance based on the module name or arbitrary id
|
|
29
|
-
* @returns A function to set the IDs that this created instance will provide
|
|
30
|
-
*/
|
|
31
|
-
export function testIDFactory(moduleOrId: Pick<Module, "id"> | string) {
|
|
32
|
-
const moduleId = typeof moduleOrId === "string" ? moduleOrId : moduleOrId.id;
|
|
33
|
-
return <const IDS extends PossibleT>(idsArr: IDS) =>
|
|
34
|
-
[idsArr].reduce(
|
|
35
|
-
(acc, ids) => ({
|
|
36
|
-
...acc,
|
|
37
|
-
...ids.reduce(
|
|
38
|
-
(map, id) => ({
|
|
39
|
-
...map,
|
|
40
|
-
[typeof id === "string" ? id : id[0]]:
|
|
41
|
-
typeof id === "string"
|
|
42
|
-
? `${toSrcPath(
|
|
43
|
-
moduleId.toLowerCase().replace(/[^a-z]/g, "")
|
|
44
|
-
)}-${id}`
|
|
45
|
-
: (i: any) =>
|
|
46
|
-
`${toSrcPath(
|
|
47
|
-
moduleId.toLowerCase().replace(/[^a-z]/g, "")
|
|
48
|
-
)}-${id[1](i)}`,
|
|
49
|
-
}),
|
|
50
|
-
{} as T<IDS>
|
|
51
|
-
),
|
|
52
|
-
}),
|
|
53
|
-
{} as T<IDS>
|
|
54
|
-
);
|
|
55
|
-
}
|
package/src/utils/flatten.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FieldPath } from "../types";
|
|
2
|
-
|
|
3
|
-
export function flatten<T extends object>(obj: T): { [k in FieldPath<T>]: string } {
|
|
4
|
-
return Object.assign(
|
|
5
|
-
{},
|
|
6
|
-
...(function _flatten(o, prevKey: string = ""): any {
|
|
7
|
-
return [].concat(
|
|
8
|
-
...Object.keys(o).map((_k) => {
|
|
9
|
-
const k = _k as keyof typeof o;
|
|
10
|
-
return typeof o[k] === "object"
|
|
11
|
-
? _flatten(o[k] as any, prevKey ? `${prevKey}.${k as string}` : (k as string))
|
|
12
|
-
: { [prevKey ? `${prevKey}.${k as string}` : k]: o[k] };
|
|
13
|
-
})
|
|
14
|
-
);
|
|
15
|
-
})(obj)
|
|
16
|
-
);
|
|
17
|
-
}
|
package/src/utils/formatters.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A formatter to format to double decimal
|
|
3
|
-
*/
|
|
4
|
-
export const currencyNumberFormatter = new Intl.NumberFormat("pt-BR", {
|
|
5
|
-
minimumFractionDigits: 2,
|
|
6
|
-
maximumFractionDigits: 2,
|
|
7
|
-
}).format;
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Instanciate a currency formatter
|
|
11
|
-
*/
|
|
12
|
-
export const currencyFormatterFactory = (
|
|
13
|
-
langCode: string,
|
|
14
|
-
currency?: string
|
|
15
|
-
) => {
|
|
16
|
-
try {
|
|
17
|
-
return new Intl.NumberFormat(langCode, {
|
|
18
|
-
style: "currency",
|
|
19
|
-
currency: currency,
|
|
20
|
-
});
|
|
21
|
-
} catch (e) {
|
|
22
|
-
const f = new Intl.NumberFormat(langCode, {
|
|
23
|
-
minimumFractionDigits: 2,
|
|
24
|
-
maximumFractionDigits: 2,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
format: (num: number) => `${currency} ${currencyNumberFormatter(num)}`,
|
|
29
|
-
formatToParts: (num: number) => [
|
|
30
|
-
{ type: "currency", value: currency },
|
|
31
|
-
{ type: "literal", value: " " },
|
|
32
|
-
...f.formatToParts(num),
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
};
|
package/src/utils/html.utils.ts
DELETED
package/src/utils/ownEvent.ts
DELETED
package/src/utils/test.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
type Func = (...args: any[]) => string
|
|
2
|
-
|
|
3
|
-
/** @deprecated Preffer ./e2e.ts's test ids generator */
|
|
4
|
-
export const preffixTestIds =
|
|
5
|
-
(preffix: string) =>
|
|
6
|
-
<
|
|
7
|
-
const M extends {
|
|
8
|
-
[k: string]: string | Func
|
|
9
|
-
}
|
|
10
|
-
>(
|
|
11
|
-
testIds: M
|
|
12
|
-
) => {
|
|
13
|
-
for (let key in testIds)
|
|
14
|
-
if (typeof testIds[key] === 'function') {
|
|
15
|
-
const originalFunction = testIds[key] as Func
|
|
16
|
-
testIds[key] = ((...args: any[]) =>
|
|
17
|
-
`${preffix}-${originalFunction(...args)}`) as any
|
|
18
|
-
} else testIds[key] = `${preffix}-${testIds[key]}` as any
|
|
19
|
-
return testIds
|
|
20
|
-
}
|