@onepercentio/one-ui 0.29.8 → 1.0.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/AdaptiveDialog/AdaptiveDialog.d.ts +2 -1
- package/dist/components/AdaptiveDialog/AdaptiveDialog.js +1 -1
- package/dist/components/Button/Button.d.ts +3 -2
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/EmailInput/EmailInput.d.ts +0 -1
- package/dist/components/Form/Form.d.ts +15 -49
- package/dist/components/Form/{v2/Form.hook.d.ts → Form.hook.d.ts} +1 -1
- package/dist/components/Form/Form.hook.js +233 -0
- package/dist/components/Form/Form.js +67 -123
- package/{dist-ts/components/Form/v2 → dist/components/Form}/Form.types.d.ts +1 -0
- package/dist/components/Form/Form.types.js +40 -0
- package/{dist-ts/components/Form/v2 → dist/components/Form}/FormField/Extensions/DateField/DateField.d.ts +3 -1
- package/dist/components/Form/FormField/Extensions/DateField/DateField.js +71 -0
- package/dist/components/Form/FormField/Extensions/DateField/index.js +26 -0
- package/dist/components/Form/FormField/Extensions/PhoneField/PhoneField.js +90 -0
- package/dist/components/Form/FormField/Extensions/PhoneField/index.js +26 -0
- package/dist/components/Form/FormField/FormField.js +276 -0
- package/{dist-ts/components/Form/v2 → dist/components/Form}/FormField/FormField.types.d.ts +8 -6
- package/dist/components/Form/FormField/FormField.types.js +12 -0
- package/dist/components/Form/FormField/index.js +26 -0
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Input/Input.d.ts +0 -6
- package/dist/components/Input/Input.js +9 -20
- package/dist/components/Input/Input.module.scss +0 -32
- package/dist/components/LinkToId/LinkToId.d.ts +3 -2
- package/dist/components/LinkToId/LinkToId.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.d.ts +0 -1
- package/dist/components/Radio/Radio.d.ts +1 -0
- package/dist/components/Radio/Radio.js +2 -1
- package/dist/components/SectionContainer/SectionContainer.js +1 -1
- package/dist/components/Select/Select.js +1 -2
- package/dist/components/Spacing/Spacing.d.ts +2 -1
- package/dist/components/Spacing/Spacing.js +1 -1
- package/dist/components/Tabs/Tabs.js +5 -3
- package/dist/components/Text/Text.d.ts +5 -4
- package/dist/components/Text/Text.js +2 -2
- package/dist/components/Text/Text.module.scss +3 -71
- package/dist/context/AsyncProcess.d.ts +5 -4
- package/dist/context/AsyncProcess.js +1 -1
- package/dist/context/OneUIProvider.d.ts +37 -22
- package/dist/context/OneUIProvider.js +1 -1
- package/dist/hooks/useShortIntl.d.ts +2 -1
- package/dist/hooks/useShortIntl.js +1 -1
- package/dist/index.d.ts +6 -10
- package/dist/index.js +143 -181
- package/dist/type-utils.d.ts +12 -2
- package/dist/type-utils.js +1 -1
- package/dist/utility.d.js +1 -17
- package/dist-ts/components/AdaptiveDialog/AdaptiveDialog.d.ts +2 -1
- package/dist-ts/components/AdaptiveDialog/AdaptiveDialog.js.map +1 -1
- package/dist-ts/components/Button/Button.d.ts +3 -2
- package/dist-ts/components/Button/Button.js.map +1 -1
- package/dist-ts/components/EmailInput/EmailInput.d.ts +0 -1
- package/dist-ts/components/Form/Form.d.ts +15 -49
- package/dist-ts/components/Form/{v2/Form.hook.d.ts → Form.hook.d.ts} +1 -1
- package/dist-ts/components/Form/{v2/Form.hook.js → Form.hook.js} +9 -5
- package/dist-ts/components/Form/Form.hook.js.map +1 -0
- package/dist-ts/components/Form/Form.js +37 -66
- package/dist-ts/components/Form/Form.js.map +1 -1
- package/{dist/components/Form/v2 → dist-ts/components/Form}/Form.types.d.ts +1 -0
- package/dist-ts/components/Form/Form.types.js.map +1 -0
- package/{dist/components/Form/v2 → dist-ts/components/Form}/FormField/Extensions/DateField/DateField.d.ts +3 -1
- package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/DateField/DateField.js +6 -6
- package/dist-ts/components/Form/FormField/Extensions/DateField/DateField.js.map +1 -0
- package/dist-ts/components/Form/FormField/Extensions/DateField/index.js.map +1 -0
- package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/PhoneField.js +4 -4
- package/dist-ts/components/Form/FormField/Extensions/PhoneField/PhoneField.js.map +1 -0
- package/dist-ts/components/Form/FormField/Extensions/PhoneField/index.js.map +1 -0
- package/dist-ts/components/Form/{v2/FormField → FormField}/FormField.js +15 -16
- package/dist-ts/components/Form/FormField/FormField.js.map +1 -0
- package/{dist/components/Form/v2 → dist-ts/components/Form}/FormField/FormField.types.d.ts +8 -6
- package/dist-ts/components/Form/FormField/FormField.types.js.map +1 -0
- package/dist-ts/components/Form/FormField/index.js.map +1 -0
- package/dist-ts/components/Form/index.js.map +1 -1
- package/dist-ts/components/Input/Input.d.ts +0 -6
- package/dist-ts/components/Input/Input.js +4 -15
- package/dist-ts/components/Input/Input.js.map +1 -1
- package/dist-ts/components/Input/Input.module.scss +0 -32
- package/dist-ts/components/LinkToId/LinkToId.d.ts +3 -2
- package/dist-ts/components/LinkToId/LinkToId.js.map +1 -1
- package/dist-ts/components/PasswordInput/PasswordInput.d.ts +0 -1
- package/dist-ts/components/Radio/Radio.d.ts +1 -0
- package/dist-ts/components/Radio/Radio.js +1 -1
- package/dist-ts/components/Radio/Radio.js.map +1 -1
- package/dist-ts/components/SectionContainer/SectionContainer.js.map +1 -1
- package/dist-ts/components/Select/Select.js +1 -1
- package/dist-ts/components/Select/Select.js.map +1 -1
- package/dist-ts/components/Spacing/Spacing.d.ts +2 -1
- package/dist-ts/components/Spacing/Spacing.js.map +1 -1
- package/dist-ts/components/Tabs/Tabs.js +4 -2
- package/dist-ts/components/Tabs/Tabs.js.map +1 -1
- package/dist-ts/components/Text/Text.d.ts +5 -4
- package/dist-ts/components/Text/Text.js +1 -1
- package/dist-ts/components/Text/Text.js.map +1 -1
- package/dist-ts/components/Text/Text.module.scss +3 -71
- package/dist-ts/context/AsyncProcess.d.ts +5 -4
- package/dist-ts/context/AsyncProcess.js.map +1 -1
- package/dist-ts/context/OneUIProvider.d.ts +37 -22
- package/dist-ts/context/OneUIProvider.js.map +1 -1
- package/dist-ts/hooks/useShortIntl.d.ts +2 -1
- package/dist-ts/hooks/useShortIntl.js.map +1 -1
- package/dist-ts/index.d.ts +6 -10
- package/dist-ts/index.js +6 -10
- package/dist-ts/index.js.map +1 -1
- package/dist-ts/type-utils.d.ts +12 -2
- package/package.json +8 -5
- package/tsconfig.prod.json +1 -0
- package/dist/components/Form/v2/Form.d.ts +0 -18
- package/dist/components/Form/v2/Form.hook.js +0 -230
- package/dist/components/Form/v2/Form.js +0 -63
- package/dist/components/Form/v2/Form.types.js +0 -40
- package/dist/components/Form/v2/FormField/Extensions/DateField/DateField.js +0 -68
- package/dist/components/Form/v2/FormField/Extensions/DateField/index.js +0 -26
- package/dist/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.js +0 -90
- package/dist/components/Form/v2/FormField/Extensions/PhoneField/index.js +0 -26
- package/dist/components/Form/v2/FormField/FormField.js +0 -281
- package/dist/components/Form/v2/FormField/FormField.module.scss +0 -0
- package/dist/components/Form/v2/FormField/FormField.types.js +0 -12
- package/dist/components/Form/v2/FormField/index.js +0 -26
- package/dist/components/Form/v2/index.d.ts +0 -2
- package/dist/components/Form/v2/index.js +0 -26
- package/dist/hooks/useForm.d.ts +0 -16
- package/dist/hooks/useForm.js +0 -38
- package/dist-ts/components/Form/v2/Form.d.ts +0 -18
- package/dist-ts/components/Form/v2/Form.hook.js.map +0 -1
- package/dist-ts/components/Form/v2/Form.js +0 -31
- package/dist-ts/components/Form/v2/Form.js.map +0 -1
- package/dist-ts/components/Form/v2/Form.types.js.map +0 -1
- package/dist-ts/components/Form/v2/FormField/Extensions/DateField/DateField.js.map +0 -1
- package/dist-ts/components/Form/v2/FormField/Extensions/DateField/index.js.map +0 -1
- package/dist-ts/components/Form/v2/FormField/Extensions/PhoneField/PhoneField.js.map +0 -1
- package/dist-ts/components/Form/v2/FormField/Extensions/PhoneField/index.js.map +0 -1
- package/dist-ts/components/Form/v2/FormField/FormField.js.map +0 -1
- package/dist-ts/components/Form/v2/FormField/FormField.module.scss +0 -0
- package/dist-ts/components/Form/v2/FormField/FormField.types.js.map +0 -1
- package/dist-ts/components/Form/v2/FormField/index.js.map +0 -1
- package/dist-ts/components/Form/v2/index.d.ts +0 -2
- package/dist-ts/components/Form/v2/index.js +0 -3
- package/dist-ts/components/Form/v2/index.js.map +0 -1
- package/dist-ts/hooks/useForm.d.ts +0 -16
- package/dist-ts/hooks/useForm.js +0 -27
- package/dist-ts/hooks/useForm.js.map +0 -1
- /package/dist/components/Form/{v2/Form.module.scss → Form.module.scss} +0 -0
- /package/dist/components/Form/{v2/FormField → FormField}/Extensions/DateField/DateField.module.scss +0 -0
- /package/dist/components/Form/{v2/FormField → FormField}/Extensions/DateField/index.d.ts +0 -0
- /package/dist/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/PhoneField.d.ts +0 -0
- /package/dist/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/PhoneField.module.scss +0 -0
- /package/dist/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/index.d.ts +0 -0
- /package/dist/components/Form/{v2/FormField → FormField}/FormField.d.ts +0 -0
- /package/dist/components/Form/{v2/FormField → FormField}/index.d.ts +0 -0
- /package/dist-ts/components/Form/{v2/Form.module.scss → Form.module.scss} +0 -0
- /package/dist-ts/components/Form/{v2/Form.types.js → Form.types.js} +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/DateField/DateField.module.scss +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/DateField/index.d.ts +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/DateField/index.js +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/PhoneField.d.ts +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/PhoneField.module.scss +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/index.d.ts +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/Extensions/PhoneField/index.js +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/FormField.d.ts +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/FormField.types.js +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/index.d.ts +0 -0
- /package/dist-ts/components/Form/{v2/FormField → FormField}/index.js +0 -0
|
@@ -1,59 +1,65 @@
|
|
|
1
1
|
import { JSX } from "react";
|
|
2
2
|
import { Get } from "type-fest";
|
|
3
|
-
import React, { ComponentProps, ReactElement } from "react";
|
|
3
|
+
import React, { ComponentProps, ReactElement, ReactNode } from "react";
|
|
4
4
|
import { PropsWithChildren } from "react";
|
|
5
5
|
import { ImageScales } from "@muritavo/webpack-microfrontend-scripts/bin/types/ImageScales";
|
|
6
6
|
import { UploadTask } from "firebase/storage";
|
|
7
|
-
import { FieldPath } from "../type-utils";
|
|
7
|
+
import { FieldPath, FromOnePercentUtility, NamespaceAccessors, PathObject } from "../type-utils";
|
|
8
8
|
import Button from "../components/Button";
|
|
9
9
|
import CheckBox from "../components/CheckBox";
|
|
10
10
|
import Radio from "../components/Radio/Radio";
|
|
11
11
|
import { FileInputViewProps } from "../components/FileInput/View/View.types";
|
|
12
|
-
import { AnswerByField, GenericFormFieldProps } from "../components/Form/
|
|
13
|
-
import { BaseQuestion } from "../components/Form/
|
|
12
|
+
import { AnswerByField, FormField, GenericFormFieldProps } from "../components/Form/FormField/FormField.types";
|
|
13
|
+
import { BaseQuestion, FormMode } from "../components/Form/Form.types";
|
|
14
14
|
type DeepPartial<T> = {
|
|
15
15
|
[P in keyof T]?: NonNullable<T[P]> extends Function ? T[P] : DeepPartial<T[P]>;
|
|
16
16
|
};
|
|
17
|
+
type IfUtilityHas<N extends NamespaceAccessors, Declare> = FromOnePercentUtility<N> extends `To define this property you need to set OnepercentUtility.${string} globally` ? undefined : Declare;
|
|
17
18
|
export type OneUIContextSpecs = {
|
|
18
19
|
component: {
|
|
19
20
|
spacing: {
|
|
20
21
|
variants: {
|
|
21
|
-
[k in
|
|
22
|
+
[k in FromOnePercentUtility<"UIElements.SpacingVariants">]: string;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
collapsable: {
|
|
25
26
|
className: string;
|
|
26
27
|
};
|
|
27
28
|
form: {
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
fieldWrapper: {
|
|
30
|
+
[k in `${keyof typeof FormMode}-${FormField["type"]}`]: string | ((p: PropsWithChildren<FormField & {
|
|
31
|
+
value: any;
|
|
32
|
+
}>) => ReactNode);
|
|
33
|
+
};
|
|
34
|
+
titleVariant: FromOnePercentUtility<"UIElements.TextVariants">;
|
|
35
|
+
labelVariant: FromOnePercentUtility<"UIElements.TextVariants">;
|
|
30
36
|
/** Label shown when a field is optional */
|
|
31
37
|
optionalLabel: string;
|
|
32
38
|
/** Label shown when a required field was not provided */
|
|
33
39
|
requiredLabel: string;
|
|
34
40
|
onFileUpload(questionId: string, file: File): UploadTask;
|
|
35
|
-
extensions
|
|
36
|
-
[K in
|
|
41
|
+
extensions: IfUtilityHas<"UIElements.FormExtension", {
|
|
42
|
+
[K in FromOnePercentUtility<"UIElements.FormExtension">["fields"]["type"]]: {
|
|
37
43
|
Input: (props: GenericFormFieldProps<K>) => ReactElement;
|
|
38
44
|
validator: (answer: AnswerByField<{
|
|
39
45
|
type: K;
|
|
40
|
-
}>, question: BaseQuestion & (
|
|
46
|
+
}>, question: BaseQuestion & (FromOnePercentUtility<"UIElements.FormExtension">["fields"] & {
|
|
41
47
|
type: K;
|
|
42
48
|
})) => {
|
|
43
49
|
isValid: boolean;
|
|
44
50
|
error?: string;
|
|
45
51
|
};
|
|
46
52
|
};
|
|
47
|
-
}
|
|
53
|
+
}>;
|
|
48
54
|
};
|
|
49
|
-
text
|
|
50
|
-
className
|
|
51
|
-
[k in React.ComponentProps<typeof import("../components/Text")["default"]>["type"]]
|
|
55
|
+
text: IfUtilityHas<"UIElements.TextVariants", {
|
|
56
|
+
className: {
|
|
57
|
+
[k in React.ComponentProps<typeof import("../components/Text")["default"]>["type"]]: string;
|
|
52
58
|
};
|
|
53
|
-
htmlTag
|
|
54
|
-
[k in React.ComponentProps<typeof import("../components/Text")["default"]>["type"]]
|
|
59
|
+
htmlTag: {
|
|
60
|
+
[k in React.ComponentProps<typeof import("../components/Text")["default"]>["type"]]: "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
55
61
|
};
|
|
56
|
-
}
|
|
62
|
+
}>;
|
|
57
63
|
button?: {
|
|
58
64
|
className?: {
|
|
59
65
|
[k in NonNullable<React.ComponentProps<typeof import("../components/Button")["default"]>["variant"]>]?: string;
|
|
@@ -61,8 +67,12 @@ export type OneUIContextSpecs = {
|
|
|
61
67
|
Component?: (props: ComponentProps<typeof Button>) => ReactElement;
|
|
62
68
|
};
|
|
63
69
|
input: {
|
|
64
|
-
className:
|
|
65
|
-
|
|
70
|
+
className: {
|
|
71
|
+
/** The wrapper around input tag & caption element (used for error and caption) */
|
|
72
|
+
container: string;
|
|
73
|
+
/** The input html tag */
|
|
74
|
+
input: string;
|
|
75
|
+
};
|
|
66
76
|
};
|
|
67
77
|
fileInput: {
|
|
68
78
|
View: (props: FileInputViewProps) => ReactElement;
|
|
@@ -116,7 +126,7 @@ export type OneUIContextSpecs = {
|
|
|
116
126
|
dialogClassName: string;
|
|
117
127
|
backdropClassName: string;
|
|
118
128
|
variant: {
|
|
119
|
-
[k in
|
|
129
|
+
[k in FromOnePercentUtility<"UIElements.AdaptiveDialogVariants">]: string;
|
|
120
130
|
};
|
|
121
131
|
};
|
|
122
132
|
adaptiveSidebar: {
|
|
@@ -129,6 +139,10 @@ export type OneUIContextSpecs = {
|
|
|
129
139
|
radio: {
|
|
130
140
|
Component?: (props: ComponentProps<typeof Radio>) => ReactElement;
|
|
131
141
|
};
|
|
142
|
+
tabs: {
|
|
143
|
+
item: string;
|
|
144
|
+
container: string;
|
|
145
|
+
};
|
|
132
146
|
};
|
|
133
147
|
hook: {
|
|
134
148
|
ui: {
|
|
@@ -143,12 +157,13 @@ export type OneUIContextSpecs = {
|
|
|
143
157
|
imageScale: ImageScales;
|
|
144
158
|
};
|
|
145
159
|
};
|
|
146
|
-
type ContextConfigSpecs = DeepPartial<OneUIContextSpecs>;
|
|
160
|
+
export type ContextConfigSpecs = DeepPartial<OneUIContextSpecs> & PathObject<OneUIContextSpecs, "component.text">;
|
|
147
161
|
declare function OneUIProvider({ children, config, }: PropsWithChildren<{
|
|
148
162
|
config: ContextConfigSpecs;
|
|
149
163
|
}>): import("react/jsx-runtime").JSX.Element;
|
|
150
164
|
export default OneUIProvider;
|
|
151
165
|
export declare function useOneUIContext(): OneUIContextSpecs;
|
|
152
166
|
export declare function useOneUIView<P extends FieldPath<OneUIContextSpecs>>(oneuiConfigPath: P, componentName: string): NonNullable<import("type-fest/source/get").GetWithPath<OneUIContextSpecs, P extends string ? import("type-fest").Split<import("type-fest/source/get").FixPathSquareBrackets<P>, "."> : P, {}>>;
|
|
153
|
-
export declare function useOneUIConfig<P extends FieldPath<OneUIContextSpecs
|
|
167
|
+
export declare function useOneUIConfig<P extends FieldPath<OneUIContextSpecs>>(prop: P): Get<OneUIContextSpecs, P>;
|
|
168
|
+
export declare function useOneUIConfig<P extends FieldPath<OneUIContextSpecs>, T extends DeepPartial<Get<OneUIContextSpecs, P>>>(prop: P, defaultValue: T): NonNullable<Get<OneUIContextSpecs, P>>;
|
|
154
169
|
export declare function useCurrentImageScale(): DeepPartial<ImageScales>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OneUIProvider.js","sourceRoot":"","sources":["../../src/context/OneUIProvider.tsx"],"names":[],"mappings":";AACA,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,KAAK,MAAM,cAAc,CAAC;AACjC,OAAO,KAAK,MAAM,kBAAkB,CAAC;AAErC,OAAc,EAA2C,OAAO,EAAE,MAAM,OAAO,CAAC;AAChF,OAAO,EAAE,aAAa,EAAqB,UAAU,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+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AC,GAAG,EAAE;YACvB,OAAO,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAC5B,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;QACpB,IACE,OAAO,GAAG,KAAK,QAAQ;YACvB,OAAO,GAAG,KAAK,UAAU;YACzB,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;YAC3B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;YAEtB,OAAQ,GAAW,IAAI,YAAY,CAAC;QAEtC,IAAI,OAAO,GAAG,KAAK,SAAS;YAAE,OAAO,GAAU,CAAC;QAChD,OAAO,YAAY,CAAC,GAAG,IAAI,YAAY,CAA8B,CAAC;IACxE,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;QACzB,OAAO,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IACpB,OAAO,KAAK,IAAI,YAAY,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpC,OAAO,OAAO,CAAC,KAAM,CAAC,UAAW,CAAC;AACpC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IntlFormatters, IntlShape } from "react-intl";
|
|
2
2
|
import { BigNumber } from "bignumber.js";
|
|
3
3
|
import { ReactElement } from "react";
|
|
4
|
+
import { FromOnePercentUtility } from "../type-utils";
|
|
4
5
|
export default function useShortIntl(): IntlShape & {
|
|
5
|
-
txt: <R extends ReturnType<IntlFormatters["formatMessage"]> = string>(id:
|
|
6
|
+
txt: <R extends ReturnType<IntlFormatters["formatMessage"]> = string>(id: FromOnePercentUtility<"IntlIds">, params?: Record<string, string | ReactElement>) => R;
|
|
6
7
|
formatToDoubleDecimal(number: number, options?: Parameters<IntlFormatters["formatNumber"]>[1]): string;
|
|
7
8
|
formatBigNumber(number: BigNumber, options?: Parameters<IntlFormatters["formatNumber"]>[1]): string;
|
|
8
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShortIntl.js","sourceRoot":"","sources":["../../src/hooks/useShortIntl.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,OAAO,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,EAAgB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useShortIntl.js","sourceRoot":"","sources":["../../src/hooks/useShortIntl.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,OAAO,EAAE,MAAM,YAAY,CAAC;AAEhE,OAAO,EAAgB,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAG1D,MAAM,CAAC,OAAO,UAAU,YAAY;IAclC,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI,CAAC;IAC7C,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,EAAE,CAAC;YAC3C,MAAM,aAAa,GAAG,CAAC,EAAiB,EAAE,EAAE;gBAC1C,IAAI,EAAE,CAAC,GAAG,KAAK,GAAG,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;oBACjC,MAAM,WAAW,GAAG,CAAC,EAAiB,EAAE,EAAE;wBACxC,IAAI,EAAE,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;4BACnB,UAAU,CAAC,KAAK,CAAC,CAAC;wBACpB,CAAC;oBACH,CAAC,CAAC;oBACF,UAAU,CAAC,IAAI,CAAC,CAAC;oBACjB,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;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C;iBAClB,aAAa,CACZ,OAAO,EAAE,qBAAqB,IAAI,SAAS,CAAC,aAAa,EAAG,EAC5D,CAAC,CACF;iBACA,QAAQ,EAAE;iBACV,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACrB,OAAO,GAAG,OAAO,GACf,QAAQ,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,gBAAgB,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,EACxD,EAAE,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC;AAUD,MAAM,UAAU,eAAe,CAC7B,OAAU,EACV,OAAU;IAEV,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,CACnC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACd,GAAG,CAAC;QACJ,CAAC,GAAG,OAAO,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;KACvB,CAAC,EACF,EAA4C,CAC7C,CAAC;AACJ,CAAC"}
|
package/dist-ts/index.d.ts
CHANGED
|
@@ -21,14 +21,12 @@ export * from "./components/FlowController/index";
|
|
|
21
21
|
export { default as FlowController } from "./components/FlowController/index";
|
|
22
22
|
export * from "./components/Transition/index";
|
|
23
23
|
export { default as Transition } from "./components/Transition/index";
|
|
24
|
-
export * from "./components/Form/
|
|
25
|
-
export { default as
|
|
26
|
-
export * from "./components/Form/
|
|
27
|
-
export { default as
|
|
28
|
-
export * from "./components/Form/
|
|
29
|
-
export { default as
|
|
30
|
-
export * from "./components/Form/v2/FormField/Extensions/DateField/index";
|
|
31
|
-
export { default as DateField } from "./components/Form/v2/FormField/Extensions/DateField/index";
|
|
24
|
+
export * from "./components/Form/FormField/index";
|
|
25
|
+
export { default as FormField } from "./components/Form/FormField/index";
|
|
26
|
+
export * from "./components/Form/FormField/Extensions/PhoneField/index";
|
|
27
|
+
export { default as PhoneField } from "./components/Form/FormField/Extensions/PhoneField/index";
|
|
28
|
+
export * from "./components/Form/FormField/Extensions/DateField/index";
|
|
29
|
+
export { default as DateField } from "./components/Form/FormField/Extensions/DateField/index";
|
|
32
30
|
export * from "./components/Form/index";
|
|
33
31
|
export { default as Form } from "./components/Form/index";
|
|
34
32
|
export * from "./components/InstantCounter/index";
|
|
@@ -170,8 +168,6 @@ export * from "./hooks/ui/useCustomScrollbar";
|
|
|
170
168
|
export { default as useCustomScrollbar } from "./hooks/ui/useCustomScrollbar";
|
|
171
169
|
export * from "./hooks/useAsyncControl";
|
|
172
170
|
export { default as useAsyncControl } from "./hooks/useAsyncControl";
|
|
173
|
-
export * from "./hooks/useForm";
|
|
174
|
-
export { default as useForm } from "./hooks/useForm";
|
|
175
171
|
export * from "./hooks/useMergeRefs";
|
|
176
172
|
export { default as useMergeRefs } from "./hooks/useMergeRefs";
|
|
177
173
|
export * from "./hooks/usePooledOperation";
|
package/dist-ts/index.js
CHANGED
|
@@ -21,14 +21,12 @@ export * from "./components/FlowController/index";
|
|
|
21
21
|
export { default as FlowController } from "./components/FlowController/index";
|
|
22
22
|
export * from "./components/Transition/index";
|
|
23
23
|
export { default as Transition } from "./components/Transition/index";
|
|
24
|
-
export * from "./components/Form/
|
|
25
|
-
export { default as
|
|
26
|
-
export * from "./components/Form/
|
|
27
|
-
export { default as
|
|
28
|
-
export * from "./components/Form/
|
|
29
|
-
export { default as
|
|
30
|
-
export * from "./components/Form/v2/FormField/Extensions/DateField/index";
|
|
31
|
-
export { default as DateField } from "./components/Form/v2/FormField/Extensions/DateField/index";
|
|
24
|
+
export * from "./components/Form/FormField/index";
|
|
25
|
+
export { default as FormField } from "./components/Form/FormField/index";
|
|
26
|
+
export * from "./components/Form/FormField/Extensions/PhoneField/index";
|
|
27
|
+
export { default as PhoneField } from "./components/Form/FormField/Extensions/PhoneField/index";
|
|
28
|
+
export * from "./components/Form/FormField/Extensions/DateField/index";
|
|
29
|
+
export { default as DateField } from "./components/Form/FormField/Extensions/DateField/index";
|
|
32
30
|
export * from "./components/Form/index";
|
|
33
31
|
export { default as Form } from "./components/Form/index";
|
|
34
32
|
export * from "./components/InstantCounter/index";
|
|
@@ -170,8 +168,6 @@ export * from "./hooks/ui/useCustomScrollbar";
|
|
|
170
168
|
export { default as useCustomScrollbar } from "./hooks/ui/useCustomScrollbar";
|
|
171
169
|
export * from "./hooks/useAsyncControl";
|
|
172
170
|
export { default as useAsyncControl } from "./hooks/useAsyncControl";
|
|
173
|
-
export * from "./hooks/useForm";
|
|
174
|
-
export { default as useForm } from "./hooks/useForm";
|
|
175
171
|
export * from "./hooks/useMergeRefs";
|
|
176
172
|
export { default as useMergeRefs } from "./hooks/useMergeRefs";
|
|
177
173
|
export * from "./hooks/usePooledOperation";
|
package/dist-ts/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,wBAAwB,CAAC;AAC/D,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAC7E,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACjE,cAAc,+BAA+B,CAAC;AAC9C,OAAO,EAAC,OAAO,IAAI,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;AAC7E,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,yBAA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AC;AAC7C,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,8BAA8B,CAAC;AACrE,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC"}
|
package/dist-ts/type-utils.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export declare type DeepMap<T, TValue> = {
|
|
|
18
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
19
|
};
|
|
20
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[
|
|
21
|
+
declare type IsTuple<T extends ReadonlyArray<any>> = number extends T["length"] ? false : true;
|
|
22
22
|
declare type TupleKey<T extends ReadonlyArray<any>> = Exclude<keyof T, keyof any[]>;
|
|
23
23
|
declare type ArrayKey = number;
|
|
24
24
|
declare type PathImpl<K extends string | number, V> = V extends Primitive ? `${K}` : `${K}` | `${K}.${Path<V>}`;
|
|
@@ -45,5 +45,15 @@ export declare type FieldPathValues<TFieldValues extends FieldValues, TPath exte
|
|
|
45
45
|
* Returns the type U when this type is resolved
|
|
46
46
|
* Or the fallback type F when type is no resolved
|
|
47
47
|
*/
|
|
48
|
-
export declare type UnresolvableOr<U, F> = keyof
|
|
48
|
+
export declare type UnresolvableOr<U, F> = keyof any extends keyof U ? F : U;
|
|
49
|
+
type ConsiderOptional<Obj, Next> = Partial<Obj> extends Obj ? {
|
|
50
|
+
[k in keyof Obj]?: Next;
|
|
51
|
+
} : {
|
|
52
|
+
[k in keyof Obj]: Next;
|
|
53
|
+
};
|
|
54
|
+
export declare type PathObject<T, P extends string> = P extends `${infer Key}.${infer Rest}` ? Key extends keyof T ? ConsiderOptional<Pick<T, Key>, PathObject<T[Key], Rest>> : never : P extends keyof T ? undefined extends T[P] ? {
|
|
55
|
+
[p in P]?: undefined;
|
|
56
|
+
} : ConsiderOptional<Pick<T, P>, T[P]> : never;
|
|
57
|
+
export declare type NamespaceAccessors = Path<OnepercentUtility>;
|
|
58
|
+
export declare type FromOnePercentUtility<P extends NamespaceAccessors> = keyof any extends import("type-fest").Get<OnepercentUtility, P> ? `To define this property you need to set OnepercentUtility.${P} globally` : import("type-fest").Get<OnepercentUtility, P>;
|
|
49
59
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onepercentio/one-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "A set of reusable components created through the development of Onepercent projects",
|
|
5
5
|
"repository": "git@github.com:onepercentio/one-ui.git",
|
|
6
6
|
"author": "Murilo Oliveira de Araujo <murilo.araujo@onepercent.io>",
|
|
@@ -8,14 +8,16 @@
|
|
|
8
8
|
"types": "./dist/index.d.ts",
|
|
9
9
|
"main": "./dist/index.js",
|
|
10
10
|
"exports": {
|
|
11
|
-
"./*": "./dist-ts/*.js",
|
|
12
|
-
"./*.scss": "./dist-ts/*.scss",
|
|
13
11
|
"./components/Form/v2/*": "./dist-ts/components/Form/v2/*.js",
|
|
14
12
|
"./components/*": "./dist-ts/components/*/index.js",
|
|
15
13
|
"./components/*.scss": "./dist-ts/components/*.scss",
|
|
14
|
+
"./components/*.types": "./dist-ts/components/*.types.js",
|
|
16
15
|
"./components/*.hook": "./dist-ts/components/*.hook.js",
|
|
16
|
+
"./WebpackConfigs/*": "./WebpackConfigs/*",
|
|
17
|
+
"./context/*": "./dist-ts/context/*.js",
|
|
17
18
|
".": "./dist-ts/index.js",
|
|
18
|
-
"
|
|
19
|
+
"./*": "./dist-ts/*.js",
|
|
20
|
+
"./*.scss": "./dist-ts/*.scss"
|
|
19
21
|
},
|
|
20
22
|
"devDependencies": {
|
|
21
23
|
"@babel/cli": "^7.22.9",
|
|
@@ -87,6 +89,7 @@
|
|
|
87
89
|
"react-scripts": "^5.0.0",
|
|
88
90
|
"sass": "^1.54.0",
|
|
89
91
|
"sass-loader": "^10",
|
|
92
|
+
"sharp": "^0.30.3",
|
|
90
93
|
"storybook": "^9.1.7",
|
|
91
94
|
"stream-browserify": "^3.0.0",
|
|
92
95
|
"stream-http": "^3.2.0",
|
|
@@ -96,10 +99,10 @@
|
|
|
96
99
|
"typescript": "^5",
|
|
97
100
|
"url": "^0.11.0",
|
|
98
101
|
"use-wallet": "0.13.5",
|
|
99
|
-
"sharp": "^0.30.3",
|
|
100
102
|
"webpack": "^5"
|
|
101
103
|
},
|
|
102
104
|
"dependencies": {
|
|
105
|
+
"@mona-health/react-input-mask": "^3.0.3",
|
|
103
106
|
"@types/lodash": "^4.14.177",
|
|
104
107
|
"@types/react-router-dom": "^5.3.3",
|
|
105
108
|
"bignumber.js": "^9.0.2",
|
package/tsconfig.prod.json
CHANGED
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
|
|
19
19
|
"outDir": "./dist-ts" /* Specify an output folder for all emitted files. */,
|
|
20
20
|
|
|
21
|
+
"noEmitOnError": false,
|
|
21
22
|
/* Interop Constraints */
|
|
22
23
|
"isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
23
24
|
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { FormViewProps } from "./Form.types";
|
|
3
|
-
import { AnswerByField, FormFieldView } from "./FormField/FormField.types";
|
|
4
|
-
export type FormRef<Q extends FormFieldView[]> = {
|
|
5
|
-
setAnswer<I extends Q[number]["id"]>(questionId: I, ans: AnswerByField<Q[number] & {
|
|
6
|
-
id: I;
|
|
7
|
-
}>): void;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Brainstorm:
|
|
11
|
-
* The answers must be externalized in some way because those answers will be manipulated
|
|
12
|
-
* There must be a way to disable non validation related errors
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* A new and improved version of the one-ui design form
|
|
16
|
-
**/
|
|
17
|
-
declare const _default: React.ForwardRefExoticComponent<FormViewProps<FormFieldView[]> & React.RefAttributes<FormRef<FormFieldView[]>>>;
|
|
18
|
-
export default _default;
|