@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 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,5 @@
1
+ // src/types/htmldiff-js.d.ts
2
+ declare module 'htmldiff-js' {
3
+ const HtmlDiff: any;
4
+ export default HtmlDiff;
5
+ }
@@ -0,0 +1,10 @@
1
+ export type DiffProps = {
2
+ beforeTxt?: string;
3
+ afterTxt?: string;
4
+ /**
5
+ * Set to `true` for HTML
6
+ */
7
+ useHtmlDiff?: boolean;
8
+ };
9
+ export declare const Diff: (props: DiffProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default Diff;
@@ -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
@@ -11,6 +11,10 @@ export type BaseInputProps = {
11
11
  * @required
12
12
  */
13
13
  name: string;
14
+ /**
15
+ * Field label
16
+ */
17
+ label?: string;
14
18
  /**
15
19
  * Error mode for showing validation error messages.
16
20
  *
@@ -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
@@ -42,10 +42,6 @@ export interface SelectOption<T> {
42
42
  required?: boolean;
43
43
  }
44
44
  type BaseSelectProps<T> = BaseInputProps & {
45
- /**
46
- * Label for the select component
47
- */
48
- label?: string;
49
45
  /**
50
46
  * A list of options for the select component.
51
47
  */
@@ -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;