@simoncomputing/mui-bueno-v2 0.14.7

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.
Files changed (87) hide show
  1. package/CHANGELOG.md +1206 -0
  2. package/README.md +35 -0
  3. package/dist/@types/index.d.ts +192 -0
  4. package/dist/common/Utils/index.d.ts +65 -0
  5. package/dist/common/WindowDimensions/WindowDimensions.d.ts +26 -0
  6. package/dist/components/Alerts/Alert.d.ts +30 -0
  7. package/dist/components/Alerts/ErrorAlert.d.ts +4 -0
  8. package/dist/components/Alerts/InfoAlert.d.ts +4 -0
  9. package/dist/components/Alerts/SuccessAlert.d.ts +4 -0
  10. package/dist/components/Alerts/WarningAlert.d.ts +4 -0
  11. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +10 -0
  12. package/dist/components/Buttons/Button/Button.d.ts +24 -0
  13. package/dist/components/Buttons/ScrollToTop/ScrollToTop.d.ts +14 -0
  14. package/dist/components/Buttons/Submit/Submit.d.ts +11 -0
  15. package/dist/components/Form/Error/Error.d.ts +23 -0
  16. package/dist/components/Form/FormDebugger/FormDebugger.d.ts +8 -0
  17. package/dist/components/Form/Inputs/Autocomplete/Autocomplete.d.ts +81 -0
  18. package/dist/components/Form/Inputs/Autocomplete/DynamicAutocomplete/DynamicAutocomplete.d.ts +31 -0
  19. package/dist/components/Form/Inputs/Autocomplete/MultiAutocomplete/MultiAutocomplete.d.ts +22 -0
  20. package/dist/components/Form/Inputs/Autocomplete/utils.d.ts +2 -0
  21. package/dist/components/Form/Inputs/Checkbox/Checkbox.d.ts +58 -0
  22. package/dist/components/Form/Inputs/CheckboxGroup/CheckboxGroup.d.ts +107 -0
  23. package/dist/components/Form/Inputs/CitationField/CitationBubbleMenuHandler.d.ts +43 -0
  24. package/dist/components/Form/Inputs/CitationField/CitationField.d.ts +89 -0
  25. package/dist/components/Form/Inputs/CitationField/CitationFieldContext/CitationFieldContext.d.ts +9 -0
  26. package/dist/components/Form/Inputs/CitationField/CitationFieldContext/CitationFieldProvider.d.ts +8 -0
  27. package/dist/components/Form/Inputs/CitationField/CitationMenu/AttachmentForm.d.ts +12 -0
  28. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationBubbleMenu.d.ts +27 -0
  29. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationForm.d.ts +11 -0
  30. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationMenu.d.ts +78 -0
  31. package/dist/components/Form/Inputs/CitationField/CitationMenu/CitationTable.d.ts +21 -0
  32. package/dist/components/Form/Inputs/CitationField/CitationNode.d.ts +2 -0
  33. package/dist/components/Form/Inputs/CitationField/CitationNodeComponent.d.ts +7 -0
  34. package/dist/components/Form/Inputs/CitationField/CitationRefreshContext/CitationRefreshContext.d.ts +29 -0
  35. package/dist/components/Form/Inputs/CitationField/MenuButtonEditCitation.d.ts +3 -0
  36. package/dist/components/Form/Inputs/DateField/DateField.d.ts +73 -0
  37. package/dist/components/Form/Inputs/DateField/DateRangeField/DateRangeField.d.ts +62 -0
  38. package/dist/components/Form/Inputs/DateField/dayjs-utils.d.ts +2 -0
  39. package/dist/components/Form/Inputs/FileUpload/FileList/FileList.d.ts +13 -0
  40. package/dist/components/Form/Inputs/FileUpload/FileUpload.d.ts +62 -0
  41. package/dist/components/Form/Inputs/Location/Location.d.ts +69 -0
  42. package/dist/components/Form/Inputs/Location/Location.types.d.ts +85 -0
  43. package/dist/components/Form/Inputs/Location/LocationOption.d.ts +38 -0
  44. package/dist/components/Form/Inputs/RadioGroup/RadioGroup.d.ts +119 -0
  45. package/dist/components/Form/Inputs/RangeSlider/RangeSlider.d.ts +34 -0
  46. package/dist/components/Form/Inputs/RichTextField/RichTextControls.d.ts +6 -0
  47. package/dist/components/Form/Inputs/RichTextField/RichTextField.d.ts +56 -0
  48. package/dist/components/Form/Inputs/RichTextField/SuggestionList.d.ts +8 -0
  49. package/dist/components/Form/Inputs/RichTextField/mentionSuggestionOptions.d.ts +6 -0
  50. package/dist/components/Form/Inputs/RichTextField/useExtensions.d.ts +10 -0
  51. package/dist/components/Form/Inputs/SearchField/SearchField.d.ts +16 -0
  52. package/dist/components/Form/Inputs/Select/Select.d.ts +91 -0
  53. package/dist/components/Form/Inputs/Switch/Switch.d.ts +61 -0
  54. package/dist/components/Form/Inputs/TextField/TextField.d.ts +60 -0
  55. package/dist/components/Form/RepeatableFormGroup/RepeatableFormGroup.d.ts +89 -0
  56. package/dist/components/Form/Stepper/Stepper.d.ts +27 -0
  57. package/dist/components/LoadingIndicator/LoadingIndicator.d.ts +22 -0
  58. package/dist/components/Modals/AlertModal/AlertModal.d.ts +11 -0
  59. package/dist/components/Modals/ConfirmationModal/ConfirmationModal.d.ts +26 -0
  60. package/dist/components/Modals/DecisionModal/DecisionModal.d.ts +37 -0
  61. package/dist/components/Modals/Modal.d.ts +45 -0
  62. package/dist/components/Navigation/Footer/Footer.d.ts +31 -0
  63. package/dist/components/Navigation/Header/DarkModeToggle/DarkModeToggle.d.ts +13 -0
  64. package/dist/components/Navigation/Header/Drawer.d.ts +18 -0
  65. package/dist/components/Navigation/Header/EnvironmentBanner.d.ts +4 -0
  66. package/dist/components/Navigation/Header/Header.d.ts +63 -0
  67. package/dist/components/Navigation/Header/ProfileMenu.d.ts +8 -0
  68. package/dist/components/Navigation/MenuButton/MenuButton.d.ts +9 -0
  69. package/dist/components/Navigation/NavBar/FloatingNavBar/FloatingNavBar.d.ts +24 -0
  70. package/dist/components/Navigation/NavBar/NavBar.d.ts +24 -0
  71. package/dist/components/Navigation/Sidebar/Sidebar.d.ts +14 -0
  72. package/dist/components/Navigation/Tabs/Tabs.d.ts +19 -0
  73. package/dist/components/PageHeader/PageHeader.d.ts +27 -0
  74. package/dist/components/SingleActionCard/SingleActionCard.d.ts +26 -0
  75. package/dist/components/Snackbar/Snackbar.d.ts +28 -0
  76. package/dist/components/Table/ExpandableRow/ExpandableRow.d.ts +16 -0
  77. package/dist/components/Table/PaginatedTable.d.ts +44 -0
  78. package/dist/components/Table/Table.d.ts +129 -0
  79. package/dist/index.cjs.js +402 -0
  80. package/dist/index.css +1 -0
  81. package/dist/index.d.ts +105 -0
  82. package/dist/index.es.js +60187 -0
  83. package/dist/index.umd.js +403 -0
  84. package/dist/styles/3-theme/ThemeDemo.d.ts +3 -0
  85. package/dist/styles/3-theme/theme.d.ts +8 -0
  86. package/dist/styles/theme.d.ts +33 -0
  87. package/package.json +138 -0
@@ -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 initialValues in Formik.
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 formik when the switch is ON
36
+ * @default True
37
+ */
38
+ activeValue?: T extends boolean ? true : string;
39
+ /**
40
+ * Override the value used in formik when the switch is OFF
41
+ * @default False
42
+ */
43
+ inactiveValue?: T extends boolean ? false : string;
44
+ /**
45
+ * Handle changes to the formik 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,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,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;
@@ -0,0 +1,4 @@
1
+ import { default as React } from 'react';
2
+ import { EnvironmentInfo } from '../../../@types';
3
+ export declare const EnvironmentBanner: React.FC<EnvironmentInfo>;
4
+ export default EnvironmentBanner;
@@ -0,0 +1,63 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { EnvironmentInfo, MenuOption } from '../../../@types';
3
+ import * as React from 'react';
4
+ export type HeaderProps = {
5
+ /**
6
+ * Provides environment info for lower environments. Automatically hidden when `isProd` is true.
7
+ */
8
+ envInfo?: EnvironmentInfo;
9
+ headerRef?: React.RefObject<HTMLElement | null>;
10
+ /**
11
+ * App logo image. Can be a path to an image (string) or a ReactNode for more fine-tuned control.
12
+ */
13
+ logo: string | React.ReactNode;
14
+ /**
15
+ * Features that appear below the primary header.
16
+ * Intended for general navigation within the application.
17
+ *
18
+ * NOTE: For each `MenuOption`, if `path` is defined, but NOT `onClick`, it will behave as a link. Otherwise, it will
19
+ * behave as a button.
20
+ */
21
+ featureMenuOptions?: MenuOption[];
22
+ /**
23
+ * User Actions that will appear on the user profile dropdown button.
24
+ * These are for logged in users so they only display when `displayName` is not undefined
25
+ */
26
+ userMenuOptions?: MenuOption[];
27
+ onToggleDarkMode?: () => void;
28
+ /**
29
+ * Appear directly in header on the right side. Useful for quick-access general links such as FAQ
30
+ * Recommend no more than 3.
31
+ *
32
+ * NOTE: For each `MenuOption`, if `path` is defined, but NOT `onClick`, it will behave as a link. Otherwise, it will
33
+ * behave as a button.
34
+ */
35
+ quickLinks?: MenuOption[];
36
+ /**
37
+ * Display Name for the user that is currently logged in. Set as undefined if no user is logged in.
38
+ * Ex: `displayName={isAuthenticated ? userName : undefined}
39
+ */
40
+ displayName?: string;
41
+ /**
42
+ * Appears above the app header. Useful for simple announcements/etc.
43
+ */
44
+ banner?: React.ReactNode;
45
+ position?: 'absolute' | 'sticky' | 'relative' | 'static' | 'fixed';
46
+ /**
47
+ * Children will be rendered in between quickLinks & user dropdown.
48
+ *
49
+ * IMPORTANT: Children will NOT display on mobile, so if you render any navigation links here, you will need to
50
+ * add logic to pass those links to `userActions` when screen size is less than or equal to `sm` (default is <=600 px).
51
+ */
52
+ children?: React.ReactNode;
53
+ /**
54
+ * Style overrides for Mui's AppBar
55
+ */
56
+ sx?: SxProps<Theme>;
57
+ /**
58
+ * Style overrides for the NavBar
59
+ */
60
+ navBarSx?: SxProps<Theme>;
61
+ };
62
+ export declare const Header: React.FC<HeaderProps>;
63
+ export default Header;
@@ -0,0 +1,8 @@
1
+ import { MenuOption, ObjectWithId } from '../../../@types';
2
+ import * as React from 'react';
3
+ export interface ProfileMenuProps extends ObjectWithId {
4
+ displayName: string;
5
+ userMenuOptions: MenuOption[];
6
+ }
7
+ export declare const ProfileMenu: React.FC<ProfileMenuProps>;
8
+ export default ProfileMenu;
@@ -0,0 +1,9 @@
1
+ import { MenuOption, ObjectWithId } from '../../../@types';
2
+ import * as React from 'react';
3
+ export interface MenuButtonProps extends ObjectWithId {
4
+ label: string;
5
+ menuOptions?: MenuOption[];
6
+ icon?: React.ReactElement;
7
+ }
8
+ export declare const MenuButton: React.FC<MenuButtonProps>;
9
+ export default MenuButton;
@@ -0,0 +1,24 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { MenuOption } from '../../../../@types';
3
+ export type FloatingNavBarProps = {
4
+ /**
5
+ * Features that appear below the primary header.
6
+ * Intended for general navigation within the application.
7
+ */
8
+ featureMenuOptions?: MenuOption[];
9
+ /**
10
+ * Index of the active tab, starts at 0. Default is undefined (no active tab marked)
11
+ */
12
+ activeTabIdx?: number;
13
+ /**
14
+ * Style overrides
15
+ */
16
+ sx?: SxProps<Theme>;
17
+ };
18
+ /**
19
+ * Primary navigation. For an alternative style, see `NavBar`.
20
+ *
21
+ * @deprecated Will remove soon, switch to NavBar
22
+ */
23
+ export declare const FloatingNavBar: (props: FloatingNavBarProps) => false | import("react/jsx-runtime").JSX.Element;
24
+ export default FloatingNavBar;
@@ -0,0 +1,24 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { MenuOption } from '../../../@types';
3
+ export type NavBarProps = {
4
+ /**
5
+ * Features that appear below the primary header.
6
+ * Intended for general navigation within the application.
7
+ */
8
+ featureMenuOptions?: MenuOption[];
9
+ /**
10
+ * Index of the active tab, starts at 0. Default is undefined (no active tab marked)
11
+ */
12
+ activeTabIdx?: number;
13
+ /**
14
+ * Style overrides
15
+ */
16
+ sx?: SxProps<Theme>;
17
+ };
18
+ /**
19
+ * Primary navigation. For an alternative style, see `FloatingNavBar`.
20
+ *
21
+ * We recommend using the `Header` component, which already has a `NavBar` built in.
22
+ */
23
+ export declare const NavBar: (props: NavBarProps) => false | import("react/jsx-runtime").JSX.Element;
24
+ export default NavBar;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { SxProps, Theme } from '@mui/material';
3
+ import { MenuOption } from '../../../@types';
4
+ export type SidebarProps = {
5
+ menuOptions?: MenuOption[];
6
+ sx?: SxProps<Theme>;
7
+ };
8
+ /**
9
+ * Intended for secondary navigation.
10
+ *
11
+ * This component does NOT render on mobile.
12
+ */
13
+ export declare const Sidebar: React.FC<SidebarProps>;
14
+ export default Sidebar;
@@ -0,0 +1,19 @@
1
+ import { TabsProps as MuiTabsProps } from '@mui/material';
2
+ import { MenuOption } from '../../../@types';
3
+ import * as React from 'react';
4
+ type TabsBaseProps = {
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
+ menuOptions: MenuOption[];
12
+ /**
13
+ * Index of the active tab in `menuOptions`
14
+ */
15
+ activeTabIdx?: number;
16
+ };
17
+ export type TabsProps = TabsBaseProps & Omit<MuiTabsProps, 'value' | 'onChange'>;
18
+ export declare const Tabs: React.FC<TabsProps>;
19
+ export default Tabs;
@@ -0,0 +1,27 @@
1
+ import { BreadcrumbInfo } from '../Breadcrumbs/Breadcrumbs';
2
+ import { SxProps, Theme } from '@mui/material';
3
+ import { ReactNode } from 'react';
4
+ /**
5
+ * Interface for PageHeader props.
6
+ * @property {string} tableKey - The key of the table.
7
+ * @property {string} title - Title for the table
8
+ * @property {string} createButtonLabel - Label for the Create/Add button (to add new objects to the table)
9
+ * @property {string} createPermission - Permission required to give the user permission to edit this table
10
+ * @property {(id?: number | string) => void} onAdd - callback when the create/add button is clicked
11
+ * @property {BreadcrumbInfo[]} breadcrumbs - breadcrumbs to be displayed above the title (optional)
12
+ * @property {React.ReactNode} children - additional components to display on the right side of the component (or below, on mobile screens)
13
+ */
14
+ export type PageHeaderProps = {
15
+ title: string | ReactNode;
16
+ createButtonLabel: string;
17
+ showAddButton?: boolean;
18
+ onAdd?: (id?: number | string) => void;
19
+ breadcrumbs?: BreadcrumbInfo[];
20
+ children?: React.ReactNode;
21
+ sx?: SxProps<Theme>;
22
+ };
23
+ /**
24
+ * Header for PagingTable. Includes Title, Add Button, breadcrumbs (optional). Additional components can be added via children (ex. SearchField) if desired.
25
+ */
26
+ export declare const PageHeader: (props: PageHeaderProps) => import("react/jsx-runtime").JSX.Element;
27
+ export default PageHeader;