cozy-ui 122.4.0 → 122.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
+ # [122.5.0](https://github.com/cozy/cozy-ui/compare/v122.4.0...v122.5.0) (2025-04-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * **Nav:** Spread classname on NavItem, NavText and NavIcon ([2396f11](https://github.com/cozy/cozy-ui/commit/2396f11))
7
+
1
8
  # [122.4.0](https://github.com/cozy/cozy-ui/compare/v122.3.0...v122.4.0) (2025-04-11)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "122.4.0",
3
+ "version": "122.5.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -9,10 +9,11 @@ import TopIcon from '../Icons/Top'
9
9
  import useBreakpoints from '../providers/Breakpoints'
10
10
  import { useI18n } from '../providers/I18n'
11
11
 
12
- export const NavItem = ({ children, secondary, ...restProps }) => (
12
+ export const NavItem = ({ className, children, secondary, ...restProps }) => (
13
13
  <li
14
14
  className={cx(
15
15
  styles['c-nav-item'],
16
+ className,
16
17
  secondary ? styles['c-nav-item-secondary'] : null
17
18
  )}
18
19
  {...restProps}
@@ -21,8 +22,8 @@ export const NavItem = ({ children, secondary, ...restProps }) => (
21
22
  </li>
22
23
  )
23
24
 
24
- export const NavText = ({ children }) => (
25
- <span className={styles['c-nav-text']}>{children}</span>
25
+ export const NavText = ({ className, children }) => (
26
+ <span className={cx(styles['c-nav-text'], className)}>{children}</span>
26
27
  )
27
28
 
28
29
  export const NavLink = {
@@ -57,16 +58,16 @@ export const genNavLinkForV6 = RRNavLink =>
57
58
  />
58
59
  ))
59
60
 
60
- export const NavIcon = ({ icon }) => (
61
- <span className={cx(styles['c-nav-icon'])}>
61
+ export const NavIcon = ({ className, icon }) => (
62
+ <span className={cx(styles['c-nav-icon'], className)}>
62
63
  <Icon icon={icon} aria-hidden="true" focusable="false" />
63
64
  </span>
64
65
  )
65
66
 
66
- const Nav = ({ children }) => {
67
+ const Nav = ({ className, children }) => {
67
68
  return (
68
69
  <nav role="navigation">
69
- <ul className={styles['c-nav']}>{children}</ul>
70
+ <ul className={cx(styles['c-nav'], className)}>{children}</ul>
70
71
  </nav>
71
72
  )
72
73
  }
@@ -1,9 +1,11 @@
1
- export function NavItem({ children, secondary, ...restProps }: {
1
+ export function NavItem({ className, children, secondary, ...restProps }: {
2
2
  [x: string]: any;
3
+ className: any;
3
4
  children: any;
4
5
  secondary: any;
5
6
  }): JSX.Element;
6
- export function NavText({ children }: {
7
+ export function NavText({ className, children }: {
8
+ className: any;
7
9
  children: any;
8
10
  }): JSX.Element;
9
11
  export namespace NavLink {
@@ -16,13 +18,15 @@ export function genNavLink(RRNavLink: any): ({ to, children, ...rest }: {
16
18
  children: any;
17
19
  }) => JSX.Element;
18
20
  export function genNavLinkForV6(RRNavLink: any): React.ForwardRefExoticComponent<React.RefAttributes<any>>;
19
- export function NavIcon({ icon }: {
21
+ export function NavIcon({ className, icon }: {
22
+ className: any;
20
23
  icon: any;
21
24
  }): JSX.Element;
22
25
  export const NavDesktopLimiter: any;
23
26
  export default Nav;
24
27
  import React from "react";
25
- declare function Nav({ children }: {
28
+ declare function Nav({ className, children }: {
29
+ className: any;
26
30
  children: any;
27
31
  }): JSX.Element;
28
32
  declare namespace Nav {
@@ -1,7 +1,7 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import _extends from "@babel/runtime/helpers/extends";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "secondary"],
4
+ var _excluded = ["className", "children", "secondary"],
5
5
  _excluded2 = ["to", "children"];
6
6
  import cx from 'classnames';
7
7
  import React, { Children, isValidElement, useState, forwardRef } from 'react';
@@ -22,18 +22,20 @@ import TopIcon from "cozy-ui/transpiled/react/Icons/Top";
22
22
  import useBreakpoints from "cozy-ui/transpiled/react/providers/Breakpoints";
23
23
  import { useI18n } from "cozy-ui/transpiled/react/providers/I18n";
24
24
  export var NavItem = function NavItem(_ref) {
25
- var children = _ref.children,
25
+ var className = _ref.className,
26
+ children = _ref.children,
26
27
  secondary = _ref.secondary,
27
28
  restProps = _objectWithoutProperties(_ref, _excluded);
28
29
 
29
30
  return /*#__PURE__*/React.createElement("li", _extends({
30
- className: cx(styles['c-nav-item'], secondary ? styles['c-nav-item-secondary'] : null)
31
+ className: cx(styles['c-nav-item'], className, secondary ? styles['c-nav-item-secondary'] : null)
31
32
  }, restProps), children);
32
33
  };
33
34
  export var NavText = function NavText(_ref2) {
34
- var children = _ref2.children;
35
+ var className = _ref2.className,
36
+ children = _ref2.children;
35
37
  return /*#__PURE__*/React.createElement("span", {
36
- className: styles['c-nav-text']
38
+ className: cx(styles['c-nav-text'], className)
37
39
  }, children);
38
40
  };
39
41
  export var NavLink = {
@@ -67,9 +69,10 @@ export var genNavLinkForV6 = function genNavLinkForV6(RRNavLink) {
67
69
  });
68
70
  };
69
71
  export var NavIcon = function NavIcon(_ref5) {
70
- var icon = _ref5.icon;
72
+ var className = _ref5.className,
73
+ icon = _ref5.icon;
71
74
  return /*#__PURE__*/React.createElement("span", {
72
- className: cx(styles['c-nav-icon'])
75
+ className: cx(styles['c-nav-icon'], className)
73
76
  }, /*#__PURE__*/React.createElement(Icon, {
74
77
  icon: icon,
75
78
  "aria-hidden": "true",
@@ -78,11 +81,12 @@ export var NavIcon = function NavIcon(_ref5) {
78
81
  };
79
82
 
80
83
  var Nav = function Nav(_ref6) {
81
- var children = _ref6.children;
84
+ var className = _ref6.className,
85
+ children = _ref6.children;
82
86
  return /*#__PURE__*/React.createElement("nav", {
83
87
  role: "navigation"
84
88
  }, /*#__PURE__*/React.createElement("ul", {
85
- className: styles['c-nav']
89
+ className: cx(styles['c-nav'], className)
86
90
  }, children));
87
91
  };
88
92
  /**