jamespot-react-components 1.0.86 → 1.0.91

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.
@@ -6,5 +6,5 @@ import { FieldValues } from 'react-hook-form/dist/types';
6
6
  * @param error react-hook-form object
7
7
  */
8
8
  export declare const JRCFormErrors: <TFieldValues extends FieldValues = FieldValues>({ error, }: {
9
- error: import("react-hook-form/dist/types").DeepMap<import("react-hook-form/dist/types").DeepPartial<TFieldValues>, import("react-hook-form/dist/types").FieldError>;
9
+ error: import("react-hook-form/dist/types").DeepMap<import("react-hook-form/dist/types").DeepPartial<TFieldValues>, import("react-hook-form/dist/types").FieldError> | undefined;
10
10
  }) => JSX.Element;
@@ -1,4 +1,5 @@
1
- import { RegisterOptions, ValidationRule } from 'react-hook-form/dist/types/validator';
1
+ /// <reference types="react" />
2
+ import { RegisterOptions, ValidationRule, ValidationValue } from 'react-hook-form/dist/types/validator';
2
3
  import { IntlShape } from 'react-intl/src/types';
3
4
  export declare type AllowedDefaultTypes = 'required' | 'min' | 'max' | 'maxLength' | 'minLength' | 'pattern';
4
5
  export declare type FormControls = Pick<RegisterOptions, AllowedDefaultTypes>;
@@ -11,32 +12,19 @@ export declare type AllowedTypes = AllowedDefaultTypes | keyof JRCFormControls;
11
12
  * @param rules rules applied to the field
12
13
  * @param intl translation object
13
14
  */
14
- export declare const useFormControls: (rules: FormControls & JRCFormControls, intl: IntlShape) => FormControls | undefined;
15
+ export declare const useFormControls: (rules: (FormControls & JRCFormControls) | undefined, intl: IntlShape) => FormControls | undefined;
16
+ declare type getJRCErrorsReturnType = [
17
+ AllowedTypes,
18
+ {
19
+ value: ValidationValue;
20
+ message: string | React.ReactNode;
21
+ }
22
+ ];
15
23
  /**
16
24
  * Produces a react-hook-form compatible validation object with default messages for each error type
17
25
  * @param rule rule applied to the field
18
26
  * @param validation validation object
19
27
  * @param intl translation object
20
28
  */
21
- export declare const useJRCErrors: (rule: AllowedTypes, validation: ValidationRule, intl: IntlShape) => ("required" | {
22
- value: import("react-hook-form/dist/types/validator").ValidationValue;
23
- message: string;
24
- })[] | ("max" | {
25
- value: import("react-hook-form/dist/types/validator").ValidationValue;
26
- message: import("react").ReactNode;
27
- })[] | ("min" | {
28
- value: import("react-hook-form/dist/types/validator").ValidationValue;
29
- message: import("react").ReactNode;
30
- })[] | ("maxLength" | {
31
- value: import("react-hook-form/dist/types/validator").ValidationValue;
32
- message: import("react").ReactNode;
33
- })[] | ("minLength" | {
34
- value: import("react-hook-form/dist/types/validator").ValidationValue;
35
- message: import("react").ReactNode;
36
- })[] | ("pattern" | {
37
- value: import("react-hook-form/dist/types/validator").ValidationValue;
38
- message: import("react").ReactNode;
39
- })[] | (string | {
40
- value: RegExp;
41
- message: string;
42
- })[] | undefined;
29
+ export declare const getJRCErrors: (rule: AllowedTypes, validation: ValidationRule, intl: IntlShape) => getJRCErrorsReturnType | undefined;
30
+ export {};
@@ -1,4 +1,7 @@
1
1
  import { JRCFormCheckboxProps } from './JRCFormCheckbox.types';
2
+ /**
3
+ * @deprecated use JRCInputCheckbox instead
4
+ */
2
5
  export declare const JRCFormCheckbox: {
3
6
  (props: JRCFormCheckboxProps): JSX.Element;
4
7
  defaultProps: {
@@ -9,8 +9,8 @@ export declare const FocusBackground: import("styled-components").StyledComponen
9
9
  }, never>;
10
10
  export declare const CheckboxLabel: import("styled-components").StyledComponent<"label", any, CheckboxLabelProps, never>;
11
11
  export declare type CheckboxOrToggleProps = Omit<React.ComponentPropsWithoutRef<'input'>, 'type'> & {
12
- checkboxMode: string;
12
+ checkboxMode?: string;
13
13
  };
14
14
  export declare const CheckboxOrToggle: React.ForwardRefExoticComponent<Omit<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "type"> & {
15
- checkboxMode: string;
15
+ checkboxMode?: string | undefined;
16
16
  } & React.RefAttributes<HTMLInputElement>>;
@@ -45,11 +45,11 @@ export interface JRCFormCheckboxProps extends React.ComponentPropsWithoutRef<'in
45
45
  reduxFormValueType?: 'array' | 'boolean';
46
46
  }
47
47
  export declare type CheckboxLabelProps = {
48
- direction: string;
49
- variant: string;
48
+ direction?: string;
49
+ variant?: string;
50
50
  checked: boolean;
51
- disabled: boolean;
52
- labelPosition: string;
53
- backgroundOnHover: boolean;
54
- backgroundOnSelect: boolean;
51
+ disabled?: boolean;
52
+ labelPosition?: string;
53
+ backgroundOnHover?: boolean;
54
+ backgroundOnSelect?: boolean;
55
55
  };
@@ -1,8 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { JRCAppLeftColumnProps } from './JRCAppLeftColumn.types';
3
2
  declare const _default: {
4
3
  title: string;
5
- component: <T extends import("./JRCAppLeftColumn.types").SectionEntry = import("./JRCAppLeftColumn.types").SectionEntry>({ Component, ...props }: JRCAppLeftColumnProps<T>) => JSX.Element;
4
+ component: <T extends import("./JRCAppLeftColumn.types").SectionEntry = import("./JRCAppLeftColumn.types").SectionEntry>({ Component, ...props }: import("./JRCAppLeftColumn.types").JRCAppLeftColumnProps<T>) => JSX.Element;
6
5
  };
7
6
  export default _default;
8
- export declare const Simple: (args: JRCAppLeftColumnProps<any>) => JSX.Element;
7
+ export declare const Simple: () => JSX.Element;
@@ -1,2 +1,7 @@
1
1
  import { DependencyList } from 'react';
2
+ /**
3
+ * Simulate the React v16 useDidMountEffect
4
+ * @param func
5
+ * @param deps be sure to pass ALL the deps used in your effect
6
+ */
2
7
  export declare const useDidMountEffect: (func: Function, deps: DependencyList) => void;
@@ -1,18 +1,18 @@
1
1
  export interface ITheme {
2
2
  config: ThemeType;
3
3
  get: () => ThemeType;
4
- initTheme: (options: ThemeConfigOptions) => void;
4
+ initTheme: (options?: ThemeConfigOptions) => void;
5
5
  }
6
6
  export declare type ThemeConfigOptions = {
7
- fontFamily: string;
7
+ fontFamily?: string;
8
8
  linkColor: string;
9
9
  buttonColor: string;
10
- headerColor: string;
10
+ headerColor?: string;
11
11
  headerTextColor: string;
12
12
  headerUserBackground: string;
13
13
  headerUserTextColor: string;
14
14
  headerSearchBarTextColor: string;
15
- headerSearchBarBackgroundColor: string;
15
+ headerSearchBarBackgroundColor?: string;
16
16
  navBackground: string;
17
17
  navTextColor: string;
18
18
  bgColorNotLogged: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-react-components",
3
- "version": "1.0.86",
3
+ "version": "1.0.91",
4
4
  "description": "",
5
5
  "main": "./build/jamespot-react-components.js",
6
6
  "types": "./build/src/index.d.ts",
@@ -98,7 +98,7 @@
98
98
  "@types/redux-logger": "^3.0.8",
99
99
  "chroma-js": "^2.1.1",
100
100
  "classnames": "^2.3.1",
101
- "jamespot-user-api": "^1.0.50",
101
+ "jamespot-user-api": "^1.0.61",
102
102
  "moment": "^2.29.1",
103
103
  "react": "^17.x",
104
104
  "react-dnd": "^14.0.4",