@7shifts/sous-chef 3.87.2-beta.0 → 3.87.2-beta.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.
- package/dist/hooks/useBackgroundColorCheck.d.ts +15 -0
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.js +60 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +60 -5
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
type Params = {
|
|
3
|
+
ref: RefObject<HTMLElement>;
|
|
4
|
+
shouldCheck: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* This hook checks the background color of the container element
|
|
8
|
+
* and determines if it's dark or light. It climbs up the DOM tree
|
|
9
|
+
* to find the first ancestor with a non-transparent background color.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: Use this hook only when necessary, as it involves DOM access
|
|
12
|
+
* and may impact performance.
|
|
13
|
+
*/
|
|
14
|
+
export declare const useContainerBackgroundColorCheck: ({ ref, shouldCheck }: Params) => "dark" | "light" | undefined;
|
|
15
|
+
export {};
|
package/dist/index.css
CHANGED