@oc-digital/react-component-library 1.0.1 → 1.0.5

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/README.md CHANGED
@@ -0,0 +1,51 @@
1
+ # Optimal Compliance React Component Library
2
+
3
+ React component library used in Optimal Compliance React projects
4
+
5
+ ## Installation
6
+
7
+ Use [npm](https://www.npmjs.com/) to install.
8
+
9
+ ```bash
10
+ npm install @oc-digital/react-component-library
11
+ ```
12
+
13
+ or [yarn](https://yarnpkg.com/)
14
+
15
+ ```bash
16
+ yarn add @oc-digital/react-component-library
17
+ ```
18
+
19
+ ## Peer dependencies
20
+
21
+ ```json
22
+ "react": ">=17.0.0",
23
+ "react-dom": ">=17.0.0",
24
+ "@material-ui/core": "=4.12.3",
25
+ "@fortawesome/fontawesome-svg-core": ">=1.2.36",
26
+ "@fortawesome/free-solid-svg-icons": ">=5.15.4",
27
+ "@fortawesome/react-fontawesome": ">=0.1.15"
28
+ ```
29
+
30
+ ## Usage
31
+
32
+ ```jsx
33
+ import React from "react";
34
+ import { Button } from "@oc-digital/react-component-library";
35
+
36
+ const ReactComponent = () => (
37
+ <Button onClick={() => console.log("Clicked me!")}>Click Me!</Button>
38
+ );
39
+ ```
40
+
41
+ ## Playground
42
+
43
+ Use storybook to explore components
44
+
45
+ ```bash
46
+ npm run storybook
47
+ ```
48
+
49
+ ## Building and publishing
50
+
51
+ To publish new version login using `npm login`, increment version in `package.json` and run `npm publish`. Subsequently it will build the library to `build` folder and push it's contents to the npm.
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
- import { IMaterialButtonProps } from "./Button.types";
3
- declare const MaterialButton: React.FC<IMaterialButtonProps>;
4
- export default MaterialButton;
2
+ import { IButtonProps } from "./Button.types";
3
+ declare const Button: React.FC<IButtonProps>;
4
+ export default Button;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- export interface IMaterialButtonProps {
2
+ export interface IButtonProps {
3
3
  [key: string]: any;
4
4
  loading?: boolean;
5
5
  children: React.ReactNode;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { IContentBoxProps } from "./ContentBox.types";
3
+ declare const ContentBox: React.FC<IContentBoxProps>;
4
+ export default ContentBox;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface IContentBoxProps {
3
+ children: React.ReactNode;
4
+ limitWidth?: boolean;
5
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { IContentLabelProps } from "./ContentLabel.types";
3
+ declare const ContentLabel: React.FC<IContentLabelProps>;
4
+ export default ContentLabel;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ export interface IContentLabelProps {
3
+ children: React.ReactNode;
4
+ styling?: null | string;
5
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ILoadingSpinnerProps } from "./LoadingSpinner.types";
3
+ declare const LoadingSpinner: React.FC<ILoadingSpinnerProps>;
4
+ export default LoadingSpinner;
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from "react";
2
+ export interface ILoadingSpinnerProps {
3
+ text?: ReactNode;
4
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { IStaticTableProps } from "./StaticTable.types";
3
+ declare const StaticTable: React.FC<IStaticTableProps>;
4
+ export default StaticTable;
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ export declare type cellAlignmentOptions = "centerJustify" | "leftJustify" | "rightJustify";
3
+ export declare type headerColours = {
4
+ background?: string;
5
+ border?: string;
6
+ text?: string;
7
+ };
8
+ export interface IStaticTableProps {
9
+ headers: React.ReactNode[];
10
+ headerCellAlignment?: cellAlignmentOptions[];
11
+ rows: {
12
+ onClick?: () => void;
13
+ row: React.ReactNode[];
14
+ }[] | null | undefined;
15
+ rowCellAlignment?: cellAlignmentOptions[];
16
+ rowBorderSeparation?: boolean;
17
+ styling?: string;
18
+ headerColours?: headerColours;
19
+ }
@@ -1,4 +1,5 @@
1
1
  export declare const HALF_REM = "0.5rem";
2
2
  export declare const ONE_REM = "1rem";
3
3
  export declare const ONE_AND_HALF_REM = "1.5rem";
4
+ export declare const TWO_REM = "3rem";
4
5
  export declare const THREE_REM = "3rem";
package/build/index.d.ts CHANGED
@@ -1,2 +1,6 @@
1
1
  import Button from "./Button/Button";
2
- export { Button };
2
+ import ContentLabel from "./ContentLabel/ContentLabel";
3
+ import ContentBox from "./ContentBox/ContentBox";
4
+ import StaticTable from "./StaticTable/StaticTable";
5
+ import LoadingSpinner from "./LoadingSpinner/LoadingSpinner";
6
+ export { Button, ContentLabel, ContentBox, StaticTable, LoadingSpinner };