@thecb/components 8.0.6-beta.6 → 8.0.6-beta.8
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/index.d.ts +26 -7
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/index.d.ts +1 -0
- package/src/components/atoms/button-with-link/index.d.ts +1 -0
- package/src/components/atoms/form-layouts/index.d.ts +4 -1
- package/src/components/atoms/form-select/index.d.ts +7 -5
- package/src/components/atoms/spinner/index.d.ts +2 -2
- package/src/types/common/Field.ts +5 -0
- package/src/types/common/FieldActions.ts +6 -0
- package/src/types/common/index.ts +3 -0
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
|
|
4
4
|
|
|
5
5
|
interface ButtonWithActionProps {
|
|
6
6
|
action?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
disabled?: boolean;
|
|
7
8
|
variant?: string;
|
|
8
9
|
text?: string;
|
|
9
10
|
textWrap?: boolean;
|
|
@@ -18,6 +19,7 @@ declare const ButtonWithAction: React.FC<Expand<ButtonWithActionProps> &
|
|
|
18
19
|
React.HTMLAttributes<HTMLElement>>;
|
|
19
20
|
|
|
20
21
|
interface ButtonWithLinkProps extends ButtonWithActionProps {
|
|
22
|
+
active?: boolean;
|
|
21
23
|
linkExtraStyles?: string;
|
|
22
24
|
url: string;
|
|
23
25
|
disabled?: boolean;
|
|
@@ -63,7 +65,23 @@ interface ErrorMessage {
|
|
|
63
65
|
[fieldName: string]: string;
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
interface Field {
|
|
69
|
+
hasErrors?: boolean;
|
|
70
|
+
dirty?: boolean;
|
|
71
|
+
rawValue?: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface FieldActions {
|
|
75
|
+
set?: (value: any) => void;
|
|
76
|
+
addValidator?: (validator: any) => void;
|
|
77
|
+
removeValidator?: (validator: any) => void;
|
|
78
|
+
clear?: () => void;
|
|
79
|
+
}
|
|
80
|
+
|
|
66
81
|
interface FormInputProps {
|
|
82
|
+
extraStyles?: string;
|
|
83
|
+
field?: Field;
|
|
84
|
+
fieldActions?: FieldActions;
|
|
67
85
|
disabled?: boolean;
|
|
68
86
|
errorMessages?: ErrorMessage[];
|
|
69
87
|
helperModal?: boolean;
|
|
@@ -78,18 +96,19 @@ declare const FormInput: React.FC<Expand<FormInputProps> &
|
|
|
78
96
|
React.HTMLAttributes<HTMLElement>>;
|
|
79
97
|
|
|
80
98
|
interface Option {
|
|
81
|
-
text
|
|
82
|
-
value
|
|
99
|
+
text?: string;
|
|
100
|
+
value?: string | number;
|
|
83
101
|
}
|
|
84
102
|
|
|
85
103
|
interface FormSelectProps {
|
|
104
|
+
disabled?: boolean;
|
|
86
105
|
dropdownMaxHeight?: string;
|
|
87
106
|
labelTextWhenNoError?: string;
|
|
88
107
|
options?: Option[];
|
|
89
|
-
fieldActions?:
|
|
108
|
+
fieldActions?: FieldActions;
|
|
90
109
|
showErrors?: boolean;
|
|
91
|
-
errorMessages?:
|
|
92
|
-
field?:
|
|
110
|
+
errorMessages?: ErrorMessage[]
|
|
111
|
+
field?: Field
|
|
93
112
|
}
|
|
94
113
|
|
|
95
114
|
declare const FormSelect: React.FC<Expand<FormSelectProps> &
|
|
@@ -446,8 +465,8 @@ declare const Paragraph: React.FC<Expand<ParagraphProps> &
|
|
|
446
465
|
React.HTMLAttributes<HTMLElement>>;
|
|
447
466
|
|
|
448
467
|
interface SpinnerProps {
|
|
449
|
-
size
|
|
450
|
-
centerSpinner
|
|
468
|
+
size?: string;
|
|
469
|
+
centerSpinner?: boolean;
|
|
451
470
|
}
|
|
452
471
|
|
|
453
472
|
declare const Spinner: React.FC<Expand<SpinnerProps> &
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
|
-
import ErrorMessage from "../../../types/common
|
|
3
|
+
import { ErrorMessage, Field, FieldActions } from "../../../types/common";
|
|
4
4
|
|
|
5
5
|
export interface FormInputProps {
|
|
6
|
+
extraStyles?: string;
|
|
7
|
+
field?: Field;
|
|
8
|
+
fieldActions?: FieldActions;
|
|
6
9
|
disabled?: boolean;
|
|
7
10
|
errorMessages?: ErrorMessage[];
|
|
8
11
|
helperModal?: boolean;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Expand from "../../../util/expand";
|
|
3
|
+
import { ErrorMessage, Field, FieldActions} from "../../../types/common";
|
|
3
4
|
|
|
4
5
|
interface Option {
|
|
5
|
-
text
|
|
6
|
-
value
|
|
6
|
+
text?: string;
|
|
7
|
+
value?: string | number;
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export interface FormSelectProps {
|
|
11
|
+
disabled?: boolean;
|
|
10
12
|
dropdownMaxHeight?: string;
|
|
11
13
|
labelTextWhenNoError?: string;
|
|
12
14
|
options?: Option[];
|
|
13
|
-
fieldActions?:
|
|
15
|
+
fieldActions?: FieldActions;
|
|
14
16
|
showErrors?: boolean;
|
|
15
|
-
errorMessages?:
|
|
16
|
-
field?:
|
|
17
|
+
errorMessages?: ErrorMessage[]
|
|
18
|
+
field?: Field
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
export const FormSelect: React.FC<Expand<FormSelectProps> &
|