@simoncomputing/mui-bueno-v3 0.1.12
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/CHANGELOG.md +45 -0
- package/README.md +33 -0
- package/dist/@types/index.d.ts +192 -0
- package/dist/common/TestUtils/reactHookForms.d.ts +54 -0
- package/dist/common/TestUtils/renderWithReactHookForm.d.ts +7 -0
- package/dist/common/Utils/index.d.ts +65 -0
- package/dist/common/WindowDimensions/WindowDimensions.d.ts +26 -0
- package/dist/components/Alerts/Alert.d.ts +30 -0
- package/dist/components/Alerts/ErrorAlert.d.ts +4 -0
- package/dist/components/Alerts/InfoAlert.d.ts +4 -0
- package/dist/components/Alerts/SuccessAlert.d.ts +4 -0
- package/dist/components/Alerts/WarningAlert.d.ts +4 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +10 -0
- package/dist/components/Buttons/Button/Button.d.ts +24 -0
- package/dist/components/Buttons/ScrollToTop/ScrollToTop.d.ts +14 -0
- package/dist/components/Buttons/Submit/Submit.d.ts +11 -0
- package/dist/components/Form/Error/Error.d.ts +23 -0
- package/dist/components/Form/FormDebugger/FormDebugger.d.ts +8 -0
- package/dist/components/Form/Inputs/Autocomplete/Autocomplete.d.ts +81 -0
- package/dist/components/Form/Inputs/Autocomplete/DynamicAutocomplete/DynamicAutocomplete.d.ts +31 -0
- package/dist/components/Form/Inputs/Autocomplete/MultiAutocomplete/MultiAutocomplete.d.ts +22 -0
- package/dist/components/Form/Inputs/Autocomplete/utils.d.ts +2 -0
- package/dist/components/Form/Inputs/Checkbox/Checkbox.d.ts +58 -0
- package/dist/components/Form/Inputs/CheckboxGroup/CheckboxGroup.d.ts +112 -0
- package/dist/components/Form/Inputs/CitationField/CitationBubbleMenuHandler.d.ts +43 -0
- package/dist/components/Form/Inputs/CitationField/CitationField.d.ts +78 -0
- package/dist/components/Form/Inputs/CitationField/CitationMenu/AttachmentForm.d.ts +13 -0
- package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationBubbleMenu.d.ts +25 -0
- package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationForm.d.ts +12 -0
- package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationMenu.d.ts +62 -0
- package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationTable.d.ts +16 -0
- package/dist/components/Form/Inputs/CitationField/CitationNode.d.ts +2 -0
- package/dist/components/Form/Inputs/CitationField/CitationNodeComponent.d.ts +7 -0
- package/dist/components/Form/Inputs/CitationField/CitationRefreshContext/CitationRefreshContext.d.ts +29 -0
- package/dist/components/Form/Inputs/CitationField/MenuButtonEditCitation.d.ts +3 -0
- package/dist/components/Form/Inputs/DateField/DateField.d.ts +73 -0
- package/dist/components/Form/Inputs/DateField/DateRangeField/DateRangeField.d.ts +62 -0
- package/dist/components/Form/Inputs/DateField/dayjs-utils.d.ts +2 -0
- package/dist/components/Form/Inputs/FileUpload/FileList/FileList.d.ts +13 -0
- package/dist/components/Form/Inputs/FileUpload/FileUpload.d.ts +62 -0
- package/dist/components/Form/Inputs/Location/Location.d.ts +69 -0
- package/dist/components/Form/Inputs/Location/Location.types.d.ts +85 -0
- package/dist/components/Form/Inputs/Location/LocationOption.d.ts +38 -0
- package/dist/components/Form/Inputs/RadioGroup/RadioGroup.d.ts +119 -0
- package/dist/components/Form/Inputs/RangeSlider/RangeSlider.d.ts +34 -0
- package/dist/components/Form/Inputs/RichTextField/RichTextControls.d.ts +6 -0
- package/dist/components/Form/Inputs/RichTextField/RichTextField.d.ts +56 -0
- package/dist/components/Form/Inputs/RichTextField/SuggestionList.d.ts +8 -0
- package/dist/components/Form/Inputs/RichTextField/mentionSuggestionOptions.d.ts +6 -0
- package/dist/components/Form/Inputs/RichTextField/useExtensions.d.ts +10 -0
- package/dist/components/Form/Inputs/SearchField/SearchField.d.ts +16 -0
- package/dist/components/Form/Inputs/Select/Select.d.ts +91 -0
- package/dist/components/Form/Inputs/Switch/Switch.d.ts +61 -0
- package/dist/components/Form/Inputs/TextField/TextField.d.ts +60 -0
- package/dist/components/Form/MForm/MForm.d.ts +19 -0
- package/dist/components/Form/MForm/useMyForm.d.ts +1 -0
- package/dist/components/Form/RepeatableFormGroup/RepeatableFormGroup.d.ts +89 -0
- package/dist/components/Form/Stepper/Stepper.d.ts +27 -0
- package/dist/components/Layout/MGrid/MGrid.d.ts +13 -0
- package/dist/components/Layout/MPanel/MPanel.d.ts +13 -0
- package/dist/components/Layout/MStack/MStack.d.ts +6 -0
- package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +22 -0
- package/dist/components/Modals/AlertModal/AlertModal.d.ts +11 -0
- package/dist/components/Modals/ConfirmationModal/ConfirmationModal.d.ts +26 -0
- package/dist/components/Modals/DecisionModal/DecisionModal.d.ts +37 -0
- package/dist/components/Modals/Modal.d.ts +45 -0
- package/dist/components/Navigation/Footer/Footer.d.ts +31 -0
- package/dist/components/Navigation/Header/DarkModeToggle/DarkModeToggle.d.ts +13 -0
- package/dist/components/Navigation/Header/Drawer.d.ts +18 -0
- package/dist/components/Navigation/Header/EnvironmentBanner.d.ts +4 -0
- package/dist/components/Navigation/Header/Header.d.ts +63 -0
- package/dist/components/Navigation/Header/ProfileMenu.d.ts +8 -0
- package/dist/components/Navigation/MenuButton/MenuButton.d.ts +9 -0
- package/dist/components/Navigation/NavBar/FloatingNavBar/FloatingNavBar.d.ts +24 -0
- package/dist/components/Navigation/NavBar/NavBar.d.ts +24 -0
- package/dist/components/Navigation/Sidebar/Sidebar.d.ts +14 -0
- package/dist/components/Navigation/Tabs/Tabs.d.ts +19 -0
- package/dist/components/PageHeader/PageHeader.d.ts +27 -0
- package/dist/components/SingleActionCard/SingleActionCard.d.ts +26 -0
- package/dist/components/Snackbar/Snackbar.d.ts +28 -0
- package/dist/components/Table/ExpandableRow/ExpandableRow.d.ts +16 -0
- package/dist/components/Table/PaginatedTable.d.ts +44 -0
- package/dist/components/Table/Table.d.ts +129 -0
- package/dist/index.cjs.js +410 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +112 -0
- package/dist/index.es.js +63994 -0
- package/dist/index.umd.js +411 -0
- package/dist/styles/3-theme/ThemeDemo.d.ts +3 -0
- package/dist/styles/3-theme/theme.d.ts +16 -0
- package/dist/styles/theme.d.ts +33 -0
- package/package.json +140 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { SelectProps as MuiSelectProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* *Interface used exclusively for creating the select menu within Select*
|
|
5
|
+
*
|
|
6
|
+
* SelectOption is an interface that defines the label and value of a select option.
|
|
7
|
+
* An array of this interface (`SelectOption<T>[]`) is used in the `<Select>` component as the `options` prop to
|
|
8
|
+
* define and create the select menu.
|
|
9
|
+
*/
|
|
10
|
+
export interface SelectOption<T> {
|
|
11
|
+
/**
|
|
12
|
+
* The ID for the option. This is the value that is returned to the form.
|
|
13
|
+
* @required
|
|
14
|
+
*/
|
|
15
|
+
value: T;
|
|
16
|
+
/**
|
|
17
|
+
* The label that is displayed in the select menu.
|
|
18
|
+
* @required
|
|
19
|
+
*/
|
|
20
|
+
label: string;
|
|
21
|
+
/**
|
|
22
|
+
* If true, the option will be disabled.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* If `true`, the component becomes readonly.
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
readOnly?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Margin for the FormControl
|
|
33
|
+
*/
|
|
34
|
+
margin?: 'dense' | 'none' | 'normal';
|
|
35
|
+
/**
|
|
36
|
+
* If true, an asterisk will be displayed next to the label
|
|
37
|
+
* Most browsers will automatically validate this, but it's recommended to also
|
|
38
|
+
* have Formik also validate as well so that `Error` displays for consistency.
|
|
39
|
+
* @default false
|
|
40
|
+
*/
|
|
41
|
+
required?: boolean;
|
|
42
|
+
}
|
|
43
|
+
type BaseSelectProps<T> = {
|
|
44
|
+
/**
|
|
45
|
+
* Must match the initialValue name in BForm.
|
|
46
|
+
* @required
|
|
47
|
+
*/
|
|
48
|
+
name: string;
|
|
49
|
+
/**
|
|
50
|
+
* Label for the select component
|
|
51
|
+
*/
|
|
52
|
+
label?: string;
|
|
53
|
+
/**
|
|
54
|
+
* A list of options for the select component.
|
|
55
|
+
*/
|
|
56
|
+
options?: SelectOption<T>[];
|
|
57
|
+
/**
|
|
58
|
+
* Displays an icon or text next to selected options
|
|
59
|
+
* @default undefined
|
|
60
|
+
*/
|
|
61
|
+
selectedOptionIcon?: React.ReactNode | string;
|
|
62
|
+
/**
|
|
63
|
+
* Specifies the visual input style.
|
|
64
|
+
* @default 'standard'
|
|
65
|
+
*/
|
|
66
|
+
variant?: 'filled' | 'outlined' | 'standard';
|
|
67
|
+
/**
|
|
68
|
+
* If true, the prepackaged dynamic input label that comes with Material UI's input components
|
|
69
|
+
* will be replaced with a static typography label above the input.
|
|
70
|
+
* @default false
|
|
71
|
+
*/
|
|
72
|
+
staticLabel?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Props from MUI-Bueno's Typography component.
|
|
75
|
+
* Used to customize the label when the static label option is selected.
|
|
76
|
+
*/
|
|
77
|
+
staticLabelProps?: TypographyProps;
|
|
78
|
+
/**
|
|
79
|
+
* If true, the component will be read only.
|
|
80
|
+
* @default false
|
|
81
|
+
*/
|
|
82
|
+
readOnly?: boolean;
|
|
83
|
+
};
|
|
84
|
+
export type SelectProps<T> = BaseSelectProps<T> & Omit<MuiSelectProps, 'native' | 'onChange' | 'readOnly' | 'fullWidth'>;
|
|
85
|
+
/**
|
|
86
|
+
* *Must be a child of BForm*
|
|
87
|
+
*
|
|
88
|
+
* `Select` provides a Material-UI Select Component.
|
|
89
|
+
*/
|
|
90
|
+
export declare const Select: <T = string>(props: SelectProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SwitchProps as MuiSwitchProps, TypographyProps, Theme, SwitchPropsColorOverrides } from '@mui/material';
|
|
2
|
+
import { OverridableStringUnion } from '@mui/types';
|
|
3
|
+
import { SystemProps } from '@mui/system';
|
|
4
|
+
export type BaseSwitchProps<T = boolean> = {
|
|
5
|
+
/**
|
|
6
|
+
* Name and ID of the component. Must match a key from defaultValues in React Hook Form.
|
|
7
|
+
* @required
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* Label that goes next to the switch.
|
|
12
|
+
* @recommended
|
|
13
|
+
*/
|
|
14
|
+
label?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Disabled
|
|
17
|
+
*/
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* The position of the label.
|
|
21
|
+
* @default 'end'
|
|
22
|
+
*/
|
|
23
|
+
labelPlacement?: 'start' | 'end' | 'top' | 'bottom';
|
|
24
|
+
/**
|
|
25
|
+
* If set, the component becomes readonly.
|
|
26
|
+
* By default, displays as "True" or "False". To use "On" or "Off", set to 'ON_OFF. To use "Yes" or "No", use 'YES_NO'
|
|
27
|
+
*/
|
|
28
|
+
readOnly?: true | 'ON_OFF' | 'YES_NO';
|
|
29
|
+
/**
|
|
30
|
+
* Props from MUI-Bueno's Typography component.
|
|
31
|
+
* Used to customize the label when the static label option is selected or the field is readOnly.
|
|
32
|
+
*/
|
|
33
|
+
staticLabelProps?: TypographyProps;
|
|
34
|
+
/**
|
|
35
|
+
* Override the value used in React Hook Form when the switch is ON
|
|
36
|
+
* @default True
|
|
37
|
+
*/
|
|
38
|
+
activeValue?: T extends boolean ? true : string;
|
|
39
|
+
/**
|
|
40
|
+
* Override the value used in React Hook Form when the switch is OFF
|
|
41
|
+
* @default False
|
|
42
|
+
*/
|
|
43
|
+
inactiveValue?: T extends boolean ? false : string;
|
|
44
|
+
/**
|
|
45
|
+
* Handle changes to the React Hook Form value when interacted with by the user
|
|
46
|
+
*/
|
|
47
|
+
onChange?: (checked: T) => void;
|
|
48
|
+
/**
|
|
49
|
+
* If defined, shows the switch on top of a chip of the provided color
|
|
50
|
+
*/
|
|
51
|
+
chipColor?: SystemProps<Theme>['color'];
|
|
52
|
+
/**
|
|
53
|
+
* Color of the switch & text
|
|
54
|
+
*/
|
|
55
|
+
color?: OverridableStringUnion<'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning' | 'default', SwitchPropsColorOverrides>;
|
|
56
|
+
};
|
|
57
|
+
export type SwitchProps<T> = BaseSwitchProps<T> & Omit<MuiSwitchProps, 'checked' | 'onChange' | 'name' | 'value' | 'readOnly'>;
|
|
58
|
+
/**
|
|
59
|
+
* `Switch` provides a Material-UI Switch.
|
|
60
|
+
*/
|
|
61
|
+
export declare const Switch: <T = boolean>(props: SwitchProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { TypographyProps, TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
type BaseTextFieldProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Name and ID of the component. Must match a key from initialValues in Formik.
|
|
6
|
+
* @required
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* If true, ensures that user enters only input that matches the format.
|
|
11
|
+
* Defaults to true if a format is specified.
|
|
12
|
+
* @default format ? true : false
|
|
13
|
+
*/
|
|
14
|
+
autoFormat?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* A format string that will be used for formatting the user input.
|
|
17
|
+
* 9 = numbers, X = characters
|
|
18
|
+
* @example
|
|
19
|
+
* format='999-XXX-9999'
|
|
20
|
+
*/
|
|
21
|
+
format?: string;
|
|
22
|
+
/**
|
|
23
|
+
* If true, the prepackaged dynamic input label that comes with Material UI's input components
|
|
24
|
+
* will be replaced with a static typography label above the input.
|
|
25
|
+
* @default false
|
|
26
|
+
*/
|
|
27
|
+
staticLabel?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Props from MUI-Bueno's Typography component.
|
|
30
|
+
* Used to customize the label when the static label option is selected or the field is readOnly.
|
|
31
|
+
*/
|
|
32
|
+
staticLabelProps?: TypographyProps;
|
|
33
|
+
/**
|
|
34
|
+
* If `true`, the component becomes readonly.
|
|
35
|
+
* @default false
|
|
36
|
+
*/
|
|
37
|
+
readOnly?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* If provided, will show the icon at the start of the input field.
|
|
40
|
+
*/
|
|
41
|
+
startIcon?: React.JSX.Element;
|
|
42
|
+
/**
|
|
43
|
+
* If provided, will show the icon at the end of the input field.
|
|
44
|
+
*/
|
|
45
|
+
endIcon?: React.JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* Margin for the FormControl
|
|
48
|
+
*/
|
|
49
|
+
margin?: "dense" | "none" | "normal";
|
|
50
|
+
/**
|
|
51
|
+
* By default, TextField will trim leading and trailing whitespace on blur. To disable this, set `noTrimOnBlur` to true.
|
|
52
|
+
*/
|
|
53
|
+
noTrimOnBlur?: boolean;
|
|
54
|
+
};
|
|
55
|
+
export type TextFieldProps = BaseTextFieldProps & Omit<MuiTextFieldProps, "defaultValue" | "error" | "fullWidth" | "select" | "SelectProps" | "value">;
|
|
56
|
+
/**
|
|
57
|
+
* The `TextField` is a MUI input. For use with validation, view the examples at the bottom of this page.
|
|
58
|
+
*/
|
|
59
|
+
export declare const TextField: React.FC<TextFieldProps>;
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SubmitHandler, FieldValues, DefaultValues, FieldErrors, UseFormSetValue, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
import { AnyObjectSchema } from 'yup';
|
|
3
|
+
type MFormProps<T extends FieldValues> = Readonly<{
|
|
4
|
+
initialValues: DefaultValues<T>;
|
|
5
|
+
initialErrors?: FieldErrors<T>;
|
|
6
|
+
onSubmit: SubmitHandler<T>;
|
|
7
|
+
children: React.ReactNode | ((props: {
|
|
8
|
+
values: T;
|
|
9
|
+
setValue: UseFormSetValue<T>;
|
|
10
|
+
methods: UseFormReturn<T>;
|
|
11
|
+
}) => React.ReactNode);
|
|
12
|
+
validationSchema?: AnyObjectSchema;
|
|
13
|
+
shouldValidateOption?: boolean;
|
|
14
|
+
shouldDirtyOption?: boolean;
|
|
15
|
+
validationOnMount?: boolean;
|
|
16
|
+
enableReinitialize?: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function MForm<T extends FieldValues>({ initialValues, onSubmit, children, initialErrors, validationSchema, shouldValidateOption, shouldDirtyOption, validationOnMount, enableReinitialize }: MFormProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default MForm;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMyForm(): import('react-hook-form').UseFormReturn<import('react-hook-form').FieldValues, any, import('react-hook-form').FieldValues>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { SxProps, Theme, TypographyProps } from '@mui/material';
|
|
2
|
+
import { default as React, ReactNode } from 'react';
|
|
3
|
+
type RepeatableGroupWrapperType = 'card' | 'elevatedCard' | 'none';
|
|
4
|
+
type RepeatableRemovePosition = 'bottom' | 'right';
|
|
5
|
+
export type RepeatableFormGroupProps<T> = {
|
|
6
|
+
/**
|
|
7
|
+
* Name of field. Must match the name of the array in Formik.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* An "empty" object of type T.
|
|
12
|
+
* This is what you would normally pass to initialState for Formik for a single object of type T
|
|
13
|
+
*/
|
|
14
|
+
initialState: T;
|
|
15
|
+
/**
|
|
16
|
+
* Component that makes up the fields in your form group.
|
|
17
|
+
*
|
|
18
|
+
* IMPORTANT: Make sure to pass the name to your fields such that name={`${name}.fieldName`}.
|
|
19
|
+
* For example: `<Text`Field name={`${name}.phoneNumber`} label="Phone Number" />`
|
|
20
|
+
*
|
|
21
|
+
* @param name
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
renderFormGroup: (name: string, index: number) => React.ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Content for the Add button. @default "Add Another"
|
|
27
|
+
*/
|
|
28
|
+
addButtonContent?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Content for the Remove button. @default "Remove"
|
|
31
|
+
*/
|
|
32
|
+
removeButtonContent?: ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Variant for the wrapper for each group. @default card
|
|
35
|
+
*/
|
|
36
|
+
variant?: RepeatableGroupWrapperType;
|
|
37
|
+
/**
|
|
38
|
+
* Style overrides for the Add button
|
|
39
|
+
*/
|
|
40
|
+
addButtonSx?: SxProps<Theme>;
|
|
41
|
+
/**
|
|
42
|
+
* Style overrides for the Remove button
|
|
43
|
+
*/
|
|
44
|
+
removeButtonSx?: SxProps<Theme>;
|
|
45
|
+
/**
|
|
46
|
+
* If true, will always display 'Remove' button on all field groups.
|
|
47
|
+
* If false, will only display 'Remove' button as long as there are 2 or more field groups displayed.
|
|
48
|
+
* @default false
|
|
49
|
+
*/
|
|
50
|
+
allowRemoveAll?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* If `true`, the component becomes readonly. The `add` and `remove` buttons are hidden.
|
|
53
|
+
* This does not change the individual formGroups, which must be made readOnly separately.
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
readOnly?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* (Optional) Label for entire group.
|
|
59
|
+
*/
|
|
60
|
+
label?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Props from MUI-Bueno's Typography component.
|
|
63
|
+
* Used to customize the label when the static label option is selected or the field is readOnly.
|
|
64
|
+
*/
|
|
65
|
+
labelProps?: TypographyProps;
|
|
66
|
+
/**
|
|
67
|
+
* This will display as the "value" when the field is readonly
|
|
68
|
+
* @default "None"
|
|
69
|
+
*/
|
|
70
|
+
emptyListMsg?: string;
|
|
71
|
+
/**
|
|
72
|
+
* If true, adds a horizontal divider line in between each field grouping
|
|
73
|
+
* @default false
|
|
74
|
+
*/
|
|
75
|
+
showDivider?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Defines the position of the remove buttons relative to each grouping of fields.
|
|
78
|
+
* - "bottom" (default) - remove button will appear BELOW each grouping of fields
|
|
79
|
+
* - "right" - remove button will appear to the RIGHT (centered vertically) of each grouping of fields -- best for inline field groups
|
|
80
|
+
* - sx - pass in your own MUI style to fine-tune the flexbox container settings
|
|
81
|
+
*/
|
|
82
|
+
removePosition?: RepeatableRemovePosition | SxProps<Theme>;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Repeatable Form Group is used for handling arrays in forms. It automatically handles adding & removing
|
|
86
|
+
* field groups (components containing one or multiple fields) using Formik.
|
|
87
|
+
*/
|
|
88
|
+
export declare const RepeatableFormGroup: <T>(props: RepeatableFormGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
89
|
+
export default RepeatableFormGroup;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { StepperProps as MuiStepperProps } from '@mui/material';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type BaseStepperProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Array of labels for each step
|
|
6
|
+
*/
|
|
7
|
+
steps: string[];
|
|
8
|
+
/**
|
|
9
|
+
* If true, displays labels inline. Ignored when orientation is set to vertical. Works best with a small number of steps, otherwise it can look cluttered.
|
|
10
|
+
* @default false
|
|
11
|
+
* @requires stepperOrientation='horizontal'
|
|
12
|
+
*/
|
|
13
|
+
inlineLabel?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* If true, the orientation will automatically change to vertical when screen size is small, and horizontal when screen size is large. Orientation prop is ignored.
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
isResponsive?: boolean;
|
|
19
|
+
};
|
|
20
|
+
export type StepperProps = BaseStepperProps & Omit<MuiStepperProps, 'alternativeLabel'>;
|
|
21
|
+
/**
|
|
22
|
+
* The `Stepper` component displays progress through a sequence of steps. It is intended to be used with multiple page forms, as the stepper will automatically mark previous steps as complete.
|
|
23
|
+
*
|
|
24
|
+
* It is built on the [MUI React Stepper](https://mui.com/material-ui/react-stepper/)
|
|
25
|
+
*/
|
|
26
|
+
export declare const Stepper: React.FC<StepperProps>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Grid2Props } from '@mui/material/Grid2';
|
|
2
|
+
/**
|
|
3
|
+
* MGridProps
|
|
4
|
+
* @property {number} sm - breakpoint for small screen sizes
|
|
5
|
+
*/
|
|
6
|
+
export type MGridProps = Readonly<Grid2Props & {
|
|
7
|
+
sm?: number;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* `MGrid` is a responsive layout grid component.
|
|
11
|
+
*/
|
|
12
|
+
export declare function MGrid({ size, spacing, sm, ...rest }: MGridProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default MGrid;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PaperProps } from '@mui/material/Paper';
|
|
2
|
+
/**
|
|
3
|
+
* MPanelProps
|
|
4
|
+
* @property {string} title - Title to be displayed in the panel
|
|
5
|
+
*/
|
|
6
|
+
export type MPanelProps = Readonly<PaperProps & {
|
|
7
|
+
title?: string;
|
|
8
|
+
}>;
|
|
9
|
+
/**
|
|
10
|
+
* `MPanel` is an elevated layout component with a title and optional content.
|
|
11
|
+
*/
|
|
12
|
+
export declare function MPanel(props: MPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default MPanel;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type LoadingIndicatorProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Custom title
|
|
5
|
+
* @default 'Loading...'
|
|
6
|
+
*/
|
|
7
|
+
title?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Custom message
|
|
10
|
+
* @optional
|
|
11
|
+
* @default undefined
|
|
12
|
+
*/
|
|
13
|
+
message?: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Consistently styled LoadingIndicator
|
|
17
|
+
*
|
|
18
|
+
* @param props
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare const LoadingIndicator: React.FC<LoadingIndicatorProps>;
|
|
22
|
+
export default LoadingIndicator;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ModalProps } from '../Modal';
|
|
2
|
+
export type AlertModalProps = Omit<ModalProps, 'actions'> & {};
|
|
3
|
+
/**
|
|
4
|
+
* Informational modal that does not require user feedback.
|
|
5
|
+
* Recommend using these sparringly, as they block the user until they close the modal.
|
|
6
|
+
*
|
|
7
|
+
* For a modal that requires a user response (ex. Yes/No), use `ConfirmationModal` instead (2-buttons)
|
|
8
|
+
* For a modal that requires the user to make a choice, use `DecisionModal` instead (3-buttons)
|
|
9
|
+
*/
|
|
10
|
+
export declare const AlertModal: (props: AlertModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export default AlertModal;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ModalProps } from '../Modal';
|
|
3
|
+
import { ButtonProps } from '../../Buttons/Button/Button';
|
|
4
|
+
export type ConfirmationModalProps = Omit<ModalProps, 'actions'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Label for the confirm/action button.
|
|
7
|
+
*/
|
|
8
|
+
confirmBtnLabel: string;
|
|
9
|
+
/**
|
|
10
|
+
* Postive/negative action. Should close modal and perform the action requested by the user.
|
|
11
|
+
*/
|
|
12
|
+
onConfirm: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Override the default styling of the confirm button. Defaults are:
|
|
15
|
+
* `{ color: 'primary', variant: 'contained' }`
|
|
16
|
+
*/
|
|
17
|
+
confirmButtonProps?: Omit<ButtonProps, 'onClick'>;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Modal that requires user to cancel or proceed.
|
|
21
|
+
*
|
|
22
|
+
* For a modal that is strictly informational and does not require the user to make a choice, use `AlertModal` instead (1-button)
|
|
23
|
+
* For a modal that requires the user to make a choice, use `DecisionModal` instead (3-buttons)
|
|
24
|
+
*/
|
|
25
|
+
export declare const ConfirmationModal: React.FC<ConfirmationModalProps>;
|
|
26
|
+
export default ConfirmationModal;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ModalProps } from '../Modal';
|
|
3
|
+
import { ButtonProps } from '../../Buttons/Button/Button';
|
|
4
|
+
export type DecisionModalProps = Omit<ModalProps, 'actions'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Label for primary action (button)
|
|
7
|
+
*/
|
|
8
|
+
primaryBtnLabel: string;
|
|
9
|
+
/**
|
|
10
|
+
* Callback when user clicks on primary action (button)
|
|
11
|
+
*/
|
|
12
|
+
onPrimaryAction: () => void;
|
|
13
|
+
/**
|
|
14
|
+
* Override styling for primary action (button)
|
|
15
|
+
*/
|
|
16
|
+
primaryActionProps?: Omit<ButtonProps, 'onClick'>;
|
|
17
|
+
/**
|
|
18
|
+
* Label for secondary action (button)
|
|
19
|
+
*/
|
|
20
|
+
secondaryBtnLabel: string;
|
|
21
|
+
/**
|
|
22
|
+
* Callback when user clicks on secondary action (button)
|
|
23
|
+
*/
|
|
24
|
+
onSecondaryAction: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Override styling for secondary action (button)
|
|
27
|
+
*/
|
|
28
|
+
secondaryActionProps?: Omit<ButtonProps, 'onClick'>;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Modal that requires user to cancel, or choose between two choices.
|
|
32
|
+
*
|
|
33
|
+
* For a modal that is strictly informational and does not require the user to make a choice, use `AlertModal` instead (1-button)
|
|
34
|
+
* For a modal that requires the user to decide whether or not they want to proceed (cancel or confirm), use `ConfirmationModal` instead (2-buttons)
|
|
35
|
+
*/
|
|
36
|
+
export declare const DecisionModal: React.FC<DecisionModalProps>;
|
|
37
|
+
export default DecisionModal;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { DialogProps } from '@mui/material';
|
|
3
|
+
import { ButtonProps } from '../Buttons/Button/Button';
|
|
4
|
+
export type ModalProps = Omit<DialogProps, 'onClose' | 'title' | 'content'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Title of the modal. Pass a string to have the modal auto-format the title, or pass a
|
|
7
|
+
* component if you want more control over the style/appearance.
|
|
8
|
+
*/
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* Called when the user closes the modal. Make sure to close your modal using this callback.
|
|
12
|
+
*/
|
|
13
|
+
onClose?: () => void;
|
|
14
|
+
/**
|
|
15
|
+
* Position of the close button.
|
|
16
|
+
* - bottom (default): displays close button, with label `closeBtnLabel` (Cancel, by default), on the bottom-left corner.
|
|
17
|
+
* - top: display close button as an X (only when `title` is type string), in the top-right corner.
|
|
18
|
+
* - top-and-bottom: displays close button in both top and bottom
|
|
19
|
+
*/
|
|
20
|
+
closeButtonPosition?: 'top' | 'bottom' | 'top-and-bottom';
|
|
21
|
+
/**
|
|
22
|
+
* Array of buttons that perform a MODIFYING action (not simply just closing the modal).
|
|
23
|
+
*/
|
|
24
|
+
actions?: React.ReactNode[];
|
|
25
|
+
/**
|
|
26
|
+
* Label for the close/cancel button. Use when `closeButtonPosition` is `'bottom'` or `'top-and-bottom'`
|
|
27
|
+
*/
|
|
28
|
+
closeBtnLabel?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Override the default styling of the close/cancel button. Defaults are:
|
|
31
|
+
* `{ color: 'primary', variant: 'text' }`
|
|
32
|
+
*/
|
|
33
|
+
closeButtonProps?: Omit<ButtonProps, 'onClick'>;
|
|
34
|
+
/**
|
|
35
|
+
* Set to true to disable the modal from dismissing when the user clicks outside the modal (backdrop) or clicks the escape key.
|
|
36
|
+
*
|
|
37
|
+
* Recommended for modals with forms, to prevent users from accidentally dismissing the modal and losing the data they entered.
|
|
38
|
+
*/
|
|
39
|
+
disableDismiss?: boolean;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Modal (internal for now, might expose later)
|
|
43
|
+
*/
|
|
44
|
+
export declare const Modal: React.FC<ModalProps>;
|
|
45
|
+
export default Modal;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Theme, SxProps, LinkPropsColorOverrides } from '@mui/material';
|
|
2
|
+
import { MenuOption } from '../../../@types';
|
|
3
|
+
import { OverridableStringUnion } from '@mui/types';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
export type FooterProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Links that will appear under the logo, on the left side.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: For each `MenuOption`, if `path` is defined, but NOT `onClick`, it will behave as a link. Otherwise, it will
|
|
10
|
+
* behave as a button.
|
|
11
|
+
*/
|
|
12
|
+
featureMenuOptions?: MenuOption[];
|
|
13
|
+
/**
|
|
14
|
+
* Informational text, renders on the right side. Can be used for copyright, build info, etc.
|
|
15
|
+
*/
|
|
16
|
+
copyright?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Logo for the footer. Pass in a path (string) to have the styling be handled automatically, or pass in a component for more control.
|
|
19
|
+
*/
|
|
20
|
+
logo: string | React.ReactNode;
|
|
21
|
+
/**
|
|
22
|
+
* override styles for Footer
|
|
23
|
+
*/
|
|
24
|
+
sx?: SxProps<Theme>;
|
|
25
|
+
/**
|
|
26
|
+
* quick override font color for links & copyright
|
|
27
|
+
*/
|
|
28
|
+
fontColor?: OverridableStringUnion<'inherit' | 'primary' | 'secondary' | 'textPrimary' | 'textSecondary' | 'error', LinkPropsColorOverrides>;
|
|
29
|
+
};
|
|
30
|
+
export declare const Footer: React.FC<FooterProps>;
|
|
31
|
+
export default Footer;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dark Mode toggle button. Uses MUI's palette to determine which icon (light or dark) to display.
|
|
3
|
+
*
|
|
4
|
+
* NOTE: You will need to update the theme via onToggle. This allows you to persist the user's selection via Redux.
|
|
5
|
+
*/
|
|
6
|
+
export type DarkModeToggleProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Callback when dark mode toggle button is clicked (IMPORTANT: you will have to implement changing the theme)
|
|
9
|
+
*/
|
|
10
|
+
onToggle: () => void;
|
|
11
|
+
};
|
|
12
|
+
export declare const DarkModeToggle: (props: DarkModeToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default DarkModeToggle;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DrawerProps as MuiDrawerProps } from '@mui/material';
|
|
3
|
+
import { MenuOption } from '../../../@types';
|
|
4
|
+
type DrawerBaseProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Array of navigation items to show
|
|
7
|
+
*
|
|
8
|
+
* NOTE: For each `MenuOption`, if `path` is defined, but NOT `onClick`, it will behave as a link. Otherwise, it will
|
|
9
|
+
* behave as a button._
|
|
10
|
+
*/
|
|
11
|
+
menuOptionLists?: MenuOption[][];
|
|
12
|
+
};
|
|
13
|
+
export type DrawerProps = DrawerBaseProps & MuiDrawerProps;
|
|
14
|
+
/**
|
|
15
|
+
* Mobile drawer. Renders as hamburger icon that, when clicked, toggles a side menu on the left (default) side of the screen.
|
|
16
|
+
*/
|
|
17
|
+
export declare const Drawer: React.FC<DrawerProps>;
|
|
18
|
+
export default Drawer;
|