@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 +51 -0
- package/build/Button/Button.d.ts +3 -3
- package/build/Button/Button.types.d.ts +1 -1
- package/build/ContentBox/ContentBox.d.ts +4 -0
- package/build/ContentBox/ContentBox.types.d.ts +5 -0
- package/build/ContentLabel/ContentLabel.d.ts +4 -0
- package/build/ContentLabel/ContentLabel.types.d.ts +5 -0
- package/build/LoadingSpinner/LoadingSpinner.d.ts +4 -0
- package/build/LoadingSpinner/LoadingSpinner.types.d.ts +4 -0
- package/build/StaticTable/StaticTable.d.ts +4 -0
- package/build/StaticTable/StaticTable.types.d.ts +19 -0
- package/build/globals/index.d.ts +1 -0
- package/build/index.d.ts +5 -1
- package/build/index.js +15 -2713
- package/build/index.js.map +1 -1
- package/build/styles/font.d.ts +1 -0
- package/build/styles/index.d.ts +2 -0
- package/build/styles/layout.d.ts +1 -0
- package/package.json +18 -4
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.
|
package/build/Button/Button.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
declare const
|
|
4
|
-
export default
|
|
2
|
+
import { IButtonProps } from "./Button.types";
|
|
3
|
+
declare const Button: React.FC<IButtonProps>;
|
|
4
|
+
export default Button;
|
|
@@ -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
|
+
}
|
package/build/globals/index.d.ts
CHANGED
package/build/index.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import Button from "./Button/Button";
|
|
2
|
-
|
|
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 };
|