@grantbii/design-system 1.0.60 → 1.0.61
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,6 +1,10 @@
|
|
|
1
1
|
import { LoaderSizeProps } from "react-spinners/helpers/props";
|
|
2
|
+
type PageLoaderProps = {
|
|
3
|
+
pageWidth?: string;
|
|
4
|
+
pageHeight?: string;
|
|
5
|
+
} & LoaderSizeProps;
|
|
2
6
|
/**
|
|
3
7
|
* The animation to show when loading the whole page
|
|
4
8
|
*/
|
|
5
|
-
declare const PageLoader: ({ color, size, ...restOfProps }:
|
|
9
|
+
declare const PageLoader: ({ pageWidth, pageHeight, color, size, ...restOfProps }: PageLoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
10
|
export default PageLoader;
|
package/core/atoms/PageLoader.js
CHANGED
|
@@ -17,10 +17,15 @@ import { Colors } from "../foundations";
|
|
|
17
17
|
* The animation to show when loading the whole page
|
|
18
18
|
*/
|
|
19
19
|
const PageLoader = (_a) => {
|
|
20
|
-
var { color = Colors.accent.blue1, size = 32 } = _a, restOfProps = __rest(_a, ["color", "size"]);
|
|
21
|
-
return (_jsx(
|
|
20
|
+
var { pageWidth, pageHeight, color = Colors.accent.blue1, size = 32 } = _a, restOfProps = __rest(_a, ["pageWidth", "pageHeight", "color", "size"]);
|
|
21
|
+
return (_jsx(Background, { "$pageWidth": pageWidth, "$pageHeight": pageHeight, children: _jsx(MoonLoader, Object.assign({ color: color, size: size }, restOfProps)) }));
|
|
22
22
|
};
|
|
23
23
|
export default PageLoader;
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
const Background = styled.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
|
|
29
|
+
width: ${({ $pageWidth = "100%" }) => $pageWidth};
|
|
30
|
+
height: ${({ $pageHeight = "100%" }) => $pageHeight};
|
|
26
31
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PageLoader } from "@/.";
|
|
2
1
|
import { Meta, StoryObj } from "@storybook/nextjs-vite";
|
|
3
|
-
declare const
|
|
2
|
+
declare const PageLoaderExample: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare const meta: Meta<typeof PageLoaderExample>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof meta>;
|
|
6
6
|
export declare const Default: Story;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
2
|
import { PageLoader } from "@/.";
|
|
3
|
+
import styled from "styled-components";
|
|
4
|
+
const PageLoaderExample = () => (_jsx(BaseExample, { children: _jsx(PageLoader, {}) }));
|
|
5
|
+
const BaseExample = styled.div `
|
|
6
|
+
width: 100vw;
|
|
7
|
+
height: 100vh;
|
|
8
|
+
`;
|
|
2
9
|
const meta = {
|
|
3
10
|
title: "Atoms/Page Loader",
|
|
4
|
-
component:
|
|
11
|
+
component: PageLoaderExample,
|
|
5
12
|
tags: ["autodocs"],
|
|
6
13
|
parameters: {
|
|
7
|
-
layout: "
|
|
14
|
+
layout: "fullscreen",
|
|
8
15
|
},
|
|
9
16
|
};
|
|
10
17
|
export default meta;
|