@lobehub/icons 5.3.0 → 5.4.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/es/hooks/useFillId.js +7 -6
- package/package.json +2 -1
package/es/hooks/useFillId.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { kebabCase } from 'es-toolkit';
|
|
2
|
-
import { useMemo } from 'react';
|
|
2
|
+
import { useId, useMemo } from 'react';
|
|
3
3
|
export var useFillId = function useFillId(namespace) {
|
|
4
|
-
var
|
|
4
|
+
var uniqueId = useId();
|
|
5
|
+
var id = "lobe-icons-".concat(kebabCase(namespace), "-").concat(uniqueId);
|
|
5
6
|
return useMemo(function () {
|
|
6
7
|
return {
|
|
7
8
|
fill: "url(#".concat(id, ")"),
|
|
@@ -10,16 +11,16 @@ export var useFillId = function useFillId(namespace) {
|
|
|
10
11
|
}, [namespace]);
|
|
11
12
|
};
|
|
12
13
|
export var useFillIds = function useFillIds(namespace, length) {
|
|
14
|
+
var uniqueId = useId();
|
|
13
15
|
return useMemo(function () {
|
|
14
|
-
|
|
16
|
+
return Array.from({
|
|
15
17
|
length: length
|
|
16
18
|
}, function (_, i) {
|
|
17
|
-
var id = "lobe-icons-".concat(kebabCase(namespace), "-
|
|
19
|
+
var id = "lobe-icons-".concat(kebabCase(namespace), "-").concat(i, "-").concat(uniqueId);
|
|
18
20
|
return {
|
|
19
21
|
fill: "url(#".concat(id, ")"),
|
|
20
22
|
id: id
|
|
21
23
|
};
|
|
22
24
|
});
|
|
23
|
-
|
|
24
|
-
}, [namespace, length]);
|
|
25
|
+
}, [namespace, length, uniqueId]);
|
|
25
26
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/icons",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Popular AI / LLM Model Brand SVG Logo and Icon Collection",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"lobehub",
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"antd-style": "^4.1.0",
|
|
34
|
+
"es-toolkit": "^1.45.1",
|
|
34
35
|
"lucide-react": "^0.469.0",
|
|
35
36
|
"polished": "^4.3.1"
|
|
36
37
|
},
|