@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 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: string;
82
- value: string | number;
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?: any;
108
+ fieldActions?: FieldActions;
90
109
  showErrors?: boolean;
91
- errorMessages?: any;
92
- field?: any;
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: string;
450
- centerSpinner: boolean;
468
+ size?: string;
469
+ centerSpinner?: boolean;
451
470
  }
452
471
 
453
472
  declare const Spinner: React.FC<Expand<SpinnerProps> &
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "8.0.6-beta.6",
3
+ "version": "8.0.6-beta.8",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -3,6 +3,7 @@ import Expand from "../../../util/expand";
3
3
 
4
4
  export interface ButtonWithActionProps {
5
5
  action?: (event: React.ChangeEvent<HTMLInputElement>) => void;
6
+ disabled?: boolean;
6
7
  variant?: string;
7
8
  text?: string;
8
9
  textWrap?: boolean;
@@ -3,6 +3,7 @@ import Expand from "../../../util/expand";
3
3
  import { ButtonWithActionProps } from "../button-with-action";
4
4
 
5
5
  export interface ButtonWithLinkProps extends ButtonWithActionProps {
6
+ active?: boolean;
6
7
  linkExtraStyles?: string;
7
8
  url: string;
8
9
  disabled?: boolean;
@@ -1,8 +1,11 @@
1
1
  import React from "react";
2
2
  import Expand from "../../../util/expand";
3
- import ErrorMessage from "../../../types/common/ErrorMessage";
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: string;
6
- value: string | number;
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?: any;
15
+ fieldActions?: FieldActions;
14
16
  showErrors?: boolean;
15
- errorMessages?: any;
16
- field?: any;
17
+ errorMessages?: ErrorMessage[]
18
+ field?: Field
17
19
  }
18
20
 
19
21
  export const FormSelect: React.FC<Expand<FormSelectProps> &
@@ -2,8 +2,8 @@ import React from "react";
2
2
  import Expand from "../../../util/expand";
3
3
 
4
4
  export interface SpinnerProps {
5
- size: string;
6
- centerSpinner: boolean;
5
+ size?: string;
6
+ centerSpinner?: boolean;
7
7
  }
8
8
 
9
9
  export const Spinner: React.FC<Expand<SpinnerProps> &
@@ -0,0 +1,5 @@
1
+ export default interface Field {
2
+ hasErrors?: boolean;
3
+ dirty?: boolean;
4
+ rawValue?: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ export default interface FieldActions {
2
+ set?: (value: any) => void;
3
+ addValidator?: (validator: any) => void;
4
+ removeValidator?: (validator: any) => void;
5
+ clear?: () => void;
6
+ }
@@ -0,0 +1,3 @@
1
+ export type { default as ErrorMessage } from "./ErrorMessage";
2
+ export type { default as Field } from "./Field";
3
+ export type { default as FieldActions } from "./FieldActions"