@oc-digital/react-component-library 7.2.3-beta.0 → 7.2.3-beta.10
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/build/Alert/Alert.d.ts +5 -0
- package/build/Alert/Alert.types.d.ts +14 -0
- package/build/AlphabeticalList/AlphabeticalList.d.ts +5 -0
- package/build/AlphabeticalList/AlphabeticalList.types.d.ts +22 -0
- package/build/AutoSave/Select/AutoSave.types.d.ts +11 -0
- package/build/AutoSave/Select/index.d.ts +4 -0
- package/build/AutoSave/Text/AutoSave.types.d.ts +17 -0
- package/build/AutoSave/Text/index.d.ts +4 -0
- package/build/Breadcrumbs/Breadcrumbs.d.ts +5 -0
- package/build/Breadcrumbs/Breadcrumbs.types.d.ts +24 -0
- package/build/Button/Button.d.ts +4 -0
- package/build/Button/Button.types.d.ts +10 -0
- package/build/ButtonWithConfirm/ButtonWithConfirm.d.ts +5 -0
- package/build/ButtonWithConfirm/ButtonWithConfirm.types.d.ts +9 -0
- package/build/ContentBox/ContentBox.d.ts +5 -0
- package/build/ContentBox/ContentBox.types.d.ts +7 -0
- package/build/ContentLabel/ContentLabel.d.ts +5 -0
- package/build/ContentLabel/ContentLabel.types.d.ts +5 -0
- package/build/DatePicker/DatePicker.d.ts +5 -0
- package/build/DatePicker/DatePicker.types.d.ts +6 -0
- package/build/EditableTable/EditableTable.d.ts +5 -0
- package/build/EditableTable/EditableTable.types.d.ts +107 -0
- package/build/EditableTable/components/TableCheckbox.d.ts +8 -0
- package/build/EditableTable/components/TableDateInput.d.ts +8 -0
- package/build/EditableTable/components/TableTextInput.d.ts +21 -0
- package/build/EditableTable/components/utils/getTextWidth.d.ts +13 -0
- package/build/EditableTable/defaultCells.d.ts +31 -0
- package/build/EntityList/EntityList.d.ts +5 -0
- package/build/EntityList/EntityList.types.d.ts +15 -0
- package/build/ErrorIndicator/ErrorIndicator.d.ts +5 -0
- package/build/ErrorIndicator/ErrorIndicator.types.d.ts +5 -0
- package/build/ImageDisplayAndUpload/ImageDisplayAndUpload.d.ts +5 -0
- package/build/ImageDisplayAndUpload/ImageDisplayAndUpload.types.d.ts +9 -0
- package/build/KeyboardDatePicker/KeyboardDatePicker.d.ts +5 -0
- package/build/KeyboardDatePicker/KeyboardDatePicker.types.d.ts +6 -0
- package/build/LeftNavigation/LeftNavigation.d.ts +5 -0
- package/build/LeftNavigation/LeftNavigation.types.d.ts +97 -0
- package/build/LeftNavigation/NavListItem.d.ts +5 -0
- package/build/LeftNavigation/PrimaryLeftNavigation.d.ts +5 -0
- package/build/LeftNavigation/SecondaryLeftNavigation.d.ts +5 -0
- package/build/LoadingSpinner/LoadingSpinner.d.ts +5 -0
- package/build/LoadingSpinner/LoadingSpinner.types.d.ts +6 -0
- package/build/MainLayout/MainLayout.d.ts +5 -0
- package/build/MainLayout/MainLayout.types.d.ts +11 -0
- package/build/MobileDatePicker/MobileDatePicker.d.ts +5 -0
- package/build/MobileDatePicker/MobileDatePicker.types.d.ts +6 -0
- package/build/NavbarLayout/Navbar.d.ts +13 -0
- package/build/NavbarLayout/NavbarLayout.d.ts +17 -0
- package/build/NavbarLayout/index.d.ts +2 -0
- package/build/SearchBar/SearchBar.d.ts +5 -0
- package/build/SearchBar/SearchBar.types.d.ts +33 -0
- package/build/Select/Select.d.ts +5 -0
- package/build/Select/Select.types.d.ts +16 -0
- package/build/StaticTable/StaticTable.d.ts +5 -0
- package/build/StaticTable/StaticTable.types.d.ts +21 -0
- package/build/SvgComponents/ContainedPartnersLogo.d.ts +5 -0
- package/build/SvgComponents/HomeSvg.d.ts +5 -0
- package/build/SvgComponents/NovelLogoSvg.d.ts +5 -0
- package/build/SvgComponents/OrganisationList.d.ts +5 -0
- package/build/SvgComponents/ProjectsSvg.d.ts +5 -0
- package/build/SvgComponents/index.d.ts +5 -0
- package/build/SvgComponents/types.d.ts +6 -0
- package/build/TextField/TextField.d.ts +16 -0
- package/build/TextField/TextField.types.d.ts +8 -0
- package/build/Tooltip/OptionalTooltip.d.ts +9 -0
- package/build/Tooltip/index.d.ts +1 -0
- package/build/globals/index.d.ts +26 -0
- package/build/hooks/index.d.ts +3 -0
- package/build/hooks/useDebounceEffect.d.ts +2 -0
- package/build/hooks/useInterval.d.ts +2 -0
- package/build/hooks/useWhyDidYouUpdate.d.ts +1 -0
- package/build/index.d.ts +38 -0
- package/build/index.js +413 -62833
- package/build/index.js.map +1 -1
- package/build/stories/Button.d.ts +28 -0
- package/build/stories/Button.stories.d.ts +10 -0
- package/build/stories/Header.d.ts +12 -0
- package/build/stories/Header.stories.d.ts +8 -0
- package/build/stories/Page.d.ts +3 -0
- package/build/stories/Page.stories.d.ts +8 -0
- package/build/styles/colours.d.ts +3 -0
- package/build/styles/font.d.ts +1 -0
- package/build/styles/index.d.ts +3 -0
- package/build/styles/layout.d.ts +1 -0
- package/build/styles/spacing.d.ts +1 -0
- package/build/styles/themes.d.ts +2 -0
- package/build/utils/index.d.ts +6 -0
- package/package.json +6 -7
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { ISvgComponentProps } from '../SvgComponents/types';
|
|
3
|
+
|
|
4
|
+
export type NavbarProps = {
|
|
5
|
+
tabs: Array<{
|
|
6
|
+
Icon: FC<ISvgComponentProps>;
|
|
7
|
+
field: string;
|
|
8
|
+
path: string;
|
|
9
|
+
separate?: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
};
|
|
12
|
+
declare const Navbar: ({ tabs }: NavbarProps) => JSX.Element;
|
|
13
|
+
export default Navbar;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { default as React, FC } from 'react';
|
|
2
|
+
import { ISvgComponentProps } from '../SvgComponents/types';
|
|
3
|
+
|
|
4
|
+
export type NavbarLayoutTabs = Array<{
|
|
5
|
+
Icon: FC<ISvgComponentProps>;
|
|
6
|
+
field: string;
|
|
7
|
+
path: string;
|
|
8
|
+
separate?: boolean;
|
|
9
|
+
}>;
|
|
10
|
+
export type NavbarLayoutProps = {
|
|
11
|
+
tabs: NavbarLayoutTabs;
|
|
12
|
+
hideTabs?: boolean;
|
|
13
|
+
leaveHeightForMenu?: boolean;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
};
|
|
16
|
+
declare const NavbarLayout: ({ tabs, hideTabs, leaveHeightForMenu, children, }: NavbarLayoutProps) => JSX.Element;
|
|
17
|
+
export default NavbarLayout;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface ISearchBarProps {
|
|
3
|
+
array: any[] | undefined | null;
|
|
4
|
+
sortFn?: (arg1: any, arg2: any) => number;
|
|
5
|
+
sortKey?: string;
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
buttonClick?: (item?: any) => void;
|
|
8
|
+
linkTo?: (item?: any) => string;
|
|
9
|
+
ItemTemplate: React.FC<{
|
|
10
|
+
item: any;
|
|
11
|
+
}>;
|
|
12
|
+
arrayKey?: string;
|
|
13
|
+
loadingMessage?: string;
|
|
14
|
+
emptyMessage?: string;
|
|
15
|
+
inputBackgroundColor?: string;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
disabledSearch?: boolean;
|
|
18
|
+
delay?: number;
|
|
19
|
+
minQueryLength?: number;
|
|
20
|
+
handleOnChange?: (query: string) => void;
|
|
21
|
+
searchKeys?: string[];
|
|
22
|
+
alphabetisedHeader?: boolean;
|
|
23
|
+
/** setting this will initialise the search query to a value */
|
|
24
|
+
initialSearchQuery?: string;
|
|
25
|
+
/** dynamically generate an empty list message based on what was searched for */
|
|
26
|
+
dynamicEmptyMessage?: (query: string) => string | JSX.Element;
|
|
27
|
+
isResultDisabled?: (result: any) => {
|
|
28
|
+
disabled: true;
|
|
29
|
+
reason: string;
|
|
30
|
+
} | {
|
|
31
|
+
disabled: false;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OutlinedTextFieldProps } from '@mui/material';
|
|
2
|
+
import { IAuthoriserProp } from '../globals';
|
|
3
|
+
|
|
4
|
+
export interface ISelectProps extends IAuthoriserProp, Omit<OutlinedTextFieldProps, "variant"> {
|
|
5
|
+
selectOptions: {
|
|
6
|
+
value: string | number;
|
|
7
|
+
description: React.ReactNode;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}[];
|
|
10
|
+
maxListHeight?: number;
|
|
11
|
+
styling?: string;
|
|
12
|
+
variant?: "outlined" | "standard";
|
|
13
|
+
onOpen?: () => unknown;
|
|
14
|
+
onClose?: () => unknown;
|
|
15
|
+
itemClassName?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type cellAlignmentOptions = "centerJustify" | "leftJustify" | "rightJustify";
|
|
3
|
+
export type headerColours = {
|
|
4
|
+
background?: string;
|
|
5
|
+
border?: string;
|
|
6
|
+
text?: string;
|
|
7
|
+
};
|
|
8
|
+
export interface IStaticTableProps {
|
|
9
|
+
headers?: React.ReactNode[];
|
|
10
|
+
headerCellAlignment?: cellAlignmentOptions[];
|
|
11
|
+
rows: {
|
|
12
|
+
onClick?: () => void;
|
|
13
|
+
row: React.ReactNode[];
|
|
14
|
+
}[] | null | undefined;
|
|
15
|
+
rowCellAlignment?: cellAlignmentOptions[];
|
|
16
|
+
rowBorderSeparation?: boolean;
|
|
17
|
+
styling?: string;
|
|
18
|
+
headerColours?: headerColours;
|
|
19
|
+
paginate?: boolean;
|
|
20
|
+
itemsPerPage?: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as NovelLogoSvg } from './NovelLogoSvg';
|
|
2
|
+
export { default as ContainedPartnersLogo } from './ContainedPartnersLogo';
|
|
3
|
+
export { default as OrganisationList } from './OrganisationList';
|
|
4
|
+
export { default as HomeSvg } from './HomeSvg';
|
|
5
|
+
export { default as ProjectsSvg } from './ProjectsSvg';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NumericFormatProps } from 'react-number-format';
|
|
3
|
+
import { ITextFieldProps } from './TextField.types';
|
|
4
|
+
|
|
5
|
+
declare const TextField: React.FC<ITextFieldProps>;
|
|
6
|
+
export default TextField;
|
|
7
|
+
interface INumberFormatProps extends Omit<NumericFormatProps, "onChange"> {
|
|
8
|
+
onChange: (event: {
|
|
9
|
+
target: {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
};
|
|
13
|
+
}) => void;
|
|
14
|
+
fixedDecimalScale: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const NumberFormatField: (props: INumberFormatProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OutlinedTextFieldProps } from '@mui/material';
|
|
2
|
+
import { IAuthoriserProp } from '../globals';
|
|
3
|
+
|
|
4
|
+
export interface ITextFieldProps extends IAuthoriserProp, Omit<OutlinedTextFieldProps, "variant"> {
|
|
5
|
+
styling?: string;
|
|
6
|
+
numberField?: boolean;
|
|
7
|
+
fixedDecimalScale?: boolean;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './OptionalTooltip';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const HALF_REM = "0.5rem";
|
|
2
|
+
export declare const ONE_REM = "1rem";
|
|
3
|
+
export declare const ONE_AND_HALF_REM = "1.5rem";
|
|
4
|
+
export declare const TWO_REM = "3rem";
|
|
5
|
+
export declare const THREE_REM = "3rem";
|
|
6
|
+
export declare const EDITED_STATUS = "EDITED";
|
|
7
|
+
export declare const NEW_STATUS = "NEW";
|
|
8
|
+
export declare const VALIDATION_MESSAGE_REQUIRED = "Required";
|
|
9
|
+
export declare const REGEX_NUMBER_WITH_DECIMALS: RegExp;
|
|
10
|
+
export declare const YUP_REQUIRED_STRING_SHORT_MESSAGE: import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
11
|
+
export declare const YUP_STRING_NUMBER_WITH_DECIMALS: import('yup/lib/string').RequiredStringSchema<string | undefined, import('yup/lib/types').AnyObject>;
|
|
12
|
+
export declare const FORM_SUCCESS = "success";
|
|
13
|
+
export declare const FORM_ERROR = "error";
|
|
14
|
+
export declare const FORM_LOADING = "loading";
|
|
15
|
+
export declare const FORM_ENABLED = "enabled";
|
|
16
|
+
export declare const FORM_WARNING = "warning";
|
|
17
|
+
export declare const FORM_DELETING = "deleting";
|
|
18
|
+
export type FormStatuses = typeof FORM_SUCCESS | typeof FORM_ERROR | typeof FORM_LOADING | typeof FORM_ENABLED | typeof FORM_WARNING | typeof FORM_DELETING;
|
|
19
|
+
export declare const READ_LEVEL = "read";
|
|
20
|
+
export declare const WRITE_LEVEL = "write";
|
|
21
|
+
export declare const NO_ACCESS_LEVEL = "noAccess";
|
|
22
|
+
export type AccessLevels = typeof READ_LEVEL | typeof WRITE_LEVEL | typeof NO_ACCESS_LEVEL;
|
|
23
|
+
export interface IAuthoriserProp {
|
|
24
|
+
accessLevel?: AccessLevels;
|
|
25
|
+
}
|
|
26
|
+
export declare const BORDER_RADIUS = "14px";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function useWhyDidYouUpdate(name: string, props: Record<string, any>): void;
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as Button } from './Button/Button';
|
|
2
|
+
import { default as ContentLabel } from './ContentLabel/ContentLabel';
|
|
3
|
+
import { default as ContentBox } from './ContentBox/ContentBox';
|
|
4
|
+
import { default as StaticTable } from './StaticTable/StaticTable';
|
|
5
|
+
import { default as LoadingSpinner } from './LoadingSpinner/LoadingSpinner';
|
|
6
|
+
import { default as Breadcrumbs } from './Breadcrumbs/Breadcrumbs';
|
|
7
|
+
import { default as EntityList } from './EntityList/EntityList';
|
|
8
|
+
import { IEntity } from './EntityList/EntityList.types';
|
|
9
|
+
import { default as ErrorIndicator } from './ErrorIndicator/ErrorIndicator';
|
|
10
|
+
import { default as LeftNavigation } from './LeftNavigation/LeftNavigation';
|
|
11
|
+
import { INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem } from './LeftNavigation/LeftNavigation.types';
|
|
12
|
+
import { default as MainLayout } from './MainLayout/MainLayout';
|
|
13
|
+
import { default as SearchBar } from './SearchBar/SearchBar';
|
|
14
|
+
import { default as TextField, NumberFormatField } from './TextField/TextField';
|
|
15
|
+
import { default as Select } from './Select/Select';
|
|
16
|
+
import { default as DatePicker } from './DatePicker/DatePicker';
|
|
17
|
+
import { default as KeyboardDatePicker } from './KeyboardDatePicker/KeyboardDatePicker';
|
|
18
|
+
import { default as ButtonWithConfirm } from './ButtonWithConfirm/ButtonWithConfirm';
|
|
19
|
+
import { default as EditableTable } from './EditableTable/EditableTable';
|
|
20
|
+
import { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps } from './EditableTable/EditableTable.types';
|
|
21
|
+
import { tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, TableSelect, TableMultipleSelect, NonEditableField } from './EditableTable/defaultCells';
|
|
22
|
+
import { useDebounceEffect, useInterval, useWhyDidYouUpdate } from './hooks';
|
|
23
|
+
import { didCellValueChange } from './utils';
|
|
24
|
+
import { default as ImageDisplayAndUpload } from './ImageDisplayAndUpload/ImageDisplayAndUpload';
|
|
25
|
+
import { default as Alert } from './Alert/Alert';
|
|
26
|
+
import { default as AlphabeticalList } from './AlphabeticalList/AlphabeticalList';
|
|
27
|
+
import { ISelectProps } from './Select/Select.types';
|
|
28
|
+
import { NavbarLayout, NavbarLayoutTabs } from './NavbarLayout';
|
|
29
|
+
import { FORM_SUCCESS, FORM_ERROR, FORM_LOADING, FORM_ENABLED, FORM_WARNING, FORM_DELETING, FormStatuses } from './globals';
|
|
30
|
+
import { default as MobileDatePicker } from './MobileDatePicker/MobileDatePicker';
|
|
31
|
+
import { AutoSaveTextField } from './AutoSave/Text';
|
|
32
|
+
import { AutoSaveSelectField } from './AutoSave/Select';
|
|
33
|
+
import { OptionalTooltip } from './Tooltip';
|
|
34
|
+
import { TableDateInput } from './EditableTable/components/TableDateInput';
|
|
35
|
+
import { TableTextInput } from './EditableTable/components/TableTextInput';
|
|
36
|
+
|
|
37
|
+
export { ImageDisplayAndUpload, Alert, Button, ContentLabel, ContentBox, StaticTable, LoadingSpinner, Breadcrumbs, EntityList, ErrorIndicator, LeftNavigation, MainLayout, SearchBar, TextField, Select, DatePicker, AutoSaveTextField, AutoSaveSelectField, KeyboardDatePicker, MobileDatePicker, ButtonWithConfirm, EditableTable, TableSelect, TableMultipleSelect, NonEditableField, TableDateInput as TableDatePicker, TableTextInput as TableTextField, tableNumericStringField, tableNumericStringFixedDecimalField, tableDateField, tableCheckbox, didCellValueChange, useDebounceEffect, useInterval, useWhyDidYouUpdate, AlphabeticalList, NumberFormatField, NavbarLayout, OptionalTooltip, FORM_SUCCESS, FORM_ERROR, FORM_LOADING, FORM_ENABLED, FORM_WARNING, FORM_DELETING, };
|
|
38
|
+
export type { FieldConfig, RowData, ITableHeader, TableCellValues, SynchCellWithStateFn, ICustomRenderFnProps, IEssentialRenderFnProps, ISelectProps, IEntity, INavigationLink, ISecondaryNavigationItem, ISecondaryNavigationSubItem, NavbarLayoutTabs, FormStatuses, };
|