cozy-ui 128.4.0 → 128.5.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
@@ -1,3 +1,10 @@
1
+ # [128.5.0](https://github.com/cozy/cozy-ui/compare/v128.4.0...v128.5.0) (2025-09-08)
2
+
3
+
4
+ ### Features
5
+
6
+ * **ConfirmDialogProviders:** Expose method to close the dialog ([7d3d841](https://github.com/cozy/cozy-ui/commit/7d3d841))
7
+
1
8
  # [128.4.0](https://github.com/cozy/cozy-ui/compare/v128.3.5...v128.4.0) (2025-09-04)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "128.4.0",
3
+ "version": "128.5.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -1,4 +1,6 @@
1
- `Breakpoints` & `I18n` Providers are needed for this component
1
+ Use `@date-io/date-fns` under the hood.
2
+
3
+ ⚠️ `Breakpoints` & `I18n` Providers are needed for this component
2
4
 
3
5
  ### Usage
4
6
 
@@ -4,7 +4,7 @@ import ConfirmDialogProvider, { useConfirmDialog } from 'cozy-ui/transpiled/reac
4
4
  import Button from 'cozy-ui/transpiled/react/Buttons'
5
5
 
6
6
  const Component = () => {
7
- const { showConfirmDialog } = useConfirmDialog()
7
+ const { showConfirmDialog, closeConfirmDialog } = useConfirmDialog()
8
8
 
9
9
  return (
10
10
  <Button
@@ -13,7 +13,12 @@ const Component = () => {
13
13
  showConfirmDialog({
14
14
  title: "Title of the ConfirmDialog",
15
15
  content: "Content of the ConfirmDialog",
16
- actions: <Button label="Ok" />
16
+ actions: (
17
+ <>
18
+ <Button label="Cancel" variant="secondary" onClick={closeConfirmDialog} />
19
+ <Button label="Ok" />
20
+ </>
21
+ )
17
22
  })
18
23
  }
19
24
  />
@@ -34,9 +34,10 @@ const ConfirmDialogProvider = ({ children }) => {
34
34
  () => ({
35
35
  showConfirmDialog: args => {
36
36
  setState({ open: true, ...args })
37
- }
37
+ },
38
+ closeConfirmDialog: handleClose(state, setState)
38
39
  }),
39
- []
40
+ [state]
40
41
  )
41
42
 
42
43
  return (
@@ -55,9 +55,10 @@ var ConfirmDialogProvider = function ConfirmDialogProvider(_ref) {
55
55
  setState(_objectSpread({
56
56
  open: true
57
57
  }, args));
58
- }
58
+ },
59
+ closeConfirmDialog: handleClose(state, setState)
59
60
  };
60
- }, []);
61
+ }, [state]);
61
62
  return /*#__PURE__*/React.createElement(ConfirmDialogContext.Provider, {
62
63
  value: value
63
64
  }, children, open && /*#__PURE__*/React.createElement(ConfirmDialog, _extends({