cozy-ui 126.1.0 → 126.3.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 +19 -0
- package/package.json +1 -1
- package/react/ActionsMenu/index.jsx +1 -1
- package/react/Fab/ExtendableFab.jsx +23 -22
- package/react/deprecated/Table/index.jsx +28 -36
- package/stylus/cozy-ui/build.styl +1 -0
- package/transpiled/react/ActionsMenu/index.js +1 -1
- package/transpiled/react/Fab/ExtendableFab.d.ts +2 -8
- package/transpiled/react/Fab/ExtendableFab.js +5 -5
- package/transpiled/react/deprecated/Table/index.js +30 -36
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [126.3.0](https://github.com/cozy/cozy-ui/compare/v126.2.0...v126.3.0) (2025-06-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **ExtendableFab:** Forward ref in ExtendableFab component ([86e0b93](https://github.com/cozy/cozy-ui/commit/86e0b93))
|
|
7
|
+
|
|
8
|
+
# [126.2.0](https://github.com/cozy/cozy-ui/compare/v126.1.0...v126.2.0) (2025-06-16)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **Table:** Remove warning when using `ref` ([d81f9cb](https://github.com/cozy/cozy-ui/commit/d81f9cb))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* **ActionMenu:** Using `ref` is now optional ([e9f951f](https://github.com/cozy/cozy-ui/commit/e9f951f))
|
|
19
|
+
|
|
1
20
|
# [126.1.0](https://github.com/cozy/cozy-ui/compare/v126.0.0...v126.1.0) (2025-06-13)
|
|
2
21
|
|
|
3
22
|
|
package/package.json
CHANGED
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { forwardRef } from 'react'
|
|
2
2
|
|
|
3
3
|
import Fab from '.'
|
|
4
4
|
import Icon from '../Icon'
|
|
5
5
|
import useScroll from '../hooks/useScroll'
|
|
6
6
|
|
|
7
|
-
const ExtendableFab = (
|
|
8
|
-
label,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
topLimit = 50,
|
|
12
|
-
scrollOptions,
|
|
13
|
-
...rest
|
|
14
|
-
}) => {
|
|
15
|
-
const { scrollTop } = useScroll(follow, scrollOptions)
|
|
16
|
-
const isBelowTopLimit = scrollTop < topLimit
|
|
7
|
+
const ExtendableFab = forwardRef(
|
|
8
|
+
({ label, icon, follow, topLimit = 50, scrollOptions, ...rest }, ref) => {
|
|
9
|
+
const { scrollTop } = useScroll(follow, scrollOptions)
|
|
10
|
+
const isBelowTopLimit = scrollTop < topLimit
|
|
17
11
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
12
|
+
return (
|
|
13
|
+
<Fab
|
|
14
|
+
ref={ref}
|
|
15
|
+
aria-label={label}
|
|
16
|
+
variant={isBelowTopLimit ? 'extended' : 'circular'}
|
|
17
|
+
{...rest}
|
|
18
|
+
>
|
|
19
|
+
<Icon
|
|
20
|
+
icon={icon}
|
|
21
|
+
{...(isBelowTopLimit && { className: 'u-mr-half' })}
|
|
22
|
+
/>
|
|
23
|
+
{isBelowTopLimit && label}
|
|
24
|
+
</Fab>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
ExtendableFab.displayName = 'ExtendableFab'
|
|
29
30
|
|
|
30
31
|
export default ExtendableFab
|
|
@@ -4,66 +4,58 @@ import React from 'react'
|
|
|
4
4
|
|
|
5
5
|
import styles from './styles.styl'
|
|
6
6
|
|
|
7
|
-
export const Table = React.forwardRef((props, ref) => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return <div className={cx(styles.Table, className)} {...rest} ref={ref} />
|
|
7
|
+
export const Table = React.forwardRef(({ className, ...props }, ref) => {
|
|
8
|
+
return <div className={cx(styles.Table, className)} {...props} ref={ref} />
|
|
11
9
|
})
|
|
12
10
|
|
|
13
|
-
export const TableHead = React.forwardRef((props, ref) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
export const TableHead = React.forwardRef(({ className, ...props }, ref) => {
|
|
12
|
+
return (
|
|
13
|
+
<div className={cx(styles.TableHead, className)} {...props} ref={ref} />
|
|
14
|
+
)
|
|
17
15
|
})
|
|
18
16
|
|
|
19
|
-
export const TableBody = React.forwardRef((props, ref) => {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
export const TableBody = React.forwardRef(({ className, ...props }, ref) => {
|
|
18
|
+
return (
|
|
19
|
+
<div className={cx(styles.TableBody, className)} {...props} ref={ref} />
|
|
20
|
+
)
|
|
23
21
|
})
|
|
24
22
|
|
|
25
|
-
export const TableRow = React.forwardRef((props, ref) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return <div className={cx(styles.TableRow, className)} {...rest} ref={ref} />
|
|
23
|
+
export const TableRow = React.forwardRef(({ className, ...props }, ref) => {
|
|
24
|
+
return <div className={cx(styles.TableRow, className)} {...props} ref={ref} />
|
|
29
25
|
})
|
|
30
26
|
|
|
31
|
-
export const TableCell = React.forwardRef((props, ref) => {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
export const TableCell = React.forwardRef(({ className, ...props }, ref) => {
|
|
28
|
+
return (
|
|
29
|
+
<div className={cx(styles.TableCell, className)} {...props} ref={ref} />
|
|
30
|
+
)
|
|
35
31
|
})
|
|
36
32
|
|
|
37
|
-
export const TableHeader = React.forwardRef((props, ref) => {
|
|
38
|
-
const { className, ...rest } = props
|
|
39
|
-
|
|
33
|
+
export const TableHeader = React.forwardRef(({ className, ...props }, ref) => {
|
|
40
34
|
return (
|
|
41
|
-
<div className={cx(styles.TableHeader, className)} {...
|
|
35
|
+
<div className={cx(styles.TableHeader, className)} {...props} ref={ref} />
|
|
42
36
|
)
|
|
43
37
|
})
|
|
44
38
|
|
|
45
39
|
Table.propTypes = {
|
|
46
|
-
className: PropTypes.string
|
|
47
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
40
|
+
className: PropTypes.string
|
|
48
41
|
}
|
|
42
|
+
|
|
49
43
|
TableHead.propTypes = {
|
|
50
|
-
className: PropTypes.string
|
|
51
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
44
|
+
className: PropTypes.string
|
|
52
45
|
}
|
|
46
|
+
|
|
53
47
|
TableBody.propTypes = {
|
|
54
|
-
className: PropTypes.string
|
|
55
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
48
|
+
className: PropTypes.string
|
|
56
49
|
}
|
|
57
50
|
|
|
58
51
|
TableRow.propTypes = {
|
|
59
|
-
className: PropTypes.string
|
|
60
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
52
|
+
className: PropTypes.string
|
|
61
53
|
}
|
|
54
|
+
|
|
62
55
|
TableCell.propTypes = {
|
|
63
|
-
className: PropTypes.string
|
|
64
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
56
|
+
className: PropTypes.string
|
|
65
57
|
}
|
|
58
|
+
|
|
66
59
|
TableHeader.propTypes = {
|
|
67
|
-
className: PropTypes.string
|
|
68
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
60
|
+
className: PropTypes.string
|
|
69
61
|
}
|
|
@@ -1421,6 +1421,7 @@ Display an chip that represents complex identity
|
|
|
1421
1421
|
NB: `flex` being much more complex, it has its own set of utility classes, [see further](section-utilities.html#kssref-utilities-flexbox).
|
|
1422
1422
|
|
|
1423
1423
|
.u-dn - Display none
|
|
1424
|
+
.u-dc - Display contents
|
|
1424
1425
|
.u-di - Display inline
|
|
1425
1426
|
.u-db - Display block
|
|
1426
1427
|
.u-dib - Display inline-block
|
|
@@ -27,7 +27,7 @@ var ActionsMenu = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
27
27
|
|
|
28
28
|
var transformOrigin = useTransformOrigin(anchorOrigin);
|
|
29
29
|
return /*#__PURE__*/React.createElement(ActionsMenuWrapper, _extends({}, props, {
|
|
30
|
-
anchorEl: ref.current,
|
|
30
|
+
anchorEl: ref === null || ref === void 0 ? void 0 : ref.current,
|
|
31
31
|
getContentAnchorEl: null,
|
|
32
32
|
anchorOrigin: anchorOrigin,
|
|
33
33
|
transformOrigin: transformOrigin,
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
export default ExtendableFab;
|
|
2
|
-
declare
|
|
3
|
-
|
|
4
|
-
label: any;
|
|
5
|
-
icon: any;
|
|
6
|
-
follow: any;
|
|
7
|
-
topLimit?: number | undefined;
|
|
8
|
-
scrollOptions: any;
|
|
9
|
-
}): JSX.Element;
|
|
2
|
+
declare const ExtendableFab: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
|
|
3
|
+
import React from "react";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["label", "icon", "follow", "topLimit", "scrollOptions"];
|
|
4
|
-
import React from 'react';
|
|
4
|
+
import React, { forwardRef } from 'react';
|
|
5
5
|
import Fab from "cozy-ui/transpiled/react/Fab";
|
|
6
6
|
import Icon from "cozy-ui/transpiled/react/Icon";
|
|
7
7
|
import useScroll from "cozy-ui/transpiled/react/hooks/useScroll";
|
|
8
|
-
|
|
9
|
-
var ExtendableFab = function ExtendableFab(_ref) {
|
|
8
|
+
var ExtendableFab = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
9
|
var label = _ref.label,
|
|
11
10
|
icon = _ref.icon,
|
|
12
11
|
follow = _ref.follow,
|
|
@@ -20,6 +19,7 @@ var ExtendableFab = function ExtendableFab(_ref) {
|
|
|
20
19
|
|
|
21
20
|
var isBelowTopLimit = scrollTop < topLimit;
|
|
22
21
|
return /*#__PURE__*/React.createElement(Fab, _extends({
|
|
22
|
+
ref: ref,
|
|
23
23
|
"aria-label": label,
|
|
24
24
|
variant: isBelowTopLimit ? 'extended' : 'circular'
|
|
25
25
|
}, rest), /*#__PURE__*/React.createElement(Icon, _extends({
|
|
@@ -27,6 +27,6 @@ var ExtendableFab = function ExtendableFab(_ref) {
|
|
|
27
27
|
}, isBelowTopLimit && {
|
|
28
28
|
className: 'u-mr-half'
|
|
29
29
|
})), isBelowTopLimit && label);
|
|
30
|
-
};
|
|
31
|
-
|
|
30
|
+
});
|
|
31
|
+
ExtendableFab.displayName = 'ExtendableFab';
|
|
32
32
|
export default ExtendableFab;
|
|
@@ -17,87 +17,81 @@ var styles = {
|
|
|
17
17
|
"TableCell": "styles__TableCell___3vgVE",
|
|
18
18
|
"TableHeader": "styles__TableHeader___ERsVK"
|
|
19
19
|
};
|
|
20
|
-
export var Table = /*#__PURE__*/React.forwardRef(function (
|
|
21
|
-
var className =
|
|
22
|
-
|
|
20
|
+
export var Table = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
21
|
+
var className = _ref.className,
|
|
22
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
23
23
|
|
|
24
24
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
25
25
|
className: cx(styles.Table, className)
|
|
26
|
-
},
|
|
26
|
+
}, props, {
|
|
27
27
|
ref: ref
|
|
28
28
|
}));
|
|
29
29
|
});
|
|
30
|
-
export var TableHead = /*#__PURE__*/React.forwardRef(function (
|
|
31
|
-
var className =
|
|
32
|
-
|
|
30
|
+
export var TableHead = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
|
|
31
|
+
var className = _ref2.className,
|
|
32
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
33
33
|
|
|
34
34
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
35
35
|
className: cx(styles.TableHead, className)
|
|
36
|
-
},
|
|
36
|
+
}, props, {
|
|
37
37
|
ref: ref
|
|
38
38
|
}));
|
|
39
39
|
});
|
|
40
|
-
export var TableBody = /*#__PURE__*/React.forwardRef(function (
|
|
41
|
-
var className =
|
|
42
|
-
|
|
40
|
+
export var TableBody = /*#__PURE__*/React.forwardRef(function (_ref3, ref) {
|
|
41
|
+
var className = _ref3.className,
|
|
42
|
+
props = _objectWithoutProperties(_ref3, _excluded3);
|
|
43
43
|
|
|
44
44
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
45
45
|
className: cx(styles.TableBody, className)
|
|
46
|
-
},
|
|
46
|
+
}, props, {
|
|
47
47
|
ref: ref
|
|
48
48
|
}));
|
|
49
49
|
});
|
|
50
|
-
export var TableRow = /*#__PURE__*/React.forwardRef(function (
|
|
51
|
-
var className =
|
|
52
|
-
|
|
50
|
+
export var TableRow = /*#__PURE__*/React.forwardRef(function (_ref4, ref) {
|
|
51
|
+
var className = _ref4.className,
|
|
52
|
+
props = _objectWithoutProperties(_ref4, _excluded4);
|
|
53
53
|
|
|
54
54
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
55
55
|
className: cx(styles.TableRow, className)
|
|
56
|
-
},
|
|
56
|
+
}, props, {
|
|
57
57
|
ref: ref
|
|
58
58
|
}));
|
|
59
59
|
});
|
|
60
|
-
export var TableCell = /*#__PURE__*/React.forwardRef(function (
|
|
61
|
-
var className =
|
|
62
|
-
|
|
60
|
+
export var TableCell = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
|
|
61
|
+
var className = _ref5.className,
|
|
62
|
+
props = _objectWithoutProperties(_ref5, _excluded5);
|
|
63
63
|
|
|
64
64
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
65
65
|
className: cx(styles.TableCell, className)
|
|
66
|
-
},
|
|
66
|
+
}, props, {
|
|
67
67
|
ref: ref
|
|
68
68
|
}));
|
|
69
69
|
});
|
|
70
|
-
export var TableHeader = /*#__PURE__*/React.forwardRef(function (
|
|
71
|
-
var className =
|
|
72
|
-
|
|
70
|
+
export var TableHeader = /*#__PURE__*/React.forwardRef(function (_ref6, ref) {
|
|
71
|
+
var className = _ref6.className,
|
|
72
|
+
props = _objectWithoutProperties(_ref6, _excluded6);
|
|
73
73
|
|
|
74
74
|
return /*#__PURE__*/React.createElement("div", _extends({
|
|
75
75
|
className: cx(styles.TableHeader, className)
|
|
76
|
-
},
|
|
76
|
+
}, props, {
|
|
77
77
|
ref: ref
|
|
78
78
|
}));
|
|
79
79
|
});
|
|
80
80
|
Table.propTypes = {
|
|
81
|
-
className: PropTypes.string
|
|
82
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
81
|
+
className: PropTypes.string
|
|
83
82
|
};
|
|
84
83
|
TableHead.propTypes = {
|
|
85
|
-
className: PropTypes.string
|
|
86
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
84
|
+
className: PropTypes.string
|
|
87
85
|
};
|
|
88
86
|
TableBody.propTypes = {
|
|
89
|
-
className: PropTypes.string
|
|
90
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
87
|
+
className: PropTypes.string
|
|
91
88
|
};
|
|
92
89
|
TableRow.propTypes = {
|
|
93
|
-
className: PropTypes.string
|
|
94
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
90
|
+
className: PropTypes.string
|
|
95
91
|
};
|
|
96
92
|
TableCell.propTypes = {
|
|
97
|
-
className: PropTypes.string
|
|
98
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
93
|
+
className: PropTypes.string
|
|
99
94
|
};
|
|
100
95
|
TableHeader.propTypes = {
|
|
101
|
-
className: PropTypes.string
|
|
102
|
-
ref: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
96
|
+
className: PropTypes.string
|
|
103
97
|
};
|