@simoncomputing/mui-bueno-v2 0.25.1 → 0.25.3

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,32 @@ 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.25.3] - 2026-02-06
15
+
16
+ ### Added
17
+
18
+ - `DiffTable`
19
+ - Added `renderExpand` prop from `Table`
20
+ - `ReadOnly`/`Diff`
21
+ - Added new mode "comma". See `MultiAutocomplete` for an example.
22
+ - `MultiAutocomplete`
23
+ - Added support for `DiffProvider` & `ReadOnlyProvider`
24
+
25
+ ## [0.25.2] - 2026-02-05
26
+
27
+ ### Changed
28
+
29
+ - `Diff`/`Readonly`
30
+ - Added `mode`/`diffMode` prop to allow modifying which diff tool to use (word, sentence or HTML based diff).
31
+
32
+ - `TextField`, `Select`, `Autocomplete`, `RadioGroup`
33
+ - Diff will be sentence-based instead of word-based. For `TextField`, this is configurable but defaults to sentence-based.
34
+
35
+ ### Fixed
36
+
37
+ - `Diff`
38
+ - Fixed missing `DiffProps` export
39
+
14
40
  ## [0.25.1] - 2026-02-04
15
41
 
16
42
  ### Fixed
@@ -1,10 +1,22 @@
1
+ export type DiffMode = 'word' | 'sentence' | 'html' | 'comma';
1
2
  export type DiffProps = {
2
3
  beforeTxt?: string;
3
4
  afterTxt?: string;
4
5
  /**
5
- * Set to `true` for HTML
6
+ * word - use word-based diff
7
+ * sentence - use sentence-based diff
8
+ * html - use HTML-based diff
9
+ * comma - use comma-based diff
10
+ *
11
+ * @default sentence
6
12
  */
7
- useHtmlDiff?: boolean;
13
+ mode?: DiffMode;
8
14
  };
15
+ /**
16
+ * Displays diff between two strings.
17
+ *
18
+ * For use with form field components, use `ReadOnly` instead, since it already handles `Diff` internally.
19
+ * See any of the fields in this library (TextField, Select, etc.) for an example of how to use `ReadOnly`.
20
+ */
9
21
  export declare const Diff: (props: DiffProps) => import("react/jsx-runtime").JSX.Element;
10
22
  export default Diff;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Base props for ALL inputs
3
3
  *
4
- * TODO: Add other shared props, if possible. Maybe `label`, `required`, etc.?
4
+ * TODO: Add other shared props, if possible. Maybe `required`, etc.?
5
5
  *
6
6
  * TODO: make sure components are correctly calling formik's handlers (onChange, onBlur, etc.) like TextField
7
7
  */
@@ -1,5 +1,6 @@
1
1
  import { TypographyProps, TextFieldProps as MuiTextFieldProps } from '@mui/material';
2
2
  import { BaseInputProps } from '../BaseInputProps';
3
+ import { DiffMode } from '../../Diff/Diff';
3
4
  import * as React from 'react';
4
5
  type BaseTextFieldProps = BaseInputProps & {
5
6
  /**
@@ -47,6 +48,7 @@ type BaseTextFieldProps = BaseInputProps & {
47
48
  * By default, TextField will trim leading and trailing whitespace on blur. To disable this, set `noTrimOnBlur` to true.
48
49
  */
49
50
  noTrimOnBlur?: boolean;
51
+ diffMode?: DiffMode;
50
52
  };
51
53
  export type TextFieldProps = BaseTextFieldProps & Omit<MuiTextFieldProps, 'defaultValue' | 'error' | 'fullWidth' | 'select' | 'SelectProps' | 'value'>;
52
54
  /**
@@ -1,5 +1,5 @@
1
1
  import { TypographyProps } from '@mui/material';
2
- import { DiffProps } from '../Diff/Diff';
2
+ import { DiffMode, DiffProps } from '../Diff/Diff';
3
3
  import { ReactNode } from 'react';
4
4
  export type ReadOnlyProps = {
5
5
  label: string;
@@ -9,7 +9,13 @@ export type ReadOnlyProps = {
9
9
  staticLabelProps?: TypographyProps;
10
10
  showDiff?: boolean;
11
11
  diffSnapshot?: string;
12
- useHtmlDiff?: boolean;
12
+ diffMode?: DiffMode;
13
13
  } & Omit<DiffProps, 'beforeTxt' | 'afterTxt'>;
14
+ /**
15
+ * To be used by form field components when a component should NOT be editable.
16
+ * This includes when showing the text diff of a field (showDiff from useDiff hook is true).
17
+ *
18
+ * For examples, see TextField, Select, RadioGroup, Autocomplete
19
+ */
14
20
  export declare const ReadOnly: (props: ReadOnlyProps) => import("react/jsx-runtime").JSX.Element;
15
21
  export default ReadOnly;
@@ -7,8 +7,27 @@ export type TableDiff<T> = {
7
7
  export type DiffTableProps<T> = {
8
8
  beforeData: T[];
9
9
  afterData: T[];
10
+ /**
11
+ * See Table.columns
12
+ */
10
13
  columns: TableConfig<T>;
14
+ /**
15
+ * See Table.renderExpand
16
+ *
17
+ * DiffProvider will automatically be applied to content.
18
+ */
19
+ renderExpand?: (item: T) => React.ReactNode;
11
20
  };
21
+ /**
22
+ * Used to display changes (additions, modifications, removals) for a set of data.
23
+ *
24
+ * Adds a new column (left) that denotes whether a row was added, changed or removed. Any unchanged
25
+ * rows will be counted and displayed at the bottom, under the table.
26
+ *
27
+ * Data sets MUST be objects with an id property.
28
+ *
29
+ * NOTE: Changed rows only display that the row was changed. Cell-level diff is not yet implemented.
30
+ */
12
31
  export declare const DiffTable: <T extends {
13
32
  id: number;
14
33
  }>(props: DiffTableProps<T>) => import("react/jsx-runtime").JSX.Element;