@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,26 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { PropsWithChildren, ReactNode } from 'react';
3
+ /**
4
+ * Interface for table props.
5
+ * @property {string} tableKey - The key of the table.
6
+ * @property {{label: string; fieldName: string}[]} columns - An array of column definitions.
7
+ * @property {T[]} data - Array of objects that will be displayed in the table
8
+ * @property {(id?: number | string) => void} onSelect - Function to call when a row is selected.
9
+ * @property {boolean} canSort - Whether or not this table supports sorting (depends on your API)
10
+ * @property {boolean} stackWhenMobile - If true, on mobile screens, table is replaced with list of cards,
11
+ * where each card represents 1 row. NOTE: sorting is not available when using mobile stack.
12
+ */
13
+ export interface SingleActionCardProps extends PropsWithChildren {
14
+ title: string;
15
+ titleIcon?: ReactNode;
16
+ fullWidthIcon?: boolean;
17
+ children?: ReactNode;
18
+ actionLabel: string;
19
+ action: () => void;
20
+ sx?: SxProps<Theme>;
21
+ }
22
+ /**
23
+ * Full-page component for displaying simple messages with a single action (button).
24
+ */
25
+ export declare const SingleActionCard: (props: SingleActionCardProps) => import("react/jsx-runtime").JSX.Element;
26
+ export default SingleActionCard;
@@ -0,0 +1,28 @@
1
+ import { AlertProps } from '../Alerts/Alert';
2
+ import * as React from 'react';
3
+ export type SnackbarProps = {
4
+ title: string;
5
+ message?: string;
6
+ type: SnackbarType;
7
+ onClose: () => void;
8
+ /**
9
+ * milliseconds before the snackbar auto-hides
10
+ * @default 8000 (8 seconds)
11
+ */
12
+ autoHideDuration?: number;
13
+ variant?: AlertProps['variant'];
14
+ elevation?: number;
15
+ };
16
+ /**
17
+ * Type for the message snackbar.
18
+ * @typedef {'success' | 'error' | 'warning' | 'info' | 'timeout' | 'logout'} MessageSnackbarType
19
+ */
20
+ export type SnackbarType = 'success' | 'error' | 'warning' | 'info' | 'timeout' | 'logout';
21
+ /**
22
+ * Snackbar
23
+ *
24
+ * TODO documentation
25
+ *
26
+ */
27
+ export declare const Snackbar: React.FC<SnackbarProps>;
28
+ export default Snackbar;
@@ -0,0 +1,16 @@
1
+ import { ObjectWithId } from '../../../@types';
2
+ export type ExpandableRowProps<T> = {
3
+ colSpan: number;
4
+ isExpanded?: boolean;
5
+ obj: T;
6
+ renderExpand: (obj: T) => React.ReactNode;
7
+ asMobileCard?: boolean;
8
+ };
9
+ /**
10
+ * This component is intended to be used internally by `Table` to allow rows to expand when clicked and
11
+ * is not currently exported by the library.
12
+ *
13
+ * This component contains the content for the expanded section as well as the expand/collapse functionality.
14
+ */
15
+ declare const ExpandableRow: <T extends ObjectWithId>(props: ExpandableRowProps<T>) => import("react/jsx-runtime").JSX.Element;
16
+ export default ExpandableRow;
@@ -0,0 +1,44 @@
1
+ import { TableProps } from './Table';
2
+ import { ObjectWithId, PaginationState } from '../../@types';
3
+ /**
4
+ * Paginated Table Props
5
+ */
6
+ type BasePaginatedTableProps = {
7
+ /**
8
+ * Current state of the pagination (page number, page size, etc.)
9
+ * This is intended to be used with Redux -- set your redux slice value here.
10
+ */
11
+ paginationState: PaginationState;
12
+ /**
13
+ * Callback when the user changes the page number.
14
+ * This is intended to be used with Redux -- call your dispatch here.
15
+ */
16
+ onPageChange: (newPage: number) => void;
17
+ /**
18
+ * Callback when the user changes the number of rows per page.
19
+ * This is intended to be used with Redux -- call your dispatch here.
20
+ */
21
+ onRowsPerPageChange: (newPage: number) => void;
22
+ /**
23
+ * Hides the pagination controls when true. NOTE: pagination controls will always auto-hide when the table is empty.
24
+ *
25
+ * IMPORTANT: Make sure this is not changed after the page loads. Otherwise the pagination controls could disappear
26
+ * when the user changes the pagination settings (Ex. changing page size from 5 to 25 when only 15 records exist).
27
+ */
28
+ hidePaginationControls?: boolean;
29
+ /**
30
+ * The options available to the user representing the Number of rows per page
31
+ * @default [5, 10, 25]
32
+ */
33
+ rowsPerPageOptions?: Array<number>;
34
+ };
35
+ export type PaginatedTableProps<T> = BasePaginatedTableProps & Omit<TableProps<T>, 'sortField' | 'sortOrder'>;
36
+ /**
37
+ * Table with Pagination.
38
+ *
39
+ * This is a barebones paginated table. For additional functionality, see {@link file://./ListPage.tsx}
40
+ *
41
+ * Pagination controls will auto-hide when the table is empty or hidePaginationControls is true
42
+ */
43
+ export declare const PaginatedTable: <T extends ObjectWithId>(props: PaginatedTableProps<T>) => import("react/jsx-runtime").JSX.Element;
44
+ export default PaginatedTable;
@@ -0,0 +1,129 @@
1
+ import { TableProps as MuiTableProps } from '@mui/material';
2
+ import { SystemStyleObject, Theme } from '@mui/system';
3
+ import { SortOrder, TableConfig } from '../../@types';
4
+ import { default as React } from 'react';
5
+ /**
6
+ * Interface for table props.
7
+ */
8
+ export type BaseTableProps<T> = {
9
+ /**
10
+ * Optional identifier for your table; useful when overriding styles for only a single table (NOTE: will render as "mobile-table-{id}" and "table-{id}")
11
+ */
12
+ id?: string;
13
+ /**
14
+ * If the data in your table does not have an id OR your the id is undefined, use `getRowKey` to tell Table how to uniquely identify each row.
15
+ */
16
+ getRowKey?: (row: T) => string | number;
17
+ /**
18
+ * An array of column definitions
19
+ */
20
+ columns: TableConfig<T>;
21
+ /**
22
+ * Array of objects that will be displayed in the table
23
+ */
24
+ data: T[] | undefined;
25
+ /**
26
+ * Function to call when a row is clicked
27
+ */
28
+ onRowClick?: (id?: number | string) => void;
29
+ /**
30
+ * Define which columns (fieldName) to hide on mobile/small screens
31
+ */
32
+ hideColumnsOnMobile?: string[];
33
+ /**
34
+ * fieldName of field to be sorted (can be provided via redux)
35
+ */
36
+ sortField?: string;
37
+ /**
38
+ * Sorting order for sortField (can be provided via redux)
39
+ */
40
+ sortOrder?: string;
41
+ /**
42
+ * Callback when sortField or sortOrder is changed (can be provided via redux)
43
+ */
44
+ onSortChange?: (field: string, order: SortOrder) => void;
45
+ /**
46
+ * Define which columns are able to be sorted. Use this when not all columns can be sorted.
47
+ */
48
+ allowSortCols?: string[];
49
+ /**
50
+ * Sets tableLayout on Material UI table to 'fixed'.
51
+ * Expects 'true' for same-width columns, or an array of widths for non-same-width columns
52
+ */
53
+ fixedLayout?: string[] | boolean;
54
+ /**
55
+ * Adds CSS classes to top-level component (TableContainer)
56
+ */
57
+ className?: string;
58
+ /**
59
+ * Message that displays when the number of items in the table is 0
60
+ *
61
+ * Note: This is lower priorty than isLoading & errorTableMsg, so this will not display if the table has an error or is loading.
62
+ */
63
+ emptyTableMsg?: string;
64
+ /**
65
+ * Message that displays when the table could not successfully load data (ex. from an API).
66
+ *
67
+ * Note: This is lower priorty than isLoading, so this will not display if the table is loading.
68
+ */
69
+ errorTableMsg?: string;
70
+ /**
71
+ * When defined, renders a "Retry?" button that the user can click which will trigger this callback. Intended for allowing the user
72
+ * to trigger a re-fetch in an attempt to populate the table with data from an API when the previous attempt failed.
73
+ *
74
+ * Only displays when `errorTableMsg` is defined.
75
+ */
76
+ retryCallback?: () => void;
77
+ /**
78
+ * Displays a loading spinner in the table body when true. Use this when you have an API call for loading the table data.
79
+ *
80
+ */
81
+ isLoading?: boolean;
82
+ /**
83
+ * Function called when a row is clicked. Expands the row and displays the content returned by the function.
84
+ *
85
+ * NOTE: not supported for mobile stack currently.
86
+ */
87
+ renderExpand?: (item: T) => React.ReactNode;
88
+ /**
89
+ * Renders Table render as a Table, instead of cards, on Mobile/small screens
90
+ * @default false
91
+ */
92
+ disableMobileCards?: boolean;
93
+ /**
94
+ * Defines highlight color for a selected row.
95
+ * - Set to 'true' to have the selected row highlighted when clicked on (must have `onRowClicked` defined).
96
+ * - Set to string (color) to define your own color.
97
+ * @default false
98
+ */
99
+ highlightSelectedRow?: boolean | string;
100
+ /**
101
+ * Allows overriding of default header row style settings (table only -- this has no effect on the card list for mobile)
102
+ *
103
+ * NOTE: Use this if you want to style a specific table differently from other tables in your app. If you want all tables
104
+ * to have a specific header style, add the following override to your theme(s) in `theme.ts`:
105
+ * components: {
106
+ * MuiTableCell: {
107
+ * styleOverrides: {
108
+ * head: {
109
+ * // YOUR STYLE SETTINGS HERE
110
+ * },
111
+ * },
112
+ * },
113
+ * }
114
+ * (More details on this in Storybook on the `Getting Started/Global Styling` page)
115
+ */
116
+ headerRowStyle?: SystemStyleObject<Theme>;
117
+ /**
118
+ * Enables sticky header row. Set to a valid height (ex. "400px") to define the table's max height.
119
+ */
120
+ stickyHeader?: string;
121
+ };
122
+ export type TableProps<T> = BaseTableProps<T> & Omit<MuiTableProps, 'stickyHeader'>;
123
+ /**
124
+ * The Table is a reusable component for displaying data in a table.
125
+ * It includes sorting (optional).
126
+ * If you're looking for a paginated table, use see {@link file://../PagingTable/PagingTable.tsx} or
127
+ * {@link file://../ListPage/ListPage.tsx} which includes add & search functionality.
128
+ */
129
+ export declare const Table: <T extends object>(props: BaseTableProps<T>) => import("react/jsx-runtime").JSX.Element;