@box/blueprint-web 7.30.3 → 7.31.1
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.
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
export declare const getUniqueId: (prefix?: string) => string;
|
|
2
|
-
export declare
|
|
2
|
+
export declare function useUniqueId(prefix: string): string;
|
|
3
|
+
export declare function useUniqueId(prefix: string, when: true): string;
|
|
4
|
+
export declare function useUniqueId(prefix: string, when: false): undefined;
|
|
5
|
+
export declare function useUniqueId(prefix: string, when?: boolean): string | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
|
|
3
|
+
/* eslint-disable no-redeclare */
|
|
3
4
|
const getUniqueId = (prefix = 'id-') => prefix + Math.random().toString(16).slice(-4);
|
|
4
|
-
|
|
5
|
+
function useUniqueId(prefix, when = true) {
|
|
5
6
|
return useMemo(() => when ? getUniqueId(prefix) : undefined, [prefix, when]);
|
|
6
|
-
}
|
|
7
|
+
}
|
|
7
8
|
|
|
8
9
|
export { getUniqueId, useUniqueId };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/blueprint-web",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.31.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-stately": "^3.31.1",
|
|
64
64
|
"tsx": "^4.16.5"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "fcbe26ca4e43cc531f46c999749ca18d2f18a773",
|
|
67
67
|
"module": "lib-esm/index.js",
|
|
68
68
|
"main": "lib-esm/index.js",
|
|
69
69
|
"exports": {
|