cozy-ui 126.2.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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
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
|
+
|
|
1
8
|
# [126.2.0](https://github.com/cozy/cozy-ui/compare/v126.1.0...v126.2.0) (2025-06-16)
|
|
2
9
|
|
|
3
10
|
|
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
|
|
@@ -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
|
|
@@ -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;
|