cozy-ui 138.6.2 → 138.8.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,22 @@
1
+ # [138.8.0](https://github.com/cozy/cozy-ui/compare/v138.7.0...v138.8.0) (2026-04-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Include NavNext in cozy-ui skill ([aba0a7f](https://github.com/cozy/cozy-ui/commit/aba0a7f))
7
+
8
+
9
+ ### Features
10
+
11
+ * Add cozy-ui skill for coding agents ([804da2e](https://github.com/cozy/cozy-ui/commit/804da2e))
12
+
13
+ # [138.7.0](https://github.com/cozy/cozy-ui/compare/v138.6.2...v138.7.0) (2026-04-27)
14
+
15
+
16
+ ### Features
17
+
18
+ * Change overline style ([938e1e2](https://github.com/cozy/cozy-ui/commit/938e1e2))
19
+
1
20
  ## [138.6.2](https://github.com/cozy/cozy-ui/compare/v138.6.1...v138.6.2) (2026-04-21)
2
21
 
3
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "138.6.2",
3
+ "version": "138.8.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -24,6 +24,7 @@
24
24
  "build:css:utils": "env CSSMODULES=false yarn run stylus-build -o dist/cozy-ui.utils.min.css stylus/cozy-ui/utils.styl",
25
25
  "build:css:kss": "env CSSMODULES=false yarn run stylus-build -o build/styleguide/app.css stylus/cozy-ui/build.styl",
26
26
  "build:doc": "npm-run-all 'build:doc:*'",
27
+ "build:doc:skill": "node scripts/generate-skill.js",
27
28
  "build:doc:config": "copyfiles -u 1 docs/*.md docs/_config.yml build",
28
29
  "build:doc:kss": "NODE_OPTIONS=--openssl-legacy-provider kss --destination build/styleguide --title 'Cozy-UI Styleguide' --source stylus --builder node_modules/michelangelo/kss_styleguide/custom-template --homepage stylus/styleguide.md --css app.css",
29
30
  "build:doc:react": "NODE_OPTIONS=--openssl-legacy-provider styleguidist build --config docs/styleguide.config.js",
@@ -69,10 +69,10 @@ export const makeTypography = () => ({
69
69
  letterSpacing: '0.5px'
70
70
  },
71
71
  overline: {
72
- fontSize: 11,
73
- fontWeight: 500,
74
- lineHeight: '16px',
75
- letterSpacing: '0.5px',
72
+ fontSize: 10,
73
+ fontWeight: 700,
74
+ lineHeight: '13px',
75
+ letterSpacing: '0',
76
76
  textTransform: 'inherit'
77
77
  }
78
78
  })
@@ -17,6 +17,7 @@ const initialVariants = [{
17
17
  outlined: false,
18
18
  noClickAway: false,
19
19
  noTimeOut: false,
20
+ persistent: false,
20
21
  close: true
21
22
  }]
22
23
 
@@ -46,6 +47,7 @@ const Component = ({ variant }) => {
46
47
  : undefined,
47
48
  noClickAway: variant.noClickAway,
48
49
  noTimeOut: variant.noTimeOut,
50
+ duration: variant.persistent ? null : undefined,
49
51
  onClose: variant.close ? () => {} : undefined
50
52
  })
51
53
  }
@@ -30,7 +30,6 @@ export const useAlert = () => {
30
30
  const defaultState = {
31
31
  title: '',
32
32
  message: '',
33
- duration: null,
34
33
  open: false
35
34
  }
36
35
 
@@ -53,7 +52,7 @@ const AlertProvider = ({ children }) => {
53
52
  * @param {ShowAlertArgs} args
54
53
  */
55
54
  showAlert: args => {
56
- setState({ open: true, ...args })
55
+ setState({ ...defaultState, ...args, open: true })
57
56
  }
58
57
  }),
59
58
  []
@@ -0,0 +1,65 @@
1
+ import { act, renderHook } from '@testing-library/react-hooks'
2
+
3
+ import AlertProvider, { useAlert } from '.'
4
+ import Alert from '../../Alert'
5
+ import Snackbar from '../../Snackbar'
6
+
7
+ jest.mock('../../Snackbar', () => ({
8
+ __esModule: true,
9
+ default: jest.fn(({ children }) => children)
10
+ }))
11
+ jest.mock('../../Alert', () => ({
12
+ __esModule: true,
13
+ default: jest.fn(() => null)
14
+ }))
15
+
16
+ const setup = () => {
17
+ const { result } = renderHook(() => useAlert(), { wrapper: AlertProvider })
18
+ const lastProps = mock => mock.mock.calls[mock.mock.calls.length - 1][0]
19
+ return {
20
+ showAlert: args => act(() => result.current.showAlert(args)),
21
+ lastSnackbarProps: () => lastProps(Snackbar),
22
+ lastAlertProps: () => lastProps(Alert)
23
+ }
24
+ }
25
+
26
+ describe('AlertProvider > showAlert', () => {
27
+ beforeEach(() => {
28
+ Snackbar.mockClear()
29
+ Alert.mockClear()
30
+ })
31
+
32
+ it('should leave autoHideDuration undefined when caller omits duration', () => {
33
+ const { showAlert, lastSnackbarProps } = setup()
34
+
35
+ showAlert({ message: 'An error' })
36
+
37
+ expect(lastSnackbarProps().open).toBe(true)
38
+ expect(lastSnackbarProps().autoHideDuration).toBeUndefined()
39
+ })
40
+
41
+ it('should forward a numeric duration to Snackbar', () => {
42
+ const { showAlert, lastSnackbarProps } = setup()
43
+
44
+ showAlert({ message: 'hi', duration: 3000 })
45
+
46
+ expect(lastSnackbarProps().autoHideDuration).toBe(3000)
47
+ })
48
+
49
+ it('should forward an explicit null duration to disable auto-hide', () => {
50
+ const { showAlert, lastSnackbarProps } = setup()
51
+
52
+ showAlert({ message: 'sticky', duration: null })
53
+
54
+ expect(lastSnackbarProps().autoHideDuration).toBeNull()
55
+ })
56
+
57
+ it('should not carry caller-provided fields over to a later call that omits them', () => {
58
+ const { showAlert, lastAlertProps } = setup()
59
+
60
+ showAlert({ message: 'first', severity: 'error' })
61
+ showAlert({ message: 'second' })
62
+
63
+ expect(lastAlertProps().severity).toBeUndefined()
64
+ })
65
+ })