Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/sudhanshutech/sistent int…
Browse files Browse the repository at this point in the history
…o toolbar-customSearch
  • Loading branch information
sudhanshutech committed Oct 11, 2023
2 parents aeb064f + d9e90a7 commit b6316b6
Show file tree
Hide file tree
Showing 21 changed files with 766 additions and 36 deletions.
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name-template: 'v$NEXT_PATCH_VERSION'
name-template: 'Sistent v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: '🚀 Features'
Expand All @@ -22,4 +22,4 @@ template: |
## Contributors
Thank you to our contributors for making this release possible:
$CONTRIBUTORS
$CONTRIBUTORS
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Publish NPM Package

on:
release:
types: [closed]
types: [published]
branches:
- 'v-*'
- master
Expand Down Expand Up @@ -35,7 +35,7 @@ jobs:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
contents: write
packages: write
steps:
- name: Checkout Repo
Expand All @@ -56,16 +56,19 @@ jobs:
- name: Publish to npm
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
- run: npm publish --verbose
if [ ${{ github.base_ref }} = development ]; then
npx lerna version --no-private --conventional-commits --conventional-prerelease --preid beta --yes
else
npx lerna version --no-private --conventional-commits --conventional-graduate --yes
fi
# git config user.name "${{ github.actor }}"
# git config user.email "${{ github.actor}}@users.noreply.github.com"
# if [ ${{ github.base_ref }} = development ]; then
# HUSKY=0 npx lerna version --no-private --conventional-commits --conventional-prerelease --preid beta --yes
# else
# HUSKY=0 npx lerna version --no-private --conventional-commits --yes
# fi
npx lerna publish from-git --yes
# HUSKY=0 npx lerna publish from-git --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

exec < /dev/tty && cz --hook || true
if [ "$2" != "message" ];then
exec < /dev/tty && cz --hook "$1" "$2" "$3" || true
fi
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

The Sistent Design System from Layer5 provides the open source building blocks to design and implement consistent, accessible, and delightful product experiences.


### Packages

Design System components in React, usually built with Vite.
Expand All @@ -20,6 +21,13 @@ List of npm packages:

- Design System components in React.js

### Prerequisites

Before you begin, ensure you have the following installed on your system:

- Node.js
- Yarn

### How to get started

Use `corepack enable` to go ahead and install yarn.
Expand All @@ -29,6 +37,34 @@ Use `corepack enable` to go ahead and install yarn.

<div>&nbsp;</div>


### Installation

To set up the project, run the following command to install dependencies:

```
setup:
yarn install
```
To build the project, you can use the following command:
```
build: install
yarn run build-all
```

To check if your code meets the formatting standards, you can run:
```
format-check:
yarn run format:check
```

To automatically fix formatting issues, you can run
```
format-fix:
yarn run format:write
```


## Join the Layer5 community!

<a name="contributing"></a><a name="community"></a>
Expand Down
38 changes: 38 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 0.5.0 (2023-10-08)

### Bug Fixes

- added type def package mui-datatables ([#149](https://github.com/layer5io/sistent/issues/149)) ([756b363](https://github.com/layer5io/sistent/commit/756b363959fe3413a31adcba5ef9d60095ddb207))
- Moved deps to devDeps, and allow them to be peers ([704c432](https://github.com/layer5io/sistent/commit/704c4323afe4710cb54b5aac6b9c079c3e0fbe89))
- update Button to use MUI props ([7331fb8](https://github.com/layer5io/sistent/commit/7331fb88d336722c5993d6c5f2cbc99c6386c48d))

### Features

- add remaining MUI components ([a9ba156](https://github.com/layer5io/sistent/commit/a9ba1568289a65a0b7f666fed6a0c372c99fe4ac))
- Attempt to clean up ([fe8df9d](https://github.com/layer5io/sistent/commit/fe8df9da768c243583b93027e96f706a5fc7ef5a))
- **components:** added ClickAwayListener ([#124](https://github.com/layer5io/sistent/issues/124)) ([db1a133](https://github.com/layer5io/sistent/commit/db1a133cf95bbce5c1d5aee060771697d09ca060)), closes [#123](https://github.com/layer5io/sistent/issues/123)
- **data-tables:** add tables package ([711cd98](https://github.com/layer5io/sistent/commit/711cd98453d85d25442a1cbe4a5bb4d4152a19e6))
- Update react-error-boundary and define type definitions ([d75c0e4](https://github.com/layer5io/sistent/commit/d75c0e44af6aa68598d632d45eac6422d0ffdab5))
- Updated Button to allow a label and also take in children ([0c25592](https://github.com/layer5io/sistent/commit/0c25592611f22789fd1695acf92985ff9e86d910))

# 0.4.0 (2023-10-08)

### Bug Fixes

- added type def package mui-datatables ([#149](https://github.com/layer5io/sistent/issues/149)) ([756b363](https://github.com/layer5io/sistent/commit/756b363959fe3413a31adcba5ef9d60095ddb207))
- Moved deps to devDeps, and allow them to be peers ([704c432](https://github.com/layer5io/sistent/commit/704c4323afe4710cb54b5aac6b9c079c3e0fbe89))
- update Button to use MUI props ([7331fb8](https://github.com/layer5io/sistent/commit/7331fb88d336722c5993d6c5f2cbc99c6386c48d))

### Features

- add remaining MUI components ([a9ba156](https://github.com/layer5io/sistent/commit/a9ba1568289a65a0b7f666fed6a0c372c99fe4ac))
- Attempt to clean up ([fe8df9d](https://github.com/layer5io/sistent/commit/fe8df9da768c243583b93027e96f706a5fc7ef5a))
- **components:** added ClickAwayListener ([#124](https://github.com/layer5io/sistent/issues/124)) ([db1a133](https://github.com/layer5io/sistent/commit/db1a133cf95bbce5c1d5aee060771697d09ca060)), closes [#123](https://github.com/layer5io/sistent/issues/123)
- **data-tables:** add tables package ([711cd98](https://github.com/layer5io/sistent/commit/711cd98453d85d25442a1cbe4a5bb4d4152a19e6))
- Update react-error-boundary and define type definitions ([d75c0e4](https://github.com/layer5io/sistent/commit/d75c0e44af6aa68598d632d45eac6422d0ffdab5))
- Updated Button to allow a label and also take in children ([0c25592](https://github.com/layer5io/sistent/commit/0c25592611f22789fd1695acf92985ff9e86d910))
13 changes: 9 additions & 4 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layer5/sistent-components",
"version": "0.3.0",
"version": "0.5.0",
"description": "Reusable React Components",
"main": "dist/index.umd.js",
"module": "dist/index.mjs",
Expand All @@ -14,18 +14,19 @@
"lint": "eslint .",
"lint:fix": "eslint --fix"
},
"dependencies": {
"@layer5/sistent-svg": "0.6.6"
},
"devDependencies": {
"@layer5/sistent-svg": "workspace:^",
"@mui/icons-material": "^5.14.12",
"@mui/material": "^5.14.10",
"@types/mui-datatables": "^4.3.6",
"@types/react": "^18.2.15",
"@types/react-dom": "^18.2.7",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@vitejs/plugin-react-swc": "^3.3.2",
"eslint": "^8.45.0",
"eslint-plugin-react": "^7.33.2",
"mui-datatables": "^4.3.0",
"react-error-boundary": "^4.0.11",
"typescript": "^5.0.2",
"vite": "^4.4.5",
Expand All @@ -36,6 +37,7 @@
"@emotion/react": "*",
"@emotion/styled": "*",
"@mui/material": "*",
"mui-datables": "*",
"react": "*",
"react-dom": "*"
},
Expand All @@ -49,6 +51,9 @@
"@mui/material": {
"optional": true
},
"mui-datables": {
"optional": true
},
"react": {
"optional": true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {
ClickAwayListener as MuiClickAwayListener,
type ClickAwayListenerProps
} from '@mui/material';
export function ClickAwayListener(props: ClickAwayListenerProps) {
return <MuiClickAwayListener {...props} />;
}
1 change: 1 addition & 0 deletions packages/components/src/base/ClickAwayListener/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ClickAwayListener } from './ClickAwayListener';
5 changes: 5 additions & 0 deletions packages/components/src/base/DataTable/datatable.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { MUIDataTable, type MUIDataTableProps } from 'mui-datatables';

export const DataTable = (props: MUIDataTableProps) => {
return <MUIDataTable {...props} />;
};
1 change: 1 addition & 0 deletions packages/components/src/base/DataTable/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { DataTable } from './datatable';
Empty file.
1 change: 1 addition & 0 deletions packages/components/src/custom/Helpers/Dimension/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { useWindowDimensions } from './windowSize';
56 changes: 56 additions & 0 deletions packages/components/src/custom/Helpers/Dimension/windowSize.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { useEffect, useState } from 'react';

/**
* Returns the width and height of the window.
*
* @returns {WindowDimensions} { width, height }
*/
function getWindowDimensions(): WindowDimensions {
const { innerWidth: width, innerHeight: height } = window;
return {
width,
height
};
}

/**
* Custom hook for getting window dimensions.
*
* @returns {WindowDimensions} { width, height }
*/
export function useWindowDimensions(): WindowDimensions {
const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions());

useEffect(() => {
let resizeTimeout: number;

function handleResize() {
if (resizeTimeout) {
clearTimeout(resizeTimeout);
}
resizeTimeout = window.setTimeout(() => {
setWindowDimensions(getWindowDimensions());
}, 500);
}

window.addEventListener('resize', handleResize);

// Clean up the event listener on unmount
return () => {
window.removeEventListener('resize', handleResize);
if (resizeTimeout) {
clearTimeout(resizeTimeout);
}
};
}, []);

return windowDimensions;
}

/**
* Represents the width and height of the window.
*/
interface WindowDimensions {
width: number;
height: number;
}
29 changes: 29 additions & 0 deletions packages/components/src/custom/Helpers/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Helper Components

This directory contains a collection of utility and helper components that you can use across your project. These components are designed to simplify common tasks, enhance reusability, and improve code organization.

## Table of Contents

- [Available Helper Components](#available-helper-components)
- [How to Use](#how-to-use)
- [Examples](#examples)

## Available Helper Components

1. **Window Dimensions Hook**: A custom React hook for tracking changes in window dimensions.

- **File**: `Dimension`
- **Usage**: Provides the `useWindowDimensions` hook, which allows you to get the current window dimensions and react to changes in window size.
- **Returns**: An object containing the current window dimensions and a boolean value indicating whether the window is currently in landscape mode.

## How to Use

To use these helper components in your project, follow these steps:

1. Navigate to the specific helper component directory (e.g., `dimension.ts`) to find details about its usage.

2. Import the required helper component into your code:

```javascript
import { useWindowDimensions } from './helpers';
```
1 change: 1 addition & 0 deletions packages/components/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export * from './base/Button';
export * from './base/Card';
export * from './base/Checkbox';
export * from './base/Chip';
export * from './base/DataTable';
export * from './base/Dialog';
export * from './base/Divider';
export * from './base/Drawer';
Expand Down
3 changes: 2 additions & 1 deletion packages/components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ export default defineConfig({
react: 'React',
'@mui/material': 'material',
'react/jsx-runtime': 'jsxRuntime',
'react-error-boundary': 'reactErrorBoundary'
'react-error-boundary': 'reactErrorBoundary',
'mui-datatables': 'muiDatatables'
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions packages/rtk-query-codegen/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 0.2.0 (2023-10-08)

### Features

- (wip) update rtk-query-codegen for reference ([19f2267](https://github.com/layer5io/sistent/commit/19f226748409ffea6354055e02650ff4ef4266c4))
- Attempt to clean up ([fe8df9d](https://github.com/layer5io/sistent/commit/fe8df9da768c243583b93027e96f706a5fc7ef5a))

# 0.1.0 (2023-10-08)

### Features

- (wip) update rtk-query-codegen for reference ([19f2267](https://github.com/layer5io/sistent/commit/19f226748409ffea6354055e02650ff4ef4266c4))
- Attempt to clean up ([fe8df9d](https://github.com/layer5io/sistent/commit/fe8df9da768c243583b93027e96f706a5fc7ef5a))
2 changes: 1 addition & 1 deletion packages/rtk-query-codegen/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layer5/rtk-query-codegen",
"version": "0.0.1",
"version": "0.2.0",
"description": "Codegen to create rtk-query api from openapi schema",
"license": "ISC",
"author": "",
Expand Down
16 changes: 16 additions & 0 deletions packages/svg/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# 0.8.0 (2023-10-08)

### Features

- Grouped Fullscreen icons ([cdb3bb8](https://github.com/layer5io/sistent/commit/cdb3bb83bc8962543271d69395a5ae9bffbd4045))

# 0.7.0 (2023-10-08)

### Features

- Grouped Fullscreen icons ([cdb3bb8](https://github.com/layer5io/sistent/commit/cdb3bb83bc8962543271d69395a5ae9bffbd4045))
2 changes: 1 addition & 1 deletion packages/svg/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@layer5/sistent-svg",
"version": "0.6.6",
"version": "0.8.0",
"description": "SVG Icons library",
"type": "module",
"main": "./dist/index.js",
Expand Down
Loading

0 comments on commit b6316b6

Please sign in to comment.