@simoncomputing/mui-bueno-v2 0.23.2 → 0.24.0
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 +28 -0
- package/dist/@types/declarations.d.ts +5 -0
- package/dist/components/Form/Diff/Diff.d.ts +10 -0
- package/dist/components/Form/Diff/DiffContext.d.ts +17 -0
- package/dist/components/Form/Inputs/Autocomplete/Autocomplete.d.ts +0 -5
- package/dist/components/Form/Inputs/BaseInputProps.d.ts +4 -0
- package/dist/components/Form/Inputs/Checkbox/Checkbox.d.ts +0 -5
- package/dist/components/Form/Inputs/CheckboxGroup/CheckboxGroup.d.ts +0 -6
- package/dist/components/Form/Inputs/CitationField/CitationField.d.ts +2 -4
- package/dist/components/Form/Inputs/DateField/DateField.d.ts +0 -4
- package/dist/components/Form/Inputs/FileUpload/FileUpload.d.ts +1 -1
- package/dist/components/Form/Inputs/Location/Location.d.ts +0 -6
- package/dist/components/Form/Inputs/RadioGroup/RadioGroup.d.ts +0 -6
- package/dist/components/Form/Inputs/Select/Select.d.ts +0 -4
- package/dist/components/Form/Inputs/Switch/Switch.d.ts +0 -5
- package/dist/components/Form/ReadOnly/ReadOnly.d.ts +15 -0
- package/dist/components/Form/ReadOnly/ReadOnlyContext.d.ts +10 -0
- package/dist/index.cjs.js +220 -220
- package/dist/index.d.ts +6 -1
- package/dist/index.es.js +52971 -52290
- package/dist/index.umd.js +222 -222
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -11,6 +11,34 @@ 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.24.0] - 2026-02-02
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- `Table` / `PaginatedTable`
|
|
19
|
+
- Added some padding in between column tooltip & column header text
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- Ability to render whole forms/form sections as read-only or diff (text diff/change tracking). **Note: Not all form field components are supported yet, see list below.**
|
|
24
|
+
- `ReadOnlyProvider` - Wrap around formik (or specific form fields/sections) to render as readOnly
|
|
25
|
+
- To enable your custom inputs to work with this provider, use the `ReadOnly` component and the `useReadOnly` hook in your component
|
|
26
|
+
- `DiffProvider` - Wrap around formik (or specific form fields/sections) to render text diff
|
|
27
|
+
- To enable your custom inputs to work with this provider, use the `Diff` component and the `useDiff` hook in your component
|
|
28
|
+
- The following components have support for `ReadOnlyProvider` & `DiffProvider`:
|
|
29
|
+
- `TextField`
|
|
30
|
+
- `TextArea`
|
|
31
|
+
- `Select`
|
|
32
|
+
- `Autocomplete`
|
|
33
|
+
- `RadioGroup`
|
|
34
|
+
- `CitationField`
|
|
35
|
+
- _Note: For citations, only added/removed citations can be shown. Edits to existing citations are not shown._
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Update `tsconfig`
|
|
40
|
+
- `target` & `lib` updated ES2020 --> ES2022
|
|
41
|
+
|
|
14
42
|
## [0.23.2] - 2026-01-29
|
|
15
43
|
|
|
16
44
|
### Fixed
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type DiffContextType = {
|
|
2
|
+
showDiff?: boolean;
|
|
3
|
+
previousSnapshot?: any;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Wrap around your form (or form section) that should render as a text diff (i.e. to compare the current form to a previous snapshot)
|
|
8
|
+
*
|
|
9
|
+
* @param showDiff - when true (default), enables text diff. Set to false to return form to normal.
|
|
10
|
+
* @param previousSnapshot - previous snapshot. This should match the same stucture as your fields (i.e. formik initialValues)
|
|
11
|
+
*/
|
|
12
|
+
export declare const DiffProvider: ({ showDiff, previousSnapshot, children }: DiffContextType) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const useDiff: () => {
|
|
14
|
+
showDiff: boolean;
|
|
15
|
+
previousSnapshot: null;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { AutocompleteProps as MuiAutocompleteProps, TypographyProps } from '@mui/material';
|
|
2
2
|
import { BaseInputProps } from '../BaseInputProps';
|
|
3
3
|
export type BaseAutocompleteProps<T> = BaseInputProps & {
|
|
4
|
-
/**
|
|
5
|
-
* The label for the text field.
|
|
6
|
-
* @recommended
|
|
7
|
-
*/
|
|
8
|
-
label?: string;
|
|
9
4
|
/**
|
|
10
5
|
* List of options for the autocomplete in label/value format
|
|
11
6
|
* @recommended
|
|
@@ -2,11 +2,6 @@ import { CheckboxProps as MuiCheckboxProps, TypographyProps } from '@mui/materia
|
|
|
2
2
|
import { BaseInputProps } from '../BaseInputProps';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
type BaseCheckboxProps = BaseInputProps & {
|
|
5
|
-
/**
|
|
6
|
-
* The label for the checkbox.
|
|
7
|
-
* @recommended
|
|
8
|
-
*/
|
|
9
|
-
label?: string;
|
|
10
5
|
/**
|
|
11
6
|
* Helpful text that appears below `label` and provides additional context (optional)
|
|
12
7
|
*/
|
|
@@ -2,12 +2,6 @@ import { TypographyProps } from '@mui/material';
|
|
|
2
2
|
import { CheckboxOption } from '../../../../@types';
|
|
3
3
|
import { BaseInputProps } from '../BaseInputProps';
|
|
4
4
|
export type CheckboxGroupProps = BaseInputProps & {
|
|
5
|
-
/**
|
|
6
|
-
* Label for the checkbox group.
|
|
7
|
-
* @recommended
|
|
8
|
-
* @default props.name
|
|
9
|
-
*/
|
|
10
|
-
label?: string;
|
|
11
5
|
/**
|
|
12
6
|
* Array of labels for the checkboxes in the group
|
|
13
7
|
* @recommended
|
|
@@ -2,10 +2,6 @@ import { Citation } from '../../../../@types';
|
|
|
2
2
|
import { BaseInputProps } from '../BaseInputProps';
|
|
3
3
|
import { BaseCitationManagerApiProps } from './CitationManager/BaseCitationManager';
|
|
4
4
|
export type CitationFieldProps = BaseInputProps & BaseCitationManagerApiProps & {
|
|
5
|
-
/**
|
|
6
|
-
* (Optional) Label. NOTE: this won't be floating, it's always static.
|
|
7
|
-
*/
|
|
8
|
-
label?: string;
|
|
9
5
|
/**
|
|
10
6
|
* If `true`, the component becomes readonly.
|
|
11
7
|
* @default false
|
|
@@ -65,6 +61,8 @@ export type CitationFieldProps = BaseInputProps & BaseCitationManagerApiProps &
|
|
|
65
61
|
* shown in the editor will not match the Formik value until the field __loses focus__.
|
|
66
62
|
*
|
|
67
63
|
* Recommended to use with `CitationFieldProvider` for cross-field synchronization.
|
|
64
|
+
*
|
|
65
|
+
* NOTE: `label` will always be static (non-floating)
|
|
68
66
|
*/
|
|
69
67
|
export declare const CitationField: (props: CitationFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
68
|
export default CitationField;
|
|
@@ -6,10 +6,6 @@ import { DateValidationError, PickerChangeHandlerContext } from '@mui/x-date-pic
|
|
|
6
6
|
import { BaseInputProps } from '../BaseInputProps';
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
type BaseDateFieldProps = BaseInputProps & {
|
|
9
|
-
/**
|
|
10
|
-
* Label for the Date field. `name` will be used if none is provided
|
|
11
|
-
*/
|
|
12
|
-
label?: string;
|
|
13
9
|
/**
|
|
14
10
|
* If true, an asterisk will be displayed next to the labels
|
|
15
11
|
* Most browsers will automatically validate this, but it's recommended to also
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TypographyProps } from '@mui/material';
|
|
2
2
|
import { BaseInputProps } from '../BaseInputProps';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
export type FileUploadProps = BaseInputProps & {
|
|
4
|
+
export type FileUploadProps = Omit<BaseInputProps, 'label'> & {
|
|
5
5
|
/**
|
|
6
6
|
* File extensions that FileUpload will accept. Does NOT restrict files selected via drag & drop.
|
|
7
7
|
*
|
|
@@ -10,12 +10,6 @@ type BaseLocationProps = BaseInputProps & {
|
|
|
10
10
|
* @required
|
|
11
11
|
*/
|
|
12
12
|
apiKey: string;
|
|
13
|
-
/**
|
|
14
|
-
* The label for the text field.
|
|
15
|
-
* @recommended
|
|
16
|
-
* @default props.name
|
|
17
|
-
*/
|
|
18
|
-
label?: string;
|
|
19
13
|
/**
|
|
20
14
|
* If true, the parts of the location suggestions that match the input are highlighted
|
|
21
15
|
* @default true
|
|
@@ -26,12 +26,6 @@ type BaseRadioProps<T> = {
|
|
|
26
26
|
*/
|
|
27
27
|
export type Radio<T> = BaseRadioProps<T> & Omit<RadioProps, 'checked' | 'id' | 'required' | 'value'>;
|
|
28
28
|
type BaseRadioGroupProps<T> = BaseInputProps & {
|
|
29
|
-
/**
|
|
30
|
-
* Label for the radio group.
|
|
31
|
-
* @recommended
|
|
32
|
-
* @default props.name
|
|
33
|
-
*/
|
|
34
|
-
label?: string;
|
|
35
29
|
/**
|
|
36
30
|
* Radio buttons for the radio group.
|
|
37
31
|
* @recommended
|
|
@@ -3,11 +3,6 @@ import { OverridableStringUnion } from '@mui/types';
|
|
|
3
3
|
import { SystemProps } from '@mui/system';
|
|
4
4
|
import { BaseInputProps } from '../BaseInputProps';
|
|
5
5
|
export type BaseSwitchProps<T = boolean> = BaseInputProps & {
|
|
6
|
-
/**
|
|
7
|
-
* Label that goes next to the switch.
|
|
8
|
-
* @recommended
|
|
9
|
-
*/
|
|
10
|
-
label?: string;
|
|
11
6
|
/**
|
|
12
7
|
* Disabled
|
|
13
8
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { DiffProps } from '../Diff/Diff';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
export type ReadOnlyProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
readOnlyValue?: ReactNode;
|
|
8
|
+
staticLabel?: boolean;
|
|
9
|
+
staticLabelProps?: TypographyProps;
|
|
10
|
+
showDiff?: boolean;
|
|
11
|
+
diffSnapshot?: string;
|
|
12
|
+
useHtmlDiff?: boolean;
|
|
13
|
+
} & Omit<DiffProps, 'beforeTxt' | 'afterTxt'>;
|
|
14
|
+
export declare const ReadOnly: (props: ReadOnlyProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default ReadOnly;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wrap around your form (or form section) that should render as read-only
|
|
3
|
+
*
|
|
4
|
+
* @param readOnly - when true (default), the form is read-only. Set to false to return form to normal (edit mode).
|
|
5
|
+
*/
|
|
6
|
+
export declare const ReadOnlyProvider: ({ readOnly, children }: {
|
|
7
|
+
readOnly?: boolean;
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const useReadOnly: () => boolean;
|