caplink-saas-ui-shared-component-library 0.4.4 → 0.4.6
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 +78 -78
- package/dist/components/dag/ui/dag-container.d.ts +2 -0
- package/dist/components/dag/ui/dag-sidebar/dag-sidebar-header.d.ts +5 -0
- package/dist/components/dag/ui/dag-sidebar/dag-sidebar.d.ts +8 -0
- package/dist/components/dag/ui/dag-sidebar/index.d.ts +5 -0
- package/dist/components/dag/ui/dag.d.ts +7 -0
- package/dist/components/dag/ui/defaults/default-edge.d.ts +3 -0
- package/dist/components/dag/ui/defaults/default-node.d.ts +7 -0
- package/dist/components/dag/ui/defaults/index.d.ts +5 -0
- package/dist/components/dag/ui/index.d.ts +5 -0
- package/dist/components/dag/ui/search-node/index.d.ts +4 -0
- package/dist/components/dag/ui/search-node/search-node.d.ts +6 -0
- package/dist/index.d.ts +12 -1
- package/dist/index.es.js +10647 -4262
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +102 -59
- package/dist/index.umd.js.map +1 -1
- package/dist/shared/ui/button.d.ts +1 -1
- package/package.json +90 -89
package/README.md
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
# caplink-saas-ui-shared-component-library
|
|
2
|
-
|
|
3
|
-
This project is a shared component library for the Caplink SaaS UI. It is built using React and Storybook.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
1. Clone the repository
|
|
8
|
-
2. Run `npm install` to install the dependencies
|
|
9
|
-
3. Run `npm run storybook` to start the Storybook server
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
To use the components in your project, you can install the package from npm:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
npm install @caplink/saas-ui-shared-component-library
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Then import the components you need:
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
import { Button } from '@caplink/saas-ui-shared-component-library';
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Development
|
|
26
|
-
|
|
27
|
-
### Components
|
|
28
|
-
|
|
29
|
-
All the components are located in the 'component-library' folder. Each component should be in its own folder, with the component file and any other files it needs (like styles, tests, etc).
|
|
30
|
-
|
|
31
|
-
An expected component development workflow would be:
|
|
32
|
-
|
|
33
|
-
1. Create a new folder for the component
|
|
34
|
-
2. Create the component file (e.g. MyComponent.js)
|
|
35
|
-
3. Create a story file (e.g. MyComponent.stories.js)
|
|
36
|
-
4. Create a test file (e.g. MyComponent.spec.js)
|
|
37
|
-
5. Create a style file (e.g. MyComponent.css) (if needed, we use tailwindcss for styles)
|
|
38
|
-
6. If it's a complex component, create a Cypress test file (e.g. MyComponent.spec.js in the 'cypress' folder)
|
|
39
|
-
|
|
40
|
-
### Folder structure
|
|
41
|
-
|
|
42
|
-
- All the components are located in the '/component-library' folder.
|
|
43
|
-
- Each component should be in its own folder, with the component file and any other files it needs (like styles, tests, etc).
|
|
44
|
-
- Cypress tests are located in the 'cypress' folder and should follow the same folder structure as the components.
|
|
45
|
-
|
|
46
|
-
### Storybook
|
|
47
|
-
|
|
48
|
-
We use Storybook to develop and test the components. To start the Storybook server, run:
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
npm run sb:dev
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npm run sb:build
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
This will start the Storybook server and open a browser window with the Storybook UI. You can use this to develop and test the components.
|
|
59
|
-
|
|
60
|
-
This is the gallery of components that we use to develop and test the components. It's also used to generate the documentation for the components, so it's important to keep it up to date and encompassing relevant states and use cases within the stories.
|
|
61
|
-
|
|
62
|
-
## Testing
|
|
63
|
-
|
|
64
|
-
We use multiple testing libraries to test our components. We use Jest for unit tests and Cypress for more complex integration tests that require a browser.
|
|
65
|
-
|
|
66
|
-
- All unit tests are located in the same folder as the component they are testing. The file name should be the same as the component file name, but with a '.spec.xxx' suffix.
|
|
67
|
-
- All Cypress tests are located in the 'cypress' folder.
|
|
68
|
-
|
|
69
|
-
## Contributing
|
|
70
|
-
|
|
71
|
-
This is a project for the Caplink SaaS UI team. If you are a member of the team, you can contribute to this project by following the standard Git workflow:
|
|
72
|
-
|
|
73
|
-
1. Create a new branch for your feature or bug fix
|
|
74
|
-
2. Make your changes
|
|
75
|
-
3. Push your branch to the remote repository
|
|
76
|
-
4. Create a pull request
|
|
77
|
-
|
|
78
|
-
Developing components with tests is a requirement for contributing to this project.
|
|
1
|
+
# caplink-saas-ui-shared-component-library
|
|
2
|
+
|
|
3
|
+
This project is a shared component library for the Caplink SaaS UI. It is built using React and Storybook.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
1. Clone the repository
|
|
8
|
+
2. Run `npm install` to install the dependencies
|
|
9
|
+
3. Run `npm run storybook` to start the Storybook server
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
To use the components in your project, you can install the package from npm:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @caplink/saas-ui-shared-component-library
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then import the components you need:
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
import { Button } from '@caplink/saas-ui-shared-component-library';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Development
|
|
26
|
+
|
|
27
|
+
### Components
|
|
28
|
+
|
|
29
|
+
All the components are located in the 'component-library' folder. Each component should be in its own folder, with the component file and any other files it needs (like styles, tests, etc).
|
|
30
|
+
|
|
31
|
+
An expected component development workflow would be:
|
|
32
|
+
|
|
33
|
+
1. Create a new folder for the component
|
|
34
|
+
2. Create the component file (e.g. MyComponent.js)
|
|
35
|
+
3. Create a story file (e.g. MyComponent.stories.js)
|
|
36
|
+
4. Create a test file (e.g. MyComponent.spec.js)
|
|
37
|
+
5. Create a style file (e.g. MyComponent.css) (if needed, we use tailwindcss for styles)
|
|
38
|
+
6. If it's a complex component, create a Cypress test file (e.g. MyComponent.spec.js in the 'cypress' folder)
|
|
39
|
+
|
|
40
|
+
### Folder structure
|
|
41
|
+
|
|
42
|
+
- All the components are located in the '/component-library' folder.
|
|
43
|
+
- Each component should be in its own folder, with the component file and any other files it needs (like styles, tests, etc).
|
|
44
|
+
- Cypress tests are located in the 'cypress' folder and should follow the same folder structure as the components.
|
|
45
|
+
|
|
46
|
+
### Storybook
|
|
47
|
+
|
|
48
|
+
We use Storybook to develop and test the components. To start the Storybook server, run:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm run sb:dev
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm run sb:build
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
This will start the Storybook server and open a browser window with the Storybook UI. You can use this to develop and test the components.
|
|
59
|
+
|
|
60
|
+
This is the gallery of components that we use to develop and test the components. It's also used to generate the documentation for the components, so it's important to keep it up to date and encompassing relevant states and use cases within the stories.
|
|
61
|
+
|
|
62
|
+
## Testing
|
|
63
|
+
|
|
64
|
+
We use multiple testing libraries to test our components. We use Jest for unit tests and Cypress for more complex integration tests that require a browser.
|
|
65
|
+
|
|
66
|
+
- All unit tests are located in the same folder as the component they are testing. The file name should be the same as the component file name, but with a '.spec.xxx' suffix.
|
|
67
|
+
- All Cypress tests are located in the 'cypress' folder.
|
|
68
|
+
|
|
69
|
+
## Contributing
|
|
70
|
+
|
|
71
|
+
This is a project for the Caplink SaaS UI team. If you are a member of the team, you can contribute to this project by following the standard Git workflow:
|
|
72
|
+
|
|
73
|
+
1. Create a new branch for your feature or bug fix
|
|
74
|
+
2. Make your changes
|
|
75
|
+
3. Push your branch to the remote repository
|
|
76
|
+
4. Create a pull request
|
|
77
|
+
|
|
78
|
+
Developing components with tests is a requirement for contributing to this project.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
|
|
3
|
+
export type DagSidebarProps = PropsWithChildren<{
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onOpen: () => void;
|
|
6
|
+
closedTitle?: string;
|
|
7
|
+
}>;
|
|
8
|
+
export declare function DagSidebar(props: DagSidebarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactFlowProps } from '@xyflow/react';
|
|
2
|
+
|
|
3
|
+
export type DagProps = {
|
|
4
|
+
initialNodes?: ReactFlowProps['nodes'];
|
|
5
|
+
initialEdges?: ReactFlowProps['edges'];
|
|
6
|
+
};
|
|
7
|
+
export declare function Dag(props: DagProps & Omit<ReactFlowProps, 'nodes' | 'edges'>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { NodeProps, Node } from '@xyflow/react';
|
|
2
|
+
|
|
3
|
+
export type NodeDataProps = {
|
|
4
|
+
content: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
} & Record<string, unknown>;
|
|
7
|
+
export declare function DefaultNode({ id, data }: NodeProps<Node<NodeDataProps>>): import("react/jsx-runtime").JSX.Element;
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,22 @@ import { Spreadsheet } from './components/spreadsheet/ui';
|
|
|
2
2
|
import { FileUploader, FileUploaderProps } from './components/file-uploader/ui';
|
|
3
3
|
import { ImageUploader, ImageUploaderProps } from './components/image-uploader/ui';
|
|
4
4
|
import { MatrixTypes, SpreadsheetTypes } from './types';
|
|
5
|
+
import { Dag, DagContainer, DagProps } from './components/dag/ui';
|
|
6
|
+
import { DagSidebar, DagSidebarHeader, DagSidebarHeaderProps, DagSidebarProps } from './components/dag/ui/dag-sidebar';
|
|
7
|
+
import { DefaultEdge, DefaultNode, NodeDataProps } from './components/dag/ui/defaults';
|
|
8
|
+
import { SearchNode, SearchNodeProps } from './components/dag/ui/search-node';
|
|
5
9
|
|
|
6
10
|
export declare const CapLink: {
|
|
7
11
|
Spreadsheet: typeof Spreadsheet;
|
|
8
12
|
FileUploader: typeof FileUploader;
|
|
9
13
|
WithPortalProvider: ({ children }: import('./components/spreadsheet/lib/with-portal-provider').IWithPortalProvider) => import("react/jsx-runtime").JSX.Element;
|
|
10
14
|
ImageUploader: typeof ImageUploader;
|
|
15
|
+
Dag: typeof Dag;
|
|
16
|
+
DagContainer: typeof DagContainer;
|
|
17
|
+
DagSidebar: typeof DagSidebar;
|
|
18
|
+
DagSidebarHeader: typeof DagSidebarHeader;
|
|
19
|
+
DefaultNode: typeof DefaultNode;
|
|
20
|
+
DefaultEdge: typeof DefaultEdge;
|
|
21
|
+
SearchNode: typeof SearchNode;
|
|
11
22
|
};
|
|
12
|
-
export type { FileUploaderProps, ImageUploaderProps, MatrixTypes, SpreadsheetTypes };
|
|
23
|
+
export type { FileUploaderProps, ImageUploaderProps, MatrixTypes, SpreadsheetTypes, DagProps, DagSidebarHeaderProps, DagSidebarProps, NodeDataProps, SearchNodeProps };
|