@oc-digital/react-component-library 4.4.0-beta.0 → 4.8.2-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.
@@ -1,18 +1,18 @@
1
1
  import { ReactNode } from "react";
2
- declare type BreadcrumbSlot = {
2
+ type BreadcrumbSlot = {
3
3
  name: string;
4
4
  link: string;
5
5
  };
6
- declare type BreadCrumbKeys = "first" | "second" | "third";
7
- declare type IBreadcrumbs = {
6
+ type BreadCrumbKeys = "first" | "second" | "third";
7
+ type IBreadcrumbs = {
8
8
  [K in BreadCrumbKeys]?: BreadcrumbSlot;
9
9
  };
10
- declare type colorOptions = {
10
+ type colorOptions = {
11
11
  background?: string;
12
12
  color?: string;
13
13
  };
14
- declare type ColorKeys = "primary" | "secondary" | "tertiary";
15
- export declare type IBreadcrumbColors = {
14
+ type ColorKeys = "primary" | "secondary" | "tertiary";
15
+ export type IBreadcrumbColors = {
16
16
  [K in ColorKeys]?: colorOptions;
17
17
  };
18
18
  export interface IBreadcrumbsProps {
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { IButtonProps } from "./Button.types";
3
- declare function Button<C extends React.ElementType>({ loading, children, errors, type, onClick, disabled, variant, styling, color, accessLevel, ...rest }: IButtonProps<C>): JSX.Element | null;
3
+ declare function Button({ loading, children, errors, type, onClick, disabled, variant, styling, color, accessLevel, ...rest }: IButtonProps): React.JSX.Element | null;
4
4
  export default Button;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { IAuthoriserProp } from "../globals";
3
3
  import { ButtonProps } from "@mui/material/Button";
4
- export declare type IButtonProps<C extends React.ElementType> = ButtonProps<C, {
4
+ export type IButtonProps<C extends React.ElementType = React.ElementType> = ButtonProps<C, {
5
5
  component?: C;
6
6
  }> & IAuthoriserProp & {
7
7
  loading?: boolean;
@@ -1,5 +1,5 @@
1
1
  import { DatePickerProps } from "@mui/x-date-pickers/DatePicker";
2
2
  import { IAuthoriserProp } from "../globals";
3
- export declare type IDatePickerProps = DatePickerProps<Date> & IAuthoriserProp & {
3
+ export type IDatePickerProps = DatePickerProps<Date> & IAuthoriserProp & {
4
4
  styling?: string;
5
5
  };
@@ -2,18 +2,18 @@ import { CellProps, HeaderGroup, Row, TableBodyPropGetter, TableBodyProps, Table
2
2
  import { SchemaOf } from "yup";
3
3
  import React from "react";
4
4
  import { VirtualItem } from "react-virtual/types";
5
- export declare type IAlignment = "left" | "right" | "inherit" | "center" | "justify";
6
- export declare type RowData = {
5
+ export type IAlignment = "left" | "right" | "inherit" | "center" | "justify";
6
+ export type RowData = {
7
7
  [key: string]: any;
8
8
  };
9
- export declare type ITableHeader = {
9
+ export type ITableHeader = {
10
10
  Header: string | JSX.Element;
11
11
  accessor: string;
12
12
  textAlign?: IAlignment;
13
13
  };
14
- export declare type TableCellValues = null | undefined | string | number | Date | boolean | string[];
15
- export declare type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean) => void;
16
- export declare type FieldConfig = {
14
+ export type TableCellValues = null | undefined | string | number | Date | boolean | string[];
15
+ export type SynchCellWithStateFn = (rowIndex: number, columnId: string, value: TableCellValues, errorStatus: boolean, forceUpdate?: boolean) => void;
16
+ export type FieldConfig = {
17
17
  [key: string]: {
18
18
  validationRule?: SchemaOf<any>;
19
19
  dependentValidationRule?: (values: {
@@ -60,7 +60,7 @@ export interface IEditableTableProps {
60
60
  includeGlobalSearch?: boolean;
61
61
  disableHeaderSelect?: boolean;
62
62
  }
63
- declare type AdditionalCellProps = Pick<IEditableTableProps, "fieldConfig" | "syncCellWithState" | "setRows">;
63
+ type AdditionalCellProps = Pick<IEditableTableProps, "fieldConfig" | "syncCellWithState" | "setRows">;
64
64
  export interface ExtendedCellProps extends AdditionalCellProps, CellProps<RowData> {
65
65
  disabled: boolean;
66
66
  }
@@ -6,16 +6,16 @@ export declare const TableTextField: React.FC<IEssentialRenderFnProps & {
6
6
  widthOverride?: string | undefined;
7
7
  name?: string | undefined;
8
8
  }>;
9
- export declare const tableTextField: (tableProps: ICustomRenderFnProps) => JSX.Element;
10
- export declare const tableNumericStringField: (tableProps: ICustomRenderFnProps) => JSX.Element;
11
- export declare const tableNumericStringFixedDecimalField: (tableProps: ICustomRenderFnProps) => JSX.Element;
9
+ export declare const tableTextField: (tableProps: ICustomRenderFnProps) => React.JSX.Element;
10
+ export declare const tableNumericStringField: (tableProps: ICustomRenderFnProps) => React.JSX.Element;
11
+ export declare const tableNumericStringFixedDecimalField: (tableProps: ICustomRenderFnProps) => React.JSX.Element;
12
12
  export declare const SelectionCheckbox: React.JSXElementConstructor<Omit<import("@mui/material").CheckboxProps, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"root">>;
13
13
  interface ITableDatePicker extends IEssentialRenderFnProps {
14
14
  fullDate?: boolean;
15
15
  }
16
16
  export declare const TableDatePicker: React.FC<ITableDatePicker>;
17
- export declare const tableDateField: (tableProps: ICustomRenderFnProps) => JSX.Element;
18
- export declare const tableCheckbox: (tableProps: ICustomRenderFnProps) => JSX.Element;
17
+ export declare const tableDateField: (tableProps: ICustomRenderFnProps) => React.JSX.Element;
18
+ export declare const tableCheckbox: (tableProps: ICustomRenderFnProps) => React.JSX.Element;
19
19
  interface INonEditableField extends Pick<IEssentialRenderFnProps, "numberField" | "prefix" | "suffix" | "textAlign" | "fixedDecimalScale"> {
20
20
  text: React.ReactText;
21
21
  styling?: string;
@@ -6,7 +6,7 @@ export interface INavigationLink {
6
6
  Icon: React.FC<ISvgComponentProps>;
7
7
  hasSecondary?: boolean;
8
8
  }
9
- export declare type IExpandedOptions = {
9
+ export type IExpandedOptions = {
10
10
  view: string;
11
11
  expanded: boolean;
12
12
  };
@@ -2,7 +2,7 @@ import { ReactElement } from "react";
2
2
  export interface IMainLayoutProps {
3
3
  id?: string;
4
4
  sideNavigation?: ReactElement;
5
- desktopWidth?: boolean;
5
+ desktopWidth?: boolean | string;
6
6
  children: ReactElement;
7
7
  topOffset?: number | string;
8
8
  }
@@ -1,5 +1,5 @@
1
1
  import { MobileDatePickerProps } from "@mui/x-date-pickers/MobileDatePicker";
2
2
  import { IAuthoriserProp } from "../globals";
3
- export declare type IMobileDatePickerProps = MobileDatePickerProps<Date> & IAuthoriserProp & {
3
+ export type IMobileDatePickerProps = MobileDatePickerProps<Date> & IAuthoriserProp & {
4
4
  styling?: string;
5
5
  };
@@ -1,6 +1,6 @@
1
- import { FC } from "react";
1
+ import React, { FC } from "react";
2
2
  import { ISvgComponentProps } from "../SvgComponents/types";
3
- export declare type NavbarProps = {
3
+ export type NavbarProps = {
4
4
  tabs: Array<{
5
5
  Icon: FC<ISvgComponentProps>;
6
6
  field: string;
@@ -8,5 +8,5 @@ export declare type NavbarProps = {
8
8
  separate?: boolean;
9
9
  }>;
10
10
  };
11
- declare const Navbar: ({ tabs }: NavbarProps) => JSX.Element;
11
+ declare const Navbar: ({ tabs }: NavbarProps) => React.JSX.Element;
12
12
  export default Navbar;
@@ -1,16 +1,16 @@
1
1
  import React, { FC } from "react";
2
2
  import { ISvgComponentProps } from "../SvgComponents/types";
3
- export declare type NavbarLayoutTabs = Array<{
3
+ export type NavbarLayoutTabs = Array<{
4
4
  Icon: FC<ISvgComponentProps>;
5
5
  field: string;
6
6
  path: string;
7
7
  separate?: boolean;
8
8
  }>;
9
- export declare type NavbarLayoutProps = {
9
+ export type NavbarLayoutProps = {
10
10
  tabs: NavbarLayoutTabs;
11
11
  hideTabs?: boolean;
12
12
  leaveHeightForMenu?: boolean;
13
13
  children: React.ReactNode;
14
14
  };
15
- declare const NavbarLayout: ({ tabs, hideTabs, leaveHeightForMenu, children, }: NavbarLayoutProps) => JSX.Element;
15
+ declare const NavbarLayout: ({ tabs, hideTabs, leaveHeightForMenu, children, }: NavbarLayoutProps) => React.JSX.Element;
16
16
  export default NavbarLayout;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare type cellAlignmentOptions = "centerJustify" | "leftJustify" | "rightJustify";
3
- export declare type headerColours = {
2
+ export type cellAlignmentOptions = "centerJustify" | "leftJustify" | "rightJustify";
3
+ export type headerColours = {
4
4
  background?: string;
5
5
  border?: string;
6
6
  text?: string;
@@ -12,4 +12,4 @@ interface INumberFormatProps extends Omit<NumberFormatProps, "onChange"> {
12
12
  }) => void;
13
13
  fixedDecimalScale: boolean;
14
14
  }
15
- export declare const NumberFormatField: (props: INumberFormatProps) => JSX.Element;
15
+ export declare const NumberFormatField: (props: INumberFormatProps) => React.JSX.Element;
@@ -15,11 +15,11 @@ export declare const FORM_LOADING = "loading";
15
15
  export declare const FORM_ENABLED = "enabled";
16
16
  export declare const FORM_WARNING = "warning";
17
17
  export declare const FORM_DELETING = "deleting";
18
- export declare type FormStatuses = typeof FORM_SUCCESS | typeof FORM_ERROR | typeof FORM_LOADING | typeof FORM_ENABLED | typeof FORM_WARNING | typeof FORM_DELETING;
18
+ export type FormStatuses = typeof FORM_SUCCESS | typeof FORM_ERROR | typeof FORM_LOADING | typeof FORM_ENABLED | typeof FORM_WARNING | typeof FORM_DELETING;
19
19
  export declare const READ_LEVEL = "read";
20
20
  export declare const WRITE_LEVEL = "write";
21
21
  export declare const NO_ACCESS_LEVEL = "noAccess";
22
- export declare type AccessLevels = typeof READ_LEVEL | typeof WRITE_LEVEL | typeof NO_ACCESS_LEVEL;
22
+ export type AccessLevels = typeof READ_LEVEL | typeof WRITE_LEVEL | typeof NO_ACCESS_LEVEL;
23
23
  export interface IAuthoriserProp {
24
24
  accessLevel?: AccessLevels;
25
25
  }