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 add/lint/workflow

Signed-off-by: Sudhanshu Dasgupta <[email protected]>
  • Loading branch information
sudhanshutech committed Nov 1, 2023
2 parents 51686aa + 61d3c6c commit 2db52b1
Show file tree
Hide file tree
Showing 34 changed files with 1,065 additions and 39 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,16 @@ jobs:
- name: Publish to npm
run: |
- run: npm publish --verbose
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor}}@users.noreply.github.com"
# 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
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
# HUSKY=0 npx lerna publish from-git --yes
HUSKY=0 npx lerna publish from-git --no-private --yes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ dist/**
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

packages/design-system/dist/**
lerna-debug.log
pub.sh
12 changes: 8 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
setup:
.PHONY: setup build format-check format-fix

## Install Sistent dependencies your local machine.
package-setup:
yarn install

build: install
## Build Sistent components and packages on your local machine.
package-build: setup
yarn run build-all

format-check:
package-format-check:
yarn run format:check

format-fix:
package-format-fix:
yarn run format:write
8 changes: 4 additions & 4 deletions apps/design-system/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
},
"dependencies": {
"@layer5/sistent-components": "workspace:^",
"@layer5/sistent-svg": "workspace:^",
"@mui/material": "^5.14.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
"@layer5/sistent-svg": "workspace:^"
},
"devDependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.14.15",
"@storybook/addon-essentials": "^7.4.3",
"@storybook/addon-interactions": "^7.4.3",
"@storybook/addon-links": "^7.4.3",
Expand All @@ -42,6 +40,8 @@
"eslint-plugin-storybook": "^0.6.13",
"msw": "^1.3.0",
"msw-storybook-addon": "^1.8.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"storybook": "^7.4.3",
"typescript": "^5.0.2",
"vite": "^4.4.5"
Expand Down
31 changes: 31 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,37 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [0.8.0](https://github.com/layer5io/sistent/compare/@layer5/[email protected]...@layer5/[email protected]) (2023-10-31)

### Bug Fixes

- **components:** export toolbar ([#186](https://github.com/layer5io/sistent/issues/186)) ([74c8330](https://github.com/layer5io/sistent/commit/74c83301fc9a40d7a0c36a076fb8a91c7e6ad2cc))
- correct sx properties for select and popper ([dbd37ee](https://github.com/layer5io/sistent/commit/dbd37ee4a41905f26979022cb6b21e454e2f294f))

### Features

- **customcolumn:** add column visibility ([11cd979](https://github.com/layer5io/sistent/commit/11cd9794f8de9ad5fa1a3075074cf22cc1865fbf))
- **filter:** add custom filter ([0c02847](https://github.com/layer5io/sistent/commit/0c0284794a9f46e1a45efe2a034e7201244d1505))
- incorporate changes to ErrorBoundary ([fcbbe77](https://github.com/layer5io/sistent/commit/fcbbe77e906e31720611e0e7dfcb1fe99bcbcb7f))
- **search-bar:** add custom search bar component ([088e92c](https://github.com/layer5io/sistent/commit/088e92c79eaf84da04de876dada98d198ad55f99))
- **search-bar:** fix issues ([8c0c50b](https://github.com/layer5io/sistent/commit/8c0c50bec00a4da818e8521296d17a9b0e32ddb4))
- **tooltip:** conditional tooltip ([9db1729](https://github.com/layer5io/sistent/commit/9db172934bb2437b150f8dffaca6311643d95be2))

# [0.7.0](https://github.com/layer5io/sistent/compare/@layer5/[email protected]...@layer5/[email protected]) (2023-10-30)

### Bug Fixes

- correct sx properties for select and popper ([dbd37ee](https://github.com/layer5io/sistent/commit/dbd37ee4a41905f26979022cb6b21e454e2f294f))

### Features

- **customcolumn:** add column visibility ([11cd979](https://github.com/layer5io/sistent/commit/11cd9794f8de9ad5fa1a3075074cf22cc1865fbf))
- **filter:** add custom filter ([0c02847](https://github.com/layer5io/sistent/commit/0c0284794a9f46e1a45efe2a034e7201244d1505))
- incorporate changes to ErrorBoundary ([fcbbe77](https://github.com/layer5io/sistent/commit/fcbbe77e906e31720611e0e7dfcb1fe99bcbcb7f))
- **search-bar:** add custom search bar component ([088e92c](https://github.com/layer5io/sistent/commit/088e92c79eaf84da04de876dada98d198ad55f99))
- **search-bar:** fix issues ([8c0c50b](https://github.com/layer5io/sistent/commit/8c0c50bec00a4da818e8521296d17a9b0e32ddb4))
- **tooltip:** conditional tooltip ([9db1729](https://github.com/layer5io/sistent/commit/9db172934bb2437b150f8dffaca6311643d95be2))

# 0.6.0 (2023-10-16)

### Bug Fixes
Expand Down
23 changes: 13 additions & 10 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@layer5/sistent-components",
"version": "0.6.0",
"version": "0.8.0",
"description": "Reusable React Components",
"main": "dist/index.umd.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/components/index.d.ts",
"files": [
"dist"
],
Expand All @@ -14,6 +14,8 @@
"lint:fix": "eslint --fix"
},
"devDependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@layer5/sistent-svg": "workspace:^",
"@mui/icons-material": "^5.14.12",
"@mui/material": "^5.14.10",
Expand All @@ -26,6 +28,8 @@
"eslint": "^8.45.0",
"eslint-plugin-react": "^7.33.2",
"mui-datatables": "^4.3.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-error-boundary": "^4.0.11",
"typescript": "^5.0.2",
"vite": "^4.4.5",
Expand All @@ -36,9 +40,11 @@
"@emotion/react": "*",
"@emotion/styled": "*",
"@mui/material": "*",
"@types/mui-datatables": "*",
"mui-datatables": "*",
"react": "*",
"react-dom": "*"
"react-dom": "*",
"react-error-boundary": "*"
},
"peerDependenciesMeta": {
"@emotion/react": {
Expand All @@ -55,9 +61,6 @@
},
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"publishConfig": {
Expand All @@ -70,8 +73,8 @@
"default": "./dist/index.js"
}
},
"main": "dist/index.cjs",
"main": "dist/index.mjs",
"module": "dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/components/index.d.ts"
}
}
5 changes: 5 additions & 0 deletions packages/components/src/base/Form/formcontrollabel.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { FormControlLabel as MuiFormControlLabel, type FormControlLabelProps } from '@mui/material';

export function FormControlLabel(props: FormControlLabelProps) {
return <MuiFormControlLabel {...props} />;
}
1 change: 1 addition & 0 deletions packages/components/src/base/Form/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { FormControlLabel } from './formcontrollabel';
1 change: 1 addition & 0 deletions packages/components/src/base/Menu/index.tsx
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { Menu } from './menu';
export { MenuItem } from './menuitem';
5 changes: 5 additions & 0 deletions packages/components/src/base/Menu/menuitem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { MenuItem as MuiMenuItem, type MenuItemProps } from '@mui/material';

export function MenuItem(props: MenuItemProps) {
return <MuiMenuItem {...props} />;
}
1 change: 1 addition & 0 deletions packages/components/src/base/Popper/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Popper } from './popper';
5 changes: 5 additions & 0 deletions packages/components/src/base/Popper/popper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Popper as MuiPopper, type PopperProps } from '@mui/material';

export function Popper(props: PopperProps) {
return <MuiPopper {...props} />;
}
Empty file.
10 changes: 5 additions & 5 deletions packages/components/src/custom/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from '@mui/material';
import React, { type FC } from 'react';
import React, { ErrorInfo, ReactNode, type ComponentType, type FC } from 'react';
import {
ErrorBoundaryProps,
FallbackProps,
Expand Down Expand Up @@ -41,7 +41,7 @@ const Fallback: React.ComponentType<FallbackProps> = ({ error, resetErrorBoundar
}
};

const reportError = (error: Error, info: React.ErrorInfo) => {
const reportError = (error: Error, info: ErrorInfo) => {
// This is where you'd send the error to Sentry,etc
console.log('Error Caught Inside Boundary --reportError', error, 'Info', info);
};
Expand All @@ -55,10 +55,10 @@ export const ErrorBoundary: FC<ErrorBoundaryProps> = ({ children, ...props }) =>
};
//
export const withErrorBoundary = <P extends object>(
Component: React.ComponentType<P>,
Component: ComponentType<P>,
errorHandlingProps: ErrorBoundaryProps | null
) => {
const WrappedWithErrorBoundary: React.FC<P> = (props: P) => (
const WrappedWithErrorBoundary = (props: P) => (
<ErrorBoundary {...(errorHandlingProps ? errorHandlingProps : {})}>
<Component {...props} />
</ErrorBoundary>
Expand All @@ -68,7 +68,7 @@ export const withErrorBoundary = <P extends object>(
};

interface Props {
children: React.ReactNode;
children: ReactNode;
}

export const withSuppressedErrorBoundary = <P extends object>(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { ConditionalTooltip } from './tooltip-for-desc';
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from 'react';
import { Tooltip } from '../../../base/Tooltip';

interface ConditionalTooltipProps {
value: string;
maxLength: number;
// You can add more prop types here as needed
}

export const ConditionalTooltip: React.FC<ConditionalTooltipProps> = ({
value,
maxLength,
...restProps
}) => {
return value.length > maxLength ? (
<Tooltip title={value} arrow placement="top">
<div
style={{
maxWidth: '15rem',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}}
{...restProps}
>
{`${value.slice(0, maxLength)}...`}
</div>
</Tooltip>
) : (
<div
style={{
maxWidth: '15rem',
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap'
}}
{...restProps}
>
{value}
</div>
);
};

export default ConditionalTooltip;
Loading

0 comments on commit 2db52b1

Please sign in to comment.