@simoncomputing/mui-bueno-v2 0.18.8 → 0.18.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/components/Form/Error/Error.d.ts +1 -1
- package/dist/components/Form/Inputs/Autocomplete/Autocomplete.d.ts +2 -6
- package/dist/components/Form/Inputs/BaseInputProps.d.ts +22 -0
- package/dist/components/Form/Inputs/Checkbox/Checkbox.d.ts +2 -12
- package/dist/components/Form/Inputs/CheckboxGroup/CheckboxGroup.d.ts +2 -6
- package/dist/components/Form/Inputs/CitationField/CitationField.d.ts +2 -6
- package/dist/components/Form/Inputs/DateField/DateField.d.ts +2 -6
- package/dist/components/Form/Inputs/FileUpload/FileUpload.d.ts +2 -6
- package/dist/components/Form/Inputs/Location/Location.d.ts +2 -6
- package/dist/components/Form/Inputs/RadioGroup/RadioGroup.d.ts +2 -6
- package/dist/components/Form/Inputs/Select/Select.d.ts +2 -6
- package/dist/components/Form/Inputs/Switch/Switch.d.ts +2 -6
- package/dist/components/Form/Inputs/TextField/TextField.d.ts +2 -6
- package/dist/index.cjs.js +76 -76
- package/dist/index.es.js +5104 -5081
- package/dist/index.umd.js +62 -62
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
11
11
|
- Minor increment --> singlular/minor changes. Minimal breaking changes.
|
|
12
12
|
- Patch increment --> singlular/minor changes. Zero breaking changes.
|
|
13
13
|
|
|
14
|
+
## [0.18.10] - 2025-09-25
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- All Form Input components (`Autocomplete`, `MultiAutocomplete`, `Checkbox`, `CheckboxGroup`, `CitationField`, `DateField`, `DateRangeField`, `FileUpload`, `Location`, `RadioGroup`, `Select`, `Switch`, `TextField`)
|
|
19
|
+
- added `collapseErrorWhenEmpty`, which will collapse or leave padding (default) for the internal `Error` component. (The value is passed directly to `Error`'s `collapseWhenEmpty` prop).
|
|
20
|
+
|
|
21
|
+
### Removed
|
|
22
|
+
|
|
23
|
+
- `Checkbox`
|
|
24
|
+
- Removed `noError`. Migration: use `collapseErrorWhenEmpty` instead.
|
|
25
|
+
|
|
26
|
+
## [0.18.9] - 2025-09-25
|
|
27
|
+
|
|
28
|
+
### Changed
|
|
29
|
+
|
|
30
|
+
- `Error`
|
|
31
|
+
- rename `hideWhenEmpty` prop to `collapseWhenEmpty` for clarity
|
|
32
|
+
|
|
14
33
|
## [0.18.8] - 2025-09-25
|
|
15
34
|
|
|
16
35
|
### Added
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { AutocompleteProps as MuiAutocompleteProps, TypographyProps } from '@mui/material';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Name of the component. Must match a key from initialValues in Formik.
|
|
5
|
-
* @required
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
2
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
3
|
+
export type BaseAutocompleteProps<T> = BaseInputProps & {
|
|
8
4
|
/**
|
|
9
5
|
* The label for the text field.
|
|
10
6
|
* @recommended
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base props for ALL inputs
|
|
3
|
+
*
|
|
4
|
+
* TODO: Add other shared props, if possible. Maybe `label`, `required`, etc.?
|
|
5
|
+
*/
|
|
6
|
+
export type BaseInputProps = {
|
|
7
|
+
/**
|
|
8
|
+
* Must match a key from initialValues in Formik.
|
|
9
|
+
* @required
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* When true, compoent will not take up space when no error(s) exist. This is recommended when
|
|
14
|
+
* validation is not needed.
|
|
15
|
+
*
|
|
16
|
+
* When false or undefined, component will take up space when no error(s) exist. This is recommended when
|
|
17
|
+
* the field and/or form requires validation, to prevent form jittering as errors show/hide.
|
|
18
|
+
*
|
|
19
|
+
* @default undefined
|
|
20
|
+
*/
|
|
21
|
+
collapseErrorWhenEmpty?: boolean;
|
|
22
|
+
};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { CheckboxProps as MuiCheckboxProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
type BaseCheckboxProps = {
|
|
4
|
-
/**
|
|
5
|
-
* Must match a key from initialValues in Formik.
|
|
6
|
-
* @required
|
|
7
|
-
*/
|
|
8
|
-
name: string;
|
|
4
|
+
type BaseCheckboxProps = BaseInputProps & {
|
|
9
5
|
/**
|
|
10
6
|
* The label for the checkbox.
|
|
11
7
|
* @recommended
|
|
@@ -49,12 +45,6 @@ type BaseCheckboxProps = {
|
|
|
49
45
|
* Used to customize the label when the static label option is selected or the field is readOnly.
|
|
50
46
|
*/
|
|
51
47
|
staticLabelProps?: TypographyProps;
|
|
52
|
-
/**
|
|
53
|
-
* Does not display error and does not leave padding for error.
|
|
54
|
-
*
|
|
55
|
-
* Use this if handling validation errors elsewhere.
|
|
56
|
-
*/
|
|
57
|
-
noError?: boolean;
|
|
58
48
|
};
|
|
59
49
|
export type CheckboxProps = BaseCheckboxProps & Omit<MuiCheckboxProps, 'checked' | 'name'>;
|
|
60
50
|
/**
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { TypographyProps } from '@mui/material';
|
|
2
2
|
import { CheckboxOption } from '../../../../@types';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* Name and ID of the component. It should match a key in initialValues.
|
|
6
|
-
* @required
|
|
7
|
-
*/
|
|
8
|
-
name: string;
|
|
3
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
4
|
+
export type CheckboxGroupProps = BaseInputProps & {
|
|
9
5
|
/**
|
|
10
6
|
* Label for the checkbox group.
|
|
11
7
|
* @recommended
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { Citation, PageState, PageResponse, UnsavedCitation } from '../../../../@types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Name and ID of the component. Must match a key from initialValues in Formik.
|
|
5
|
-
* @required
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
2
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
3
|
+
export type CitationFieldProps = BaseInputProps & {
|
|
8
4
|
/**
|
|
9
5
|
* (Optional) Label. NOTE: this won't be floating, it's always static.
|
|
10
6
|
*/
|
|
@@ -3,13 +3,9 @@ import { DateFieldProps as MuiDateFieldProps } from '@mui/x-date-pickers/DateFie
|
|
|
3
3
|
import { Dayjs } from 'dayjs';
|
|
4
4
|
import { DatePickerProps } from '@mui/x-date-pickers/DatePicker';
|
|
5
5
|
import { DateValidationError, PickerChangeHandlerContext } from '@mui/x-date-pickers';
|
|
6
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
6
7
|
import * as React from 'react';
|
|
7
|
-
type BaseDateFieldProps = {
|
|
8
|
-
/**
|
|
9
|
-
* Name and ID of the component. Must match a key from initialValues in Formik.
|
|
10
|
-
* @required
|
|
11
|
-
*/
|
|
12
|
-
name: string;
|
|
8
|
+
type BaseDateFieldProps = BaseInputProps & {
|
|
13
9
|
/**
|
|
14
10
|
* Label for the Date field. `name` will be used if none is provided
|
|
15
11
|
*/
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
2
3
|
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;
|
|
4
|
+
export type FileUploadProps = BaseInputProps & {
|
|
9
5
|
/**
|
|
10
6
|
* File extensions that FileUpload will accept. Does NOT restrict files selected via drag & drop.
|
|
11
7
|
*
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { TypographyProps } from '@mui/material';
|
|
2
2
|
import { TextFieldProps } from '../TextField/TextField';
|
|
3
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
3
4
|
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;
|
|
5
|
+
type BaseLocationProps = BaseInputProps & {
|
|
10
6
|
/**
|
|
11
7
|
* API Key. Needed for Location to work.
|
|
12
8
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RadioProps, RadioGroupProps as MuiRadioGroupProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
2
3
|
type BaseRadioProps<T> = {
|
|
3
4
|
/**
|
|
4
5
|
* Value of the radio button
|
|
@@ -24,12 +25,7 @@ type BaseRadioProps<T> = {
|
|
|
24
25
|
* define and create the radio buttons.
|
|
25
26
|
*/
|
|
26
27
|
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;
|
|
28
|
+
type BaseRadioGroupProps<T> = BaseInputProps & {
|
|
33
29
|
/**
|
|
34
30
|
* Label for the radio group.
|
|
35
31
|
* @recommended
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SelectProps as MuiSelectProps, TypographyProps } from '@mui/material';
|
|
2
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
2
3
|
import * as React from 'react';
|
|
3
4
|
/**
|
|
4
5
|
* *Interface used exclusively for creating the select menu within Select*
|
|
@@ -40,12 +41,7 @@ export interface SelectOption<T> {
|
|
|
40
41
|
*/
|
|
41
42
|
required?: boolean;
|
|
42
43
|
}
|
|
43
|
-
type BaseSelectProps<T> = {
|
|
44
|
-
/**
|
|
45
|
-
* Must match the initialValue name in BForm.
|
|
46
|
-
* @required
|
|
47
|
-
*/
|
|
48
|
-
name: string;
|
|
44
|
+
type BaseSelectProps<T> = BaseInputProps & {
|
|
49
45
|
/**
|
|
50
46
|
* Label for the select component
|
|
51
47
|
*/
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { SwitchProps as MuiSwitchProps, TypographyProps, Theme, SwitchPropsColorOverrides } from '@mui/material';
|
|
2
2
|
import { OverridableStringUnion } from '@mui/types';
|
|
3
3
|
import { SystemProps } from '@mui/system';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* Name and ID of the component. Must match a key from initialValues in Formik.
|
|
7
|
-
* @required
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
4
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
5
|
+
export type BaseSwitchProps<T = boolean> = BaseInputProps & {
|
|
10
6
|
/**
|
|
11
7
|
* Label that goes next to the switch.
|
|
12
8
|
* @recommended
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { TypographyProps, TextFieldProps as MuiTextFieldProps } from '@mui/material';
|
|
2
|
+
import { BaseInputProps } from '../BaseInputProps';
|
|
2
3
|
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;
|
|
4
|
+
type BaseTextFieldProps = BaseInputProps & {
|
|
9
5
|
/**
|
|
10
6
|
* If true, ensures that user enters only input that matches the format.
|
|
11
7
|
* Defaults to true if a format is specified.
|