@zimyo/ui 1.1.0 → 1.1.2

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.
@@ -0,0 +1,137 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { createTheme, ThemeProvider } from '@mui/material/styles';
3
+ import { CssBaseline } from '@mui/material';
4
+
5
+ const designTokens = {
6
+ colors: {
7
+ primary: {
8
+ 50: '#e3f2fd',
9
+ 100: '#bbdefb',
10
+ 500: '#2196f3',
11
+ 900: '#0d47a1',
12
+ },
13
+ secondary: {
14
+ 50: '#fce4ec',
15
+ 100: '#f8bbd9',
16
+ 500: '#e91e63',
17
+ 900: '#880e4f',
18
+ },
19
+ neutral: {
20
+ 50: '#fafafa',
21
+ 100: '#f5f5f5',
22
+ 200: '#eeeeee',
23
+ 500: '#9e9e9e',
24
+ 900: '#212121',
25
+ },
26
+ },
27
+ spacing: {
28
+ xs: '4px',
29
+ sm: '8px',
30
+ md: '16px',
31
+ lg: '24px',
32
+ xl: '32px',
33
+ },
34
+ radius: {
35
+ xs: "2px",
36
+ sm: '4px',
37
+ md: '8px',
38
+ lg: '12px',
39
+ xl: '16px',
40
+ full: '9999px',
41
+ },
42
+ typography: {
43
+ fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
44
+ fontSize: {
45
+ xs: '0.75rem',
46
+ sm: '0.875rem',
47
+ md: '1rem',
48
+ lg: '1.25rem',
49
+ xl: '1.5rem',
50
+ },
51
+ },
52
+ };
53
+
54
+ const createCustomTheme = (config = {}) => {
55
+ const { primaryColor = designTokens.colors.primary[500], secondaryColor = designTokens.colors.secondary[500], } = config;
56
+ return createTheme({
57
+ palette: {
58
+ primary: {
59
+ main: primaryColor,
60
+ },
61
+ secondary: {
62
+ main: secondaryColor,
63
+ },
64
+ },
65
+ typography: {
66
+ fontFamily: designTokens.typography.fontFamily,
67
+ h1: { fontWeight: 600 },
68
+ h2: { fontWeight: 600 },
69
+ h3: { fontWeight: 600 },
70
+ h4: { fontWeight: 600 },
71
+ h5: { fontWeight: 600 },
72
+ h6: { fontWeight: 600 },
73
+ },
74
+ spacing: 8,
75
+ shape: {
76
+ borderRadius: 8,
77
+ },
78
+ radius: designTokens.radius,
79
+ components: {
80
+ MuiButton: {
81
+ styleOverrides: {
82
+ root: {
83
+ textTransform: 'none',
84
+ borderRadius: '4px',
85
+ // fontWeight: 600,
86
+ letterSpacing: '0.5px',
87
+ padding: '8px 16px',
88
+ },
89
+ sizeSmall: {
90
+ padding: '4px 12px',
91
+ fontSize: '0.875rem',
92
+ },
93
+ sizeLarge: {
94
+ padding: '12px 24px',
95
+ fontSize: '1rem',
96
+ },
97
+ },
98
+ defaultProps: {
99
+ disableElevation: true
100
+ }
101
+ },
102
+ MuiCard: {
103
+ styleOverrides: {
104
+ root: {
105
+ borderRadius: '12px',
106
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
107
+ },
108
+ },
109
+ },
110
+ MuiTextField: {
111
+ styleOverrides: {
112
+ root: {
113
+ '& .MuiOutlinedInput-root': {
114
+ borderRadius: '8px',
115
+ },
116
+ },
117
+ },
118
+ },
119
+ },
120
+ });
121
+ };
122
+ // Default theme
123
+ const theme = createCustomTheme();
124
+
125
+ const UILibraryThemeProvider = ({ children, primaryColor, secondaryColor, enableCssBaseline = true, }) => {
126
+ const themeConfig = {};
127
+ if (primaryColor) {
128
+ themeConfig.primaryColor = primaryColor;
129
+ }
130
+ if (secondaryColor) {
131
+ themeConfig.secondaryColor = secondaryColor;
132
+ }
133
+ const theme = createCustomTheme(themeConfig);
134
+ return (jsxs(ThemeProvider, { theme: theme, children: [enableCssBaseline && jsx(CssBaseline, {}), children] }));
135
+ };
136
+
137
+ export { UILibraryThemeProvider, createCustomTheme, designTokens, theme };
@@ -0,0 +1,142 @@
1
+ 'use strict';
2
+
3
+ var jsxRuntime = require('react/jsx-runtime');
4
+ var styles = require('@mui/material/styles');
5
+ var material = require('@mui/material');
6
+
7
+ const designTokens = {
8
+ colors: {
9
+ primary: {
10
+ 50: '#e3f2fd',
11
+ 100: '#bbdefb',
12
+ 500: '#2196f3',
13
+ 900: '#0d47a1',
14
+ },
15
+ secondary: {
16
+ 50: '#fce4ec',
17
+ 100: '#f8bbd9',
18
+ 500: '#e91e63',
19
+ 900: '#880e4f',
20
+ },
21
+ neutral: {
22
+ 50: '#fafafa',
23
+ 100: '#f5f5f5',
24
+ 200: '#eeeeee',
25
+ 500: '#9e9e9e',
26
+ 900: '#212121',
27
+ },
28
+ },
29
+ spacing: {
30
+ xs: '4px',
31
+ sm: '8px',
32
+ md: '16px',
33
+ lg: '24px',
34
+ xl: '32px',
35
+ },
36
+ radius: {
37
+ xs: "2px",
38
+ sm: '4px',
39
+ md: '8px',
40
+ lg: '12px',
41
+ xl: '16px',
42
+ full: '9999px',
43
+ },
44
+ typography: {
45
+ fontFamily: '"Roboto", "Helvetica", "Arial", sans-serif',
46
+ fontSize: {
47
+ xs: '0.75rem',
48
+ sm: '0.875rem',
49
+ md: '1rem',
50
+ lg: '1.25rem',
51
+ xl: '1.5rem',
52
+ },
53
+ },
54
+ };
55
+
56
+ const createCustomTheme = (config = {}) => {
57
+ const { primaryColor = designTokens.colors.primary[500], secondaryColor = designTokens.colors.secondary[500], } = config;
58
+ return styles.createTheme({
59
+ palette: {
60
+ primary: {
61
+ main: primaryColor,
62
+ },
63
+ secondary: {
64
+ main: secondaryColor,
65
+ },
66
+ },
67
+ typography: {
68
+ fontFamily: designTokens.typography.fontFamily,
69
+ h1: { fontWeight: 600 },
70
+ h2: { fontWeight: 600 },
71
+ h3: { fontWeight: 600 },
72
+ h4: { fontWeight: 600 },
73
+ h5: { fontWeight: 600 },
74
+ h6: { fontWeight: 600 },
75
+ },
76
+ spacing: 8,
77
+ shape: {
78
+ borderRadius: 8,
79
+ },
80
+ radius: designTokens.radius,
81
+ components: {
82
+ MuiButton: {
83
+ styleOverrides: {
84
+ root: {
85
+ textTransform: 'none',
86
+ borderRadius: '4px',
87
+ // fontWeight: 600,
88
+ letterSpacing: '0.5px',
89
+ padding: '8px 16px',
90
+ },
91
+ sizeSmall: {
92
+ padding: '4px 12px',
93
+ fontSize: '0.875rem',
94
+ },
95
+ sizeLarge: {
96
+ padding: '12px 24px',
97
+ fontSize: '1rem',
98
+ },
99
+ },
100
+ defaultProps: {
101
+ disableElevation: true
102
+ }
103
+ },
104
+ MuiCard: {
105
+ styleOverrides: {
106
+ root: {
107
+ borderRadius: '12px',
108
+ boxShadow: '0 2px 8px rgba(0, 0, 0, 0.1)',
109
+ },
110
+ },
111
+ },
112
+ MuiTextField: {
113
+ styleOverrides: {
114
+ root: {
115
+ '& .MuiOutlinedInput-root': {
116
+ borderRadius: '8px',
117
+ },
118
+ },
119
+ },
120
+ },
121
+ },
122
+ });
123
+ };
124
+ // Default theme
125
+ const theme = createCustomTheme();
126
+
127
+ const UILibraryThemeProvider = ({ children, primaryColor, secondaryColor, enableCssBaseline = true, }) => {
128
+ const themeConfig = {};
129
+ if (primaryColor) {
130
+ themeConfig.primaryColor = primaryColor;
131
+ }
132
+ if (secondaryColor) {
133
+ themeConfig.secondaryColor = secondaryColor;
134
+ }
135
+ const theme = createCustomTheme(themeConfig);
136
+ return (jsxRuntime.jsxs(styles.ThemeProvider, { theme: theme, children: [enableCssBaseline && jsxRuntime.jsx(material.CssBaseline, {}), children] }));
137
+ };
138
+
139
+ exports.UILibraryThemeProvider = UILibraryThemeProvider;
140
+ exports.createCustomTheme = createCustomTheme;
141
+ exports.designTokens = designTokens;
142
+ exports.theme = theme;
package/package.json CHANGED
@@ -1,10 +1,17 @@
1
1
  {
2
2
  "name": "@zimyo/ui",
3
- "version": "1.1.0",
4
- "description": "Scalable UI component library built on MUI Material",
3
+ "version": "1.1.2",
4
+ "description": "Zimyo UI library built on MUI Material",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.esm.js",
7
7
  "types": "dist/index.d.ts",
8
+ "author": "Zimyo Team <developer@zimyo.com>",
9
+ "license": "MIT",
10
+ "homepage": "https://github.com/zimyoTech/zimyo_core#readme",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/zimyoTech/zimyo_core"
14
+ },
8
15
  "exports": {
9
16
  ".": {
10
17
  "import": "./dist/index.esm.js",
@@ -26,6 +33,31 @@
26
33
  "require": "./dist/Typography/index.js",
27
34
  "types": "./dist/Typography/index.d.ts"
28
35
  },
36
+ "./Card": {
37
+ "import": "./dist/Card/index.esm.js",
38
+ "require": "./dist/Card/index.js",
39
+ "types": "./dist/Card/index.d.ts"
40
+ },
41
+ "./Accordion": {
42
+ "import": "./dist/Accordion/index.esm.js",
43
+ "require": "./dist/Accordion/index.js",
44
+ "types": "./dist/Accordion/index.d.ts"
45
+ },
46
+ "./Select": {
47
+ "import": "./dist/Select/index.esm.js",
48
+ "require": "./dist/Select/index.js",
49
+ "types": "./dist/Select/index.d.ts"
50
+ },
51
+ "./TextInput": {
52
+ "import": "./dist/Input/index.esm.js",
53
+ "require": "./dist/Input/index.js",
54
+ "types": "./dist/Input/index.d.ts"
55
+ },
56
+ "./Switch": {
57
+ "import": "./dist/Switch/index.esm.js",
58
+ "require": "./dist/Switch/index.js",
59
+ "types": "./dist/Switch/index.d.ts"
60
+ },
29
61
  "./theme": {
30
62
  "import": "./dist/theme/index.esm.js",
31
63
  "require": "./dist/theme/index.js",
@@ -36,7 +68,7 @@
36
68
  "dist"
37
69
  ],
38
70
  "scripts": {
39
- "build": "rollup -c --bundleConfigAsCjs",
71
+ "build": "cross-env NODE_OPTIONS=--max-old-space-size=4096 rollup -c --bundleConfigAsCjs",
40
72
  "build:watch": "rollup -c -w",
41
73
  "storybook": "storybook dev -p 6006",
42
74
  "build-storybook": "storybook build",
@@ -45,11 +77,12 @@
45
77
  "typecheck": "tsc --noEmit",
46
78
  "generate:exports": "node scripts/generate-exports.js",
47
79
  "version": "changeset version",
48
- "release": "changeset publish --access public"
80
+ "release": "changeset publish"
49
81
  },
50
82
  "peerDependencies": {
51
83
  "@emotion/react": ">=11.0.0",
52
84
  "@emotion/styled": ">=11.0.0",
85
+ "@mui/icons-material": "^7.1.2",
53
86
  "@mui/material": ">=5.0.0",
54
87
  "react": ">=17.0.0",
55
88
  "react-dom": ">=17.0.0"
@@ -66,6 +99,7 @@
66
99
  "@types/jest": "^30.0.0",
67
100
  "@types/node": "^20.9.0",
68
101
  "@types/react": "^18.0.0",
102
+ "cross-env": "^7.0.3",
69
103
  "eslint": "^8.0.0",
70
104
  "eslint-plugin-storybook": "^9.0.14",
71
105
  "jest": "^29.7.0",
@@ -81,12 +115,28 @@
81
115
  "@emotion/react": ">=11.0.0",
82
116
  "@emotion/styled": ">=11.0.0",
83
117
  "@mui/icons-material": "^7.1.2",
84
- "@mui/material": ">=5.0.0",
85
- "@mui/styles": "^6.4.8"
118
+ "@mui/material": ">=5.0.0"
86
119
  },
87
120
  "eslintConfig": {
88
121
  "extends": [
89
122
  "plugin:storybook/recommended"
90
123
  ]
91
- }
92
- }
124
+ },
125
+ "publishConfig": {
126
+ "access": "public"
127
+ },
128
+ "engines": {
129
+ "node": ">=16.0.0",
130
+ "npm": ">=7.0.0"
131
+ },
132
+ "keywords": [
133
+ "react",
134
+ "mui",
135
+ "material-ui",
136
+ "ui-library",
137
+ "storybook",
138
+ "typescript",
139
+ "component-library",
140
+ "design-system"
141
+ ]
142
+ }