@vrobots/storybook 0.2.7 → 0.2.8
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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
2
|
export interface ILoaderProps {
|
|
3
3
|
component?: ReactNode;
|
|
4
4
|
isLoading?: boolean;
|
|
@@ -6,4 +6,8 @@ export interface ILoaderProps {
|
|
|
6
6
|
hideBackground?: boolean;
|
|
7
7
|
children?: React.ReactNode;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const useLoader: () => {
|
|
10
|
+
isLoading: boolean;
|
|
11
|
+
setIsLoading: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
+
};
|
|
13
|
+
export declare const Loader: ({ isLoading, isFullscreen, component, hideBackground, children }: ILoaderProps) => string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box, Spinner } from "@chakra-ui/react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export const useLoader = () => {
|
|
5
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
6
|
+
return {
|
|
7
|
+
isLoading,
|
|
8
|
+
setIsLoading,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
3
11
|
export const Loader = ({ isLoading, isFullscreen, component, hideBackground, children }) => {
|
|
4
12
|
if (!!isLoading) {
|
|
5
13
|
return (_jsx(Box, { style: {
|