@simoncomputing/mui-bueno-v2 0.25.0 → 0.25.1

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,19 @@ 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.1] - 2026-02-04
15
+
16
+ ### Fixed
17
+
18
+ - `DiffProvider`/`useDiff` hook
19
+ - Added `getSnapshotValue` helper function to `useDiff` hook, which can be used to get desired field value from the `previousSnapshot`. Use this to obtain the before/snapshot value before passing it to `DiffTable` or `ReadOnly` component.
20
+ - Updated supported components (`TextField`, `TextArea`, `Select`, `Autocomplete`, `RadioGroup`, `CitationField`) to use `getSnapshotValue` internally. Previously, they were only working with non-nested formik names.
21
+
22
+ ### Removed
23
+
24
+ - `useDiff` hook
25
+ - `previousSnapshot` is no longer exposed. Use `getSnapshotValue` to get the specific value directly.
26
+
14
27
  ## [0.25.0] - 2026-02-04
15
28
 
16
29
  ### Changed
@@ -1,4 +1,17 @@
1
- type DiffContextType = {
1
+ type DiffContextValue = {
2
+ /**
3
+ * Used by fields to determine whether to render as a read-only diff or not
4
+ */
5
+ showDiff: boolean;
6
+ /**
7
+ * Obtains the snapshot value from `previousSnapshot`.
8
+ *
9
+ * @param name - formik field name
10
+ * @returns value in previousSnapshot (ex. name='phone' could return "999-123-1234")
11
+ */
12
+ getSnapshotValue: (name: string) => any;
13
+ };
14
+ type DiffProviderProps = {
2
15
  showDiff?: boolean;
3
16
  previousSnapshot?: any;
4
17
  children: React.ReactNode;
@@ -9,9 +22,6 @@ type DiffContextType = {
9
22
  * @param showDiff - when true (default), enables text diff. Set to false to return form to normal.
10
23
  * @param previousSnapshot - previous snapshot. This should match the same stucture as your fields (i.e. formik initialValues)
11
24
  */
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
- };
25
+ export declare const DiffProvider: ({ showDiff, previousSnapshot, children }: DiffProviderProps) => import("react/jsx-runtime").JSX.Element;
26
+ export declare const useDiff: () => DiffContextValue;
17
27
  export {};