Skip to content

Commit

Permalink
feat: styled stepper
Browse files Browse the repository at this point in the history
Signed-off-by: aabidsofi19 <[email protected]>
  • Loading branch information
aabidsofi19 committed Apr 13, 2024
1 parent 7d9d4a2 commit 7ed6b7b
Show file tree
Hide file tree
Showing 5 changed files with 314 additions and 106 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ package-setup:
package-build: setup
npm run build

package-build-watch: setup
npm run build:watch

package-format-check:
npm run format:check

Expand All @@ -26,4 +29,4 @@ version-minor:

# Create a major versio of packages
version-major:
npm run versionup:major
npm run versionup:major
191 changes: 96 additions & 95 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,103 +1,104 @@
{
"name": "@layer5/sistent",
"version": "0.14.11",
"description": "Reusable React Components and SVG Icons library",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/layer5io/sistent.git"
},
"main": "./dist/index.js",
"module": "./dist/index..js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "NODE_ENV=production tsup",
"commitlint": "commitlint --edit",
"coverage": "jest --coverage",
"dev": "NODE_ENV=development tsup",
"format:check": "prettier --check \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
"format:write": "prettier --write \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
"prepare": "husky install",
"test": "jest",
"versionup:major": "npm version major",
"versionup:minor": "npm version minor",
"versionup:patch": "npm version patch"
},
"lint-staged": {
"*.{ts,tsx,md}": [
"prettier --write",
"eslint --fix"
]
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"devDependencies": {
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@mui/icons-material": "^5.15.11",
"@testing-library/react": "^14.1.2",
"@types/jest": "^29.5.11",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.49.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"eslint-plugin-storybook": "^0.6.15",
"husky": "^8.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^14.0.1",
"mui-datatables": "^4.3.0",
"notistack": "^3.0.1",
"prettier": "^3.0.3",
"prettier-plugin-organize-imports": "^3.2.3",
"react-error-boundary": "^4.0.12",
"ts-jest": "^29.1.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
},
"peerDependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.15.11",
"@types/mui-datatables": "*",
"mui-datatables": "*",
"react": ">=17",
"react-dom": ">=17"
},
"peerDependenciesMeta": {
"@emotion/react": {
"optional": true
"name": "@layer5/sistent",
"version": "0.14.11",
"description": "Reusable React Components and SVG Icons library",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/layer5io/sistent.git"
},
"main": "./dist/index.js",
"module": "./dist/index..js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "NODE_ENV=production tsup",
"build:watch": "NODE_ENV=production tsup --watch",
"commitlint": "commitlint --edit",
"coverage": "jest --coverage",
"dev": "NODE_ENV=development tsup",
"format:check": "prettier --check \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
"format:write": "prettier --write \"**/*.{ts,tsx,md}\" --config ./.prettierrc",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0 --fix",
"prepare": "husky install",
"test": "jest",
"versionup:major": "npm version major",
"versionup:minor": "npm version minor",
"versionup:patch": "npm version patch"
},
"lint-staged": {
"*.{ts,tsx,md}": [
"prettier --write",
"eslint --fix"
]
},
"@emotion/styled": {
"optional": true
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"@mui/material": {
"optional": true
"devDependencies": {
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@mui/icons-material": "^5.15.11",
"@testing-library/react": "^14.1.2",
"@types/jest": "^29.5.11",
"@types/react": "^18.2.45",
"@types/react-dom": "^18.2.18",
"@typescript-eslint/eslint-plugin": "^6.12.0",
"@typescript-eslint/parser": "^6.12.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^8.49.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.4",
"eslint-plugin-storybook": "^0.6.15",
"husky": "^8.0.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^14.0.1",
"mui-datatables": "^4.3.0",
"notistack": "^3.0.1",
"prettier": "^3.0.3",
"prettier-plugin-organize-imports": "^3.2.3",
"react-error-boundary": "^4.0.12",
"ts-jest": "^29.1.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
},
"mui-datatables": {
"optional": true
"peerDependencies": {
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.15.11",
"@types/mui-datatables": "*",
"mui-datatables": "*",
"react": ">=17",
"react-dom": ">=17"
},
"react": {
"optional": true
"peerDependenciesMeta": {
"@emotion/react": {
"optional": true
},
"@emotion/styled": {
"optional": true
},
"@mui/material": {
"optional": true
},
"mui-datatables": {
"optional": true
},
"react": {
"optional": true
},
"react-dom": {
"optional": true
}
},
"react-dom": {
"optional": true
"publishConfig": {
"access": "public"
}
},
"publishConfig": {
"access": "public"
}
}
44 changes: 35 additions & 9 deletions src/custom/Modal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Dialog, DialogProps, IconButton, Typography, styled } from '@mui/material';
import React, { useRef, useState } from 'react';
import { Button, Paper } from '../../base';
import { iconLarge } from '../../constants/iconsSizes';
import { CloseIcon, InfoIcon } from '../../icons';

Expand Down Expand Up @@ -64,17 +65,12 @@ export const useModal = ({ headerIcon }: { headerIcon: React.ReactNode }) => {
const CloseBtn = styled(IconButton)`
&& {
transform: rotate(-90deg);
color: #ffffff;
&:hover {
transform: rotate(90deg);
transition: all 0.3s ease-in;
cursor: pointer;
}
& svg {
fill: #fff;
}
}
`;

Expand Down Expand Up @@ -132,9 +128,10 @@ export const Modal: React.FC<ModalProps> = ({
);
};

export const ModalBody = styled('div')`
padding: 1rem;
`;
export const ModalBody = styled(Paper)(({ theme }) => ({
padding: '1rem',
backgroundColor: theme.palette.background.default
}));

interface ModalFooterProps {
children: React.ReactNode;
Expand All @@ -152,8 +149,37 @@ const StyledFooter = styled('div')({
export const ModalFooter: React.FC<ModalFooterProps> = ({ children }) => {
return (
<StyledFooter>
<InfoIcon {...iconLarge} fill="#2196F3" />
<InfoIcon {...iconLarge} fill="#fff" />
<div>{children}</div>
</StyledFooter>
);
};

// ModalButtonPrimary
export const ModalButtonPrimary = styled(({ ...otherProps }) => (
<Button variant="contained" {...otherProps} />
))(({ theme }) => ({
backgroundColor: theme.palette.background.brand?.default,
color: theme.palette.text.inverse
}));

// ModalButtonSecondary
export const ModalButtonSecondary = styled(({ ...otherProps }) => (
<Button variant="outlined" {...otherProps} />
))(({ theme }) => ({
'&.MuiButton-outlined': {
border: `1px solid ${theme.palette.common.white}`,
color: theme.palette.common?.white,
'&:hover': {
background: 'transparent',
color: theme.palette.common?.white
}
}
}));

// ModalButtonTertiary
export const ModalButtonTertiary = styled(({ ...otherProps }) => (
<Button variant="text" {...otherProps} />
))(({ theme }) => ({
color: theme.palette.text.inverse
}));
Loading

0 comments on commit 7ed6b7b

Please sign in to comment.