@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,62 @@
|
|
|
1
|
+
import { DateFieldProps } from '../DateField';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type BaseDateRangeFieldProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Name and ID of the "from" date field. Must match a key from initialValues in MForm.
|
|
6
|
+
* @required
|
|
7
|
+
*/
|
|
8
|
+
nameFrom: string;
|
|
9
|
+
/**
|
|
10
|
+
* Name and ID of the "to" date field. Must match a key from initialValues in MForm.
|
|
11
|
+
* @required
|
|
12
|
+
*/
|
|
13
|
+
nameTo: string;
|
|
14
|
+
/**
|
|
15
|
+
* Label for the `from` field.
|
|
16
|
+
*/
|
|
17
|
+
labelFrom?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Label for the `to` field.
|
|
20
|
+
*/
|
|
21
|
+
labelTo?: string;
|
|
22
|
+
/**
|
|
23
|
+
* If true, an asterisk will be displayed next to the labels
|
|
24
|
+
* Most browsers will automatically validate this, but it's recommended to also
|
|
25
|
+
* have MForm also validate as well so that `Error` displays for consistency.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
required?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* If `true`, the component becomes readonly.
|
|
31
|
+
* @default false
|
|
32
|
+
*/
|
|
33
|
+
readOnly?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Format of the date (applies to both fields)
|
|
36
|
+
*/
|
|
37
|
+
format?: string;
|
|
38
|
+
/**
|
|
39
|
+
* If true, calendar icon that displays an interactable calendar will appear when interacted with
|
|
40
|
+
*/
|
|
41
|
+
isDatePicker?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Props for the `from` field. Use this to apply props *only* to this field. To apply props to both, pass the prop directly on this component.
|
|
44
|
+
*/
|
|
45
|
+
fromFieldProps?: DateFieldProps;
|
|
46
|
+
/**
|
|
47
|
+
* Props for the `to` field. Use this to apply props *only* to this field. To apply props to both, pass the prop directly on this component.
|
|
48
|
+
*/
|
|
49
|
+
toFieldProps?: DateFieldProps;
|
|
50
|
+
/**
|
|
51
|
+
* If true, the prepackaged dynamic input label that comes with Material UI's input components
|
|
52
|
+
* will be replaced with a static typography label above the input.
|
|
53
|
+
* @default false
|
|
54
|
+
*/
|
|
55
|
+
staticLabels?: boolean;
|
|
56
|
+
};
|
|
57
|
+
export type DateRangeFieldProps = BaseDateRangeFieldProps & Omit<DateFieldProps, 'label' | 'name' | 'isDatePicker' | 'format' | 'readOnly'>;
|
|
58
|
+
/**
|
|
59
|
+
* `DateRangeField` provides an input for a range of dates (2). For individual Date fields, see `DateField`.
|
|
60
|
+
*/
|
|
61
|
+
export declare const DateRangeField: React.FC<DateRangeFieldProps>;
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type FileListProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Name of the component. Must match the name of the corresponding FileUpload.
|
|
5
|
+
* @required
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Simple component for displaying the file(s) selected by the user via FileUpload
|
|
11
|
+
*/
|
|
12
|
+
export declare const FileList: React.FC<FileListProps>;
|
|
13
|
+
export default FileList;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export type FileUploadProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Must match a key from initialValues in Formik.
|
|
6
|
+
* @required
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* File extensions that FileUpload will accept. Does NOT restrict files selected via drag & drop.
|
|
11
|
+
*
|
|
12
|
+
* IMPORTANT: Do not rely on this prop as a validator. The server should be validating all files to ensure they are the correct type. For more information, see [W3Schools HTML Input accept attribute](https://www.w3schools.com/TAGS/att_input_accept.asp).
|
|
13
|
+
*/
|
|
14
|
+
fileType?: string | string[];
|
|
15
|
+
/**
|
|
16
|
+
* If true, the user will be able to upload multiple files.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
multiple?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Choose whether to have a button or drag-and-drop. Drag-and-drop is default when `multiple` is true.
|
|
22
|
+
*/
|
|
23
|
+
variant?: 'button' | 'drag-and-drop';
|
|
24
|
+
/**
|
|
25
|
+
* If `true`, the component becomes readonly. It will only be visible if a file is present.
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
readOnly?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* [Drag & Drop] Subtitle
|
|
31
|
+
*
|
|
32
|
+
* By default, it will display the accepted file extensions, if specified. Blank otherwise. Ex. "Allowed file extensions: .png"
|
|
33
|
+
*/
|
|
34
|
+
subtitle?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Callback that is called when the user attempts to select a file that is already selected. Use this to handle validation and/or UI warnings/errors regarding duplicate files.
|
|
37
|
+
* @param duplicateFiles List of files that was already selected
|
|
38
|
+
*/
|
|
39
|
+
duplicateFilesCallback?: (duplicateFiles: File[]) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Callback that is called when the user attempts to select a file that is not included in `fileType`. Must have `fileType` defined. Use this to handle validation and/or UI warnings/errors regarding files with prohibitted file extensions.
|
|
42
|
+
* @param incorrectFileTypes List of files that have prohibitted file types
|
|
43
|
+
*/
|
|
44
|
+
incorrectFileTypesCallback?: (incorrectFileTypes: File[]) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Props from MUI-Bueno's Typography component.
|
|
47
|
+
* Used to customize the label when the static label option is selected or the field is readOnly.
|
|
48
|
+
*/
|
|
49
|
+
staticLabelProps?: TypographyProps;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Allows the user to select file(s) from their computer.
|
|
53
|
+
*
|
|
54
|
+
* Based on [Material UI's File Upload](https://mui.com/material-ui/react-button/#file-upload). Alternatively, a drag-and-drop option is also available.
|
|
55
|
+
*
|
|
56
|
+
* This component automatically ignores duplicate files to avoid render issues (primarily in regards to duplicate React keys).
|
|
57
|
+
*
|
|
58
|
+
* This component automatically ignores files that have incorrect file extensions when `fileType` is defined. __IMPORTANT: Do not rely on this `fileType` as a validator.__ The server should be validating all files to ensure they are the correct type. For more information, see [W3Schools HTML Input accept attribute](https://www.w3schools.com/TAGS/att_input_accept.asp).
|
|
59
|
+
*
|
|
60
|
+
* __NOTE: Input only.__ Does not display the file(s) chosen by the user. You will need to implement this yourself and/or use `FileList`. View the Storybook stories for `FileUpload` for more information.
|
|
61
|
+
*/
|
|
62
|
+
export declare const FileUpload: React.FC<FileUploadProps>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { TextFieldProps } from '../TextField/TextField';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
type BaseLocationProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the component. Must match the initialValue name in Formik.
|
|
7
|
+
* @required
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* API Key. Needed for Location to work.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: MAKE SURE TO TIE YOUR API KEY TO A DOMAIN TO ENSURE THE SECURITY OF YOUR KEY
|
|
14
|
+
* @required
|
|
15
|
+
*/
|
|
16
|
+
apiKey: string;
|
|
17
|
+
/**
|
|
18
|
+
* The label for the text field.
|
|
19
|
+
* @recommended
|
|
20
|
+
* @default props.name
|
|
21
|
+
*/
|
|
22
|
+
label?: string;
|
|
23
|
+
/**
|
|
24
|
+
* If true, the parts of the location suggestions that match the input are highlighted
|
|
25
|
+
* @default true
|
|
26
|
+
*/
|
|
27
|
+
highlightMatches?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The icon shown to the left of each location suggestion.
|
|
30
|
+
* Use false to indicate no icon
|
|
31
|
+
* @default <LocationOnIcon/>
|
|
32
|
+
*/
|
|
33
|
+
resultIcon?: React.ReactElement | false;
|
|
34
|
+
/**
|
|
35
|
+
* If specified, restrict results from a Place Autocomplete request to be of a certain type.
|
|
36
|
+
* More information can be found [here](https://developers.google.com/places/supported_types#table3)
|
|
37
|
+
*/
|
|
38
|
+
types?: 'geocode' | 'address' | 'establishment' | '(regions)' | '(cities)';
|
|
39
|
+
/**
|
|
40
|
+
* Specifies the visual input style.
|
|
41
|
+
* @default 'standard'
|
|
42
|
+
*/
|
|
43
|
+
variant?: 'filled' | 'outlined' | 'standard';
|
|
44
|
+
/**
|
|
45
|
+
* If true, the prepackaged dynamic input label that comes with Material UI's input components
|
|
46
|
+
* will be replaced with a static typography label above the input.
|
|
47
|
+
* @default false
|
|
48
|
+
*/
|
|
49
|
+
staticLabel?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Props from MUI-Bueno's Typography component.
|
|
52
|
+
* Used to customize the label when the static label option is selected.
|
|
53
|
+
*/
|
|
54
|
+
staticLabelProps?: TypographyProps;
|
|
55
|
+
/**
|
|
56
|
+
* Margin for the FormControl
|
|
57
|
+
*/
|
|
58
|
+
margin?: 'dense' | 'none' | 'normal';
|
|
59
|
+
};
|
|
60
|
+
export type LocationProps = BaseLocationProps & TextFieldProps;
|
|
61
|
+
/**
|
|
62
|
+
* The `Location` component provides a Google Maps Places Autocomplete functionality to the Mui Bueno library.
|
|
63
|
+
* It supplies a text field that upon input provides location suggestions.
|
|
64
|
+
*
|
|
65
|
+
* Note: You must have an active Google Maps API key to use this component. More information on creating API keys can be found
|
|
66
|
+
* at the [Google Maps API documentation](https://developers.google.com/maps/documentation/javascript/get-api-key).
|
|
67
|
+
*/
|
|
68
|
+
export declare const Location: React.FC<LocationProps>;
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a prediction substring.
|
|
3
|
+
*
|
|
4
|
+
* **Props**
|
|
5
|
+
* - `offset`
|
|
6
|
+
* - Type: `number`
|
|
7
|
+
* - The offset to the substring's start within the description string.
|
|
8
|
+
* - `length`
|
|
9
|
+
* - Type: `number`
|
|
10
|
+
* - The length of the substring
|
|
11
|
+
*
|
|
12
|
+
* https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#PredictionSubstring
|
|
13
|
+
*/
|
|
14
|
+
export type PredictionSubstring = google.maps.places.PredictionSubstring;
|
|
15
|
+
/**
|
|
16
|
+
* Structured information about the place's description, divided into a main text and a secondary text,
|
|
17
|
+
* including an array of matched substrings from the autocomplete input,
|
|
18
|
+
* identified by an offset and a length, expressed in unicode characters.
|
|
19
|
+
*
|
|
20
|
+
* **Props**
|
|
21
|
+
* - `main_text`
|
|
22
|
+
* - Type: `string`
|
|
23
|
+
* - This is the main text part of the unformatted description of the place suggested
|
|
24
|
+
* by the Places service. Usually the name of the place.
|
|
25
|
+
* - `secondary_text`
|
|
26
|
+
* - Type: `string`
|
|
27
|
+
* - This is the secondary text part of the unformatted description of the place suggested
|
|
28
|
+
* by the Places service. Usually the location of the place.
|
|
29
|
+
* - `main_text_matched_substrings`
|
|
30
|
+
* - Type: `PredictionSubstring[]`
|
|
31
|
+
* - A set of substrings in the main text that match elements in the user's input, suitable for
|
|
32
|
+
* use in highlighting those substrings. Each substring is identified by an offset and a length,
|
|
33
|
+
* expressed in unicode characters.
|
|
34
|
+
*
|
|
35
|
+
* https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#StructuredFormatting
|
|
36
|
+
*/
|
|
37
|
+
export type StructuredFormatting = google.maps.places.StructuredFormatting;
|
|
38
|
+
/**
|
|
39
|
+
* Represents a single autocomplete prediction.
|
|
40
|
+
*
|
|
41
|
+
* **Props**
|
|
42
|
+
* - `description`
|
|
43
|
+
* - Type: `string`
|
|
44
|
+
* - This is the unformatted version of the query suggested by the Places service.
|
|
45
|
+
* - `structured_formatting`
|
|
46
|
+
* - Type: `StructuredFormatting`
|
|
47
|
+
* - Structured information about the place's description
|
|
48
|
+
* - `place_id`
|
|
49
|
+
* - Type: `string`
|
|
50
|
+
* - A place ID that can be used to retrieve details about this place using the place details service
|
|
51
|
+
* - `matched_substrings`
|
|
52
|
+
* - Type: `PredictionSubstring[]`
|
|
53
|
+
* - A set of substrings in the place's description that match elements in the user's input,
|
|
54
|
+
* suitable for use in highlighting those substrings. Each substring is identified by an offset
|
|
55
|
+
* and a length, expressed in unicode characters.
|
|
56
|
+
* - `terms`
|
|
57
|
+
* - Type: `PredictionTerm`
|
|
58
|
+
* - Information about individual terms in the above description, from most to least specific.
|
|
59
|
+
* For example, "Taco Bell", "Willitis", and "CA".
|
|
60
|
+
* - `types`
|
|
61
|
+
* - Type: `string[]`
|
|
62
|
+
* - An array of types that the prediction belongs to, for example 'establishment' or 'geocode'.
|
|
63
|
+
*
|
|
64
|
+
* https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletePrediction
|
|
65
|
+
*/
|
|
66
|
+
export type AutocompletePrediction = google.maps.places.AutocompletePrediction;
|
|
67
|
+
/**
|
|
68
|
+
* Request for fetching AutocompletePredictions
|
|
69
|
+
*/
|
|
70
|
+
export interface FetchRequest {
|
|
71
|
+
/**
|
|
72
|
+
* Text input from autocomplete field
|
|
73
|
+
* @required
|
|
74
|
+
*/
|
|
75
|
+
input: string;
|
|
76
|
+
/**
|
|
77
|
+
* Acceptable address types for returning responses
|
|
78
|
+
* @required
|
|
79
|
+
*/
|
|
80
|
+
types: string[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Callback function for fetching AutocompletePredictions
|
|
84
|
+
*/
|
|
85
|
+
export type FetchCallback = (results?: AutocompletePrediction[] | null) => void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AutocompletePrediction } from './Location.types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
interface LocationOptionProps {
|
|
4
|
+
/**
|
|
5
|
+
* Props for list item that wraps custom contents
|
|
6
|
+
* @required
|
|
7
|
+
*/
|
|
8
|
+
listItemProps: React.HTMLAttributes<HTMLLIElement>;
|
|
9
|
+
/**
|
|
10
|
+
* Definition of PlaceType option being rendered in list item
|
|
11
|
+
* @required
|
|
12
|
+
*/
|
|
13
|
+
option: AutocompletePrediction;
|
|
14
|
+
/**
|
|
15
|
+
* Icon to render on far left of list item
|
|
16
|
+
* @required
|
|
17
|
+
*/
|
|
18
|
+
resultIcon: React.ReactElement | false;
|
|
19
|
+
/**
|
|
20
|
+
* Indicates to highlight text in option that matches textfield input
|
|
21
|
+
* @required
|
|
22
|
+
*/
|
|
23
|
+
highlightMatches: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Function to render custom location list items in the Autocomplete menu
|
|
27
|
+
*
|
|
28
|
+
* **Required Props**
|
|
29
|
+
* - `listItemProps` - Props for list item that wraps custom contents
|
|
30
|
+
* - `option` - Definition of PlaceType option being rendered in list item
|
|
31
|
+
* - `resultIcon` - Icon to render on far left of list item
|
|
32
|
+
* - `highlightMatches` - Indicates to highlight text in option that matches textfield input
|
|
33
|
+
*
|
|
34
|
+
* @param props LocationOptionProps
|
|
35
|
+
* @returns Custom autocomplete option
|
|
36
|
+
*/
|
|
37
|
+
declare const LocationOption: React.FC<LocationOptionProps>;
|
|
38
|
+
export default LocationOption;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { RadioProps, RadioGroupProps as MuiRadioGroupProps, TypographyProps } from '@mui/material';
|
|
2
|
+
type BaseRadioProps<T> = {
|
|
3
|
+
/**
|
|
4
|
+
* Value of the radio button
|
|
5
|
+
* @required
|
|
6
|
+
*/
|
|
7
|
+
value: T;
|
|
8
|
+
/**
|
|
9
|
+
* Label of the radio button
|
|
10
|
+
* @required
|
|
11
|
+
*/
|
|
12
|
+
label: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional, additional label that appears below `label` and provides additional
|
|
15
|
+
* context, if necessary.
|
|
16
|
+
*/
|
|
17
|
+
sublabel?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* *Interface used exclusively for creating radio buttons within RadioGroup*
|
|
21
|
+
*
|
|
22
|
+
* Radio is an interface that defines the structure and layout of a single radio button and accompanying label.
|
|
23
|
+
* An array of this interface (`Radio<T>[]`) is used in the `<RadioGroup>` component as the `radios` prop to
|
|
24
|
+
* define and create the radio buttons.
|
|
25
|
+
*/
|
|
26
|
+
export type Radio<T> = BaseRadioProps<T> & Omit<RadioProps, 'checked' | 'id' | 'required' | 'value'>;
|
|
27
|
+
type BaseRadioGroupProps<T> = {
|
|
28
|
+
/**
|
|
29
|
+
* Name and ID of the component. It should match a key in initialValues.
|
|
30
|
+
* @required
|
|
31
|
+
*/
|
|
32
|
+
name: string;
|
|
33
|
+
/**
|
|
34
|
+
* Label for the radio group.
|
|
35
|
+
* @recommended
|
|
36
|
+
* @default props.name
|
|
37
|
+
*/
|
|
38
|
+
label?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Radio buttons for the radio group.
|
|
41
|
+
* @recommended
|
|
42
|
+
*/
|
|
43
|
+
radios?: Radio<T>[];
|
|
44
|
+
/**
|
|
45
|
+
* Disables all radio buttons.
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* If true, the label above the radio buttons is disabled.
|
|
51
|
+
*/
|
|
52
|
+
disableLabel?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* If true, the label of the the radio group will not be displayed in an error state if there are errors present.
|
|
55
|
+
*/
|
|
56
|
+
disableRedLabelOnError?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* If true, causes the label to enter a focused state.
|
|
59
|
+
*/
|
|
60
|
+
focused?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* If true, the radio buttons take up the entire width of its parent container.
|
|
63
|
+
*/
|
|
64
|
+
fullWidth?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Location of the label with respect to the radio button.
|
|
67
|
+
* @default 'end'
|
|
68
|
+
*/
|
|
69
|
+
labelPlacement?: 'top' | 'start' | 'bottom' | 'end';
|
|
70
|
+
/**
|
|
71
|
+
* Vertical alignment of the label with respect to the radio buttons. This is mainly for longer labels, or radio buttons with sublabels.
|
|
72
|
+
* Only applied when `labelPlacement` is 'start' or 'end'.
|
|
73
|
+
*
|
|
74
|
+
* Center: Verticaly aligns the radio button with the center of the label (& sublabel)
|
|
75
|
+
*
|
|
76
|
+
* Top: Vertically aligns the radio button with the first line of the label
|
|
77
|
+
*
|
|
78
|
+
* Defaults to 'top' when labelPlacement is 'start' | 'end. Otherwise, defaults to 'center'.
|
|
79
|
+
* @default 'top'
|
|
80
|
+
*/
|
|
81
|
+
labelAlignment?: 'center' | 'top';
|
|
82
|
+
/**
|
|
83
|
+
* Margin for the FormControl
|
|
84
|
+
*/
|
|
85
|
+
margin?: 'dense' | 'none' | 'normal';
|
|
86
|
+
/**
|
|
87
|
+
* If true, an asterisk will be displayed next to the label
|
|
88
|
+
* Most browsers will automatically validate this, but it's recommended to also
|
|
89
|
+
* have ( NOT Formik) also validate as well so that `Error` displays for consistency.
|
|
90
|
+
* @default false
|
|
91
|
+
*/
|
|
92
|
+
required?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Forces one single color on all of the radio buttons.
|
|
95
|
+
*/
|
|
96
|
+
sameButtonColor?: 'primary' | 'secondary' | 'default';
|
|
97
|
+
/**
|
|
98
|
+
* If `true`, the component becomes readonly.
|
|
99
|
+
* @default false
|
|
100
|
+
*/
|
|
101
|
+
readOnly?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* OnChange handler, called when the user changes their selection
|
|
104
|
+
*/
|
|
105
|
+
onChange?: (val: T) => void;
|
|
106
|
+
/**
|
|
107
|
+
* Props from MUI-Bueno's Typography component.
|
|
108
|
+
* Used to customize the label when the static label option is selected or the field is readOnly.
|
|
109
|
+
*/
|
|
110
|
+
staticLabelProps?: TypographyProps;
|
|
111
|
+
};
|
|
112
|
+
export type RadioGroupProps<T> = BaseRadioGroupProps<T> & Omit<MuiRadioGroupProps, 'onChange' | 'name'>;
|
|
113
|
+
/**
|
|
114
|
+
* RadioGroup produces a group of radio buttons that's defined as an array of Radio<T>.
|
|
115
|
+
*
|
|
116
|
+
* This component is ideal for limited options. For more than 4 options, use an Autocomplete or Select instead.
|
|
117
|
+
*/
|
|
118
|
+
export declare const RadioGroup: <T extends string | number | boolean | object>(props: RadioGroupProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SliderProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type BaseRangeSliderProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Must match a key from initialValues in Formik.
|
|
6
|
+
* @required
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* The label displayed above the component.
|
|
11
|
+
* @recommended
|
|
12
|
+
*/
|
|
13
|
+
label?: string;
|
|
14
|
+
/**
|
|
15
|
+
* If set, the component becomes readonly.
|
|
16
|
+
* By default, will display as a number. To display as a percentage, use readOnly='percent'
|
|
17
|
+
* @default 'number'
|
|
18
|
+
*/
|
|
19
|
+
readOnly?: true | 'percent';
|
|
20
|
+
/**
|
|
21
|
+
* Props from MUI-Bueno's Typography component.
|
|
22
|
+
* Used to customize the label when the static label option is selected or the field is readOnly.
|
|
23
|
+
*/
|
|
24
|
+
staticLabelProps?: TypographyProps;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Type used to define props passed into RangeSlider component
|
|
28
|
+
*/
|
|
29
|
+
export type RangeSliderProps = BaseRangeSliderProps & SliderProps;
|
|
30
|
+
/**
|
|
31
|
+
* The range slider is usually used when the user needs the ability to adjust a value between a minimum and maximum.
|
|
32
|
+
*/
|
|
33
|
+
export declare const RangeSlider: React.FC<RangeSliderProps>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ImageNodeAttributes } from 'mui-tiptap';
|
|
2
|
+
export type RichTextControlsProps = {
|
|
3
|
+
onUploadFiles: (files: File[]) => ImageNodeAttributes[] | Promise<ImageNodeAttributes[]>;
|
|
4
|
+
};
|
|
5
|
+
export declare const RichTextControls: (props: RichTextControlsProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default RichTextControls;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { ImageNodeAttributes } from 'mui-tiptap';
|
|
3
|
+
export type RichTextEditorProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Name and ID of the component. Must match a key from initialValues in MForm.
|
|
6
|
+
* @required
|
|
7
|
+
*/
|
|
8
|
+
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* (Optional) Label. NOTE: this won't be floating, it's always static.
|
|
11
|
+
*/
|
|
12
|
+
label?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Styling for label
|
|
15
|
+
*/
|
|
16
|
+
labelProps?: TypographyProps;
|
|
17
|
+
/**
|
|
18
|
+
* Handler for uploading files/images. Use this to save your images to your server (ex. S3 Bucket).
|
|
19
|
+
*/
|
|
20
|
+
onUploadFiles: (files: File[]) => ImageNodeAttributes[] | Promise<ImageNodeAttributes[]>;
|
|
21
|
+
/**
|
|
22
|
+
* If `true`, the component becomes readonly.
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
readOnly?: boolean;
|
|
26
|
+
renderContentOnly?: never;
|
|
27
|
+
};
|
|
28
|
+
export type RichTextFieldProps = RichTextEditorProps | {
|
|
29
|
+
name?: never;
|
|
30
|
+
label?: never;
|
|
31
|
+
labelProps?: never;
|
|
32
|
+
onUploadFiles?: never;
|
|
33
|
+
readOnly?: never;
|
|
34
|
+
/**
|
|
35
|
+
* The component ONLY renders the HTML string. Use this prop when you ONLY want to render HTML (no MForm/field).
|
|
36
|
+
*
|
|
37
|
+
* This is similar to using `readOnly`, but is more efficient. This uses Mui TipTap's `RichTextReadOnly` component
|
|
38
|
+
* internally. For more information on when to use this over just disabling the editor (via `readOnly`),
|
|
39
|
+
* [read the documentation](https://github.com/sjdemartini/mui-tiptap?tab=readme-ov-file#render-read-only-rich-text-content).
|
|
40
|
+
*
|
|
41
|
+
* IMPORTANT: WHEN DEFINED, ONLY THIS PROP CAN HAVE A VALUE. If you need access to other props, consider using `readOnly` instead.
|
|
42
|
+
*/
|
|
43
|
+
renderContentOnly: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Rich Text field -- uses MUI Tip Tap
|
|
47
|
+
*
|
|
48
|
+
* MForm -- This field cannot be completely controlled, so keep in mind that the MForm value will not update until the field
|
|
49
|
+
* __loses focus__. This is to prevent issues with converting from rich text to HTML as the user types as it could override
|
|
50
|
+
* their changes unintentionally.
|
|
51
|
+
*
|
|
52
|
+
* NOTE: If you just want to render the HTML (no editing/MForm), try <RichTextReadOnly content={<your HTML string>} /> instead.
|
|
53
|
+
* Full details on [TipTap's docs](https://github.com/sjdemartini/mui-tiptap?tab=readme-ov-file#render-read-only-rich-text-content)
|
|
54
|
+
*/
|
|
55
|
+
export declare const RichTextField: (props: RichTextFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export default RichTextField;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SuggestionOptions, SuggestionProps } from '@tiptap/suggestion';
|
|
2
|
+
import { MentionSuggestion } from './mentionSuggestionOptions';
|
|
3
|
+
export type SuggestionListRef = {
|
|
4
|
+
onKeyDown: NonNullable<ReturnType<NonNullable<SuggestionOptions<MentionSuggestion>['render']>>['onKeyDown']>;
|
|
5
|
+
};
|
|
6
|
+
export type SuggestionListProps = SuggestionProps<MentionSuggestion>;
|
|
7
|
+
declare const SuggestionList: import('react').ForwardRefExoticComponent<SuggestionListProps & import('react').RefAttributes<SuggestionListRef>>;
|
|
8
|
+
export default SuggestionList;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EditorOptions } from '@tiptap/core';
|
|
2
|
+
export type UseExtensionsOptions = {
|
|
3
|
+
/** Placeholder hint to show in the text input area before a user types a message. */
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* A hook for providing a default set of useful extensions for the MUI-Tiptap
|
|
8
|
+
* editor.
|
|
9
|
+
*/
|
|
10
|
+
export default function useExtensions({ placeholder }?: UseExtensionsOptions): EditorOptions['extensions'];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for SearchField props.
|
|
3
|
+
* @property {(value?: string) => void} onSearch - called each time user types a character in the input field, or when they click the search bar/'Enter' key
|
|
4
|
+
* @property {string} initialValue - initial value (may be useful if using Redux)
|
|
5
|
+
* @property {boolean} lazySearch - If true, onSearch will only be called when user clicks search button/'Enter' key
|
|
6
|
+
*/
|
|
7
|
+
export type SearchFieldProps = {
|
|
8
|
+
onSearch: (value?: string) => void;
|
|
9
|
+
initialValue?: string;
|
|
10
|
+
lazySearch?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Search Field component. Can be used by itself, and/or with a table to filter data (Table/PagingTable).
|
|
14
|
+
*/
|
|
15
|
+
export declare const SearchField: (props: SearchFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default SearchField;
|