Skip to content

Commit bf6fc75

Browse files
committed
feat: create main manager wrapper
1 parent 3477a59 commit bf6fc75

File tree

7 files changed

+89
-0
lines changed

7 files changed

+89
-0
lines changed

packages/utils/manager/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# RCK | React Manager Package
2+
3+
> :warning: **WARNING**: This component library is being updated frequently and it's currently unstable due to being in it's early stages, we advice you to use only in production environments only after version **2.0.0**.
4+
5+
This component is the main wrapper of your application when using the components of this library. It will provide theme context to the components and also manage visual layers.
6+
7+
### Installation
8+
9+
To integrate the this component into your React apps, you can install it using npm or yarn: `npm i --save @react-ck/manager` or `yarn add @react-ck/manager`.
10+
11+
Wrap your app root with the manager provider to properly use the components:
12+
13+
```tsx
14+
import { ManagerProvider } from "@react-ck/manager";
15+
import { Button } from "@react-ck/button";
16+
17+
const myApp = () => (
18+
<Manager>
19+
Your app
20+
<Button ... />
21+
</Manager>
22+
);
23+
```
24+
25+
<!-- storybook-ignore -->
26+
27+
---
28+
29+
Check the documentation website - [react-ck.js.org](https://react-ck.js.org).

packages/utils/manager/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Hack for module resolution of non built packages
2+
export * from "./src/index";
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "@react-ck/manager",
3+
"private": false,
4+
"version": "1.0.0",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
7+
"files": [
8+
"/dist"
9+
],
10+
"homepage": "https://github.com/abelflopes/react-ck/tree/master/packages/utils/manager#readme",
11+
"repository": {
12+
"type": "git",
13+
"url": "git+https://github.com/abelflopes/react-ck.git"
14+
},
15+
"scripts": {
16+
"build": "NODE_ENV=production webpack",
17+
"clean": "rm -rf dist"
18+
},
19+
"devDependencies": {
20+
"@react-ck/typescript-config": "^1.0.0",
21+
"@react-ck/webpack-config": "^1.0.0",
22+
"@types/react": "^18.2.33"
23+
},
24+
"peerDependencies": {
25+
"react": "^18.2.0"
26+
},
27+
"dependencies": {
28+
"@react-ck/theme": "^1.4.0"
29+
}
30+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React from "react";
2+
import { ThemeProvider, type ThemeProviderProps } from "@react-ck/theme";
3+
4+
export interface ManagerProps {
5+
theme?: Omit<ThemeProviderProps, "children">;
6+
children: React.ReactNode;
7+
}
8+
9+
export const Manager = ({ theme, children }: Readonly<ManagerProps>): React.ReactElement => (
10+
<ThemeProvider {...theme}>{children}</ThemeProvider>
11+
);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "@react-ck/typescript-config/tsconfig.build.json",
3+
"compilerOptions": {
4+
"outDir": "./dist"
5+
},
6+
"include": ["./*.d.ts", "./src/**/*", "./src/index.ts*"]
7+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "@react-ck/typescript-config/tsconfig.json",
3+
"include": ["./**/*"]
4+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { getWebpackConfig } from "@react-ck/webpack-config";
2+
import packageJson from "./package.json";
3+
4+
export default getWebpackConfig({
5+
cssHashSalt: packageJson.name,
6+
});

0 commit comments

Comments
 (0)