zavadil-react-common 1.1.75 → 1.1.76

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.
@@ -0,0 +1,6 @@
1
+ import { PropsWithChildren } from "react";
2
+ export type SpreadProps = {
3
+ center?: boolean;
4
+ };
5
+ export declare function Spread({ children, center }: PropsWithChildren<SpreadProps>): import("react/jsx-runtime").JSX.Element;
6
+ export default Spread;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zavadil-react-common",
3
- "version": "1.1.75",
3
+ "version": "1.1.76",
4
4
  "description": "Common types for React Typescript UI apps.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,21 @@
1
+ import {PropsWithChildren, useMemo} from "react";
2
+
3
+ export type SpreadProps = {
4
+ center?: boolean;
5
+ };
6
+
7
+ export function Spread({children, center}: PropsWithChildren<SpreadProps>) {
8
+ const css = useMemo(
9
+ () => center === false ? '' : 'd-flex align-items-center justify-content-center',
10
+ [center]
11
+ );
12
+
13
+ return <div
14
+ className={`w-100 h-100 position-absolute ${css}`}
15
+ style={{left: 0, right: 0, top: 0, bottom: 0}}
16
+ >
17
+ {children}
18
+ </div>
19
+ }
20
+
21
+ export default Spread;