@admin-layout/tailwind-design-pro 10.0.9-alpha.31 → 10.0.9-alpha.32
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 +88 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tailwindConfig.d.ts +87 -0
- package/lib/tailwindConfig.d.ts.map +1 -0
- package/lib/tailwindConfig.js +122 -0
- package/lib/tailwindConfig.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1 +1,88 @@
|
|
|
1
|
-
# Tailwind
|
|
1
|
+
# Tailwind Design Pro
|
|
2
|
+
|
|
3
|
+
A universal tailwind design system for use across all projects.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Unified theme system with light and dark mode support
|
|
8
|
+
- Consistent styling across all projects
|
|
9
|
+
- Easy to customize and extend
|
|
10
|
+
- Built-in typography, forms, and aspect ratio support
|
|
11
|
+
|
|
12
|
+
## Usage in Servers
|
|
13
|
+
|
|
14
|
+
To use this package in your server project, follow these steps:
|
|
15
|
+
|
|
16
|
+
### 1. Install the package
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install @admin-layout/tailwind-design-pro
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Use the Universal Tailwind Config
|
|
23
|
+
|
|
24
|
+
Create a `tailwind.config.js` or `tailwind.config.ts` file in your server project and import the universal config:
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
// tailwind.config.ts or tailwind.config.js
|
|
28
|
+
import { themeConfig } from '@admin-layout/tailwind-design-pro';
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
// Override content paths to include server-specific paths
|
|
32
|
+
content: [
|
|
33
|
+
'./src/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}',
|
|
34
|
+
'./app/**/{**,.client,.server}/**/*.{js,jsx,ts,tsx}',
|
|
35
|
+
'../../packages/**/*.{js,jsx,ts,tsx}',
|
|
36
|
+
'../../packages-modules/**/*.{js,jsx,ts,tsx}',
|
|
37
|
+
],
|
|
38
|
+
|
|
39
|
+
// You can add server-specific overrides here if needed
|
|
40
|
+
theme: {
|
|
41
|
+
extend: {
|
|
42
|
+
// Any server-specific extensions would go here
|
|
43
|
+
...themeConfig,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
darkMode: 'class',
|
|
47
|
+
variants: {
|
|
48
|
+
typography: ['dark'],
|
|
49
|
+
},
|
|
50
|
+
plugins: [typography, forms, aspectRatio],
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3. Using the ThemeProvider
|
|
55
|
+
|
|
56
|
+
To enable theme switching functionality in your application, wrap your app with the ThemeProvider:
|
|
57
|
+
|
|
58
|
+
```tsx
|
|
59
|
+
import { ThemeProvider } from '@admin-layout/tailwind-design-pro';
|
|
60
|
+
|
|
61
|
+
function App() {
|
|
62
|
+
// Example settings for the theme
|
|
63
|
+
const settings = {
|
|
64
|
+
theme: 'airbnb', // Use our unified theme
|
|
65
|
+
themeType: 'light', // 'light' or 'dark'
|
|
66
|
+
primaryColor: '#1890ff', // Optional custom primary color
|
|
67
|
+
fontFamily: 'Inter, sans-serif', // Optional custom font
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<ThemeProvider settings={settings}>
|
|
72
|
+
<YourApp />
|
|
73
|
+
</ThemeProvider>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Theme Customization
|
|
79
|
+
|
|
80
|
+
The theme system is built on Tailwind's theme extension mechanism. You can customize the theme by modifying the `themeRegistry.ts` file.
|
|
81
|
+
|
|
82
|
+
## Available Themes
|
|
83
|
+
|
|
84
|
+
- `default` - The default theme
|
|
85
|
+
- `github` - GitHub-inspired theme
|
|
86
|
+
- `slack` - Slack-inspired theme
|
|
87
|
+
- `airbnb` - Airbnb-inspired theme
|
|
88
|
+
- `spotify` - Spotify-inspired theme
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,cAAc,kBAAkB,CAAC;;AAEjC,wBAAqC"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Feature}from'@common-stack/client-react';import settings from'./module.js';// eslint-disable-next-line import/no-extraneous-dependencies
|
|
1
|
+
import {Feature}from'@common-stack/client-react';import settings from'./module.js';export{themeConfig}from'./tailwindConfig.js';// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
var index = new Feature(settings);export{index as default};//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"gIAAA;AAKA,YAAe,IAAI,OAAO,CAAC,QAAQ,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export declare const themeConfig: {
|
|
2
|
+
colors: any;
|
|
3
|
+
fontFamily: {
|
|
4
|
+
sans: string[];
|
|
5
|
+
};
|
|
6
|
+
typography: (theme: (arg0: string) => any) => {
|
|
7
|
+
DEFAULT: {
|
|
8
|
+
css: {
|
|
9
|
+
color: any;
|
|
10
|
+
a: {
|
|
11
|
+
color: any;
|
|
12
|
+
'&:hover': {
|
|
13
|
+
color: any;
|
|
14
|
+
};
|
|
15
|
+
code: {
|
|
16
|
+
color: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
'h2,h3,h4': {
|
|
20
|
+
'scroll-margin-top': string;
|
|
21
|
+
};
|
|
22
|
+
thead: {
|
|
23
|
+
borderBottomColor: any;
|
|
24
|
+
};
|
|
25
|
+
code: {
|
|
26
|
+
color: any;
|
|
27
|
+
};
|
|
28
|
+
'blockquote p:first-of-type::before': boolean;
|
|
29
|
+
'blockquote p:last-of-type::after': boolean;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
dark: {
|
|
33
|
+
css: {
|
|
34
|
+
color: any;
|
|
35
|
+
a: {
|
|
36
|
+
color: any;
|
|
37
|
+
'&:hover': {
|
|
38
|
+
color: any;
|
|
39
|
+
};
|
|
40
|
+
code: {
|
|
41
|
+
color: any;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
blockquote: {
|
|
45
|
+
borderLeftColor: any;
|
|
46
|
+
color: any;
|
|
47
|
+
};
|
|
48
|
+
'h2,h3,h4': {
|
|
49
|
+
color: any;
|
|
50
|
+
'scroll-margin-top': string;
|
|
51
|
+
};
|
|
52
|
+
hr: {
|
|
53
|
+
borderColor: any;
|
|
54
|
+
};
|
|
55
|
+
ol: {
|
|
56
|
+
li: {
|
|
57
|
+
'&:before': {
|
|
58
|
+
color: any;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
ul: {
|
|
63
|
+
li: {
|
|
64
|
+
'&:before': {
|
|
65
|
+
backgroundColor: any;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
strong: {
|
|
70
|
+
color: any;
|
|
71
|
+
};
|
|
72
|
+
thead: {
|
|
73
|
+
th: {
|
|
74
|
+
color: any;
|
|
75
|
+
};
|
|
76
|
+
borderBottomColor: any;
|
|
77
|
+
};
|
|
78
|
+
tbody: {
|
|
79
|
+
tr: {
|
|
80
|
+
borderBottomColor: any;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
//# sourceMappingURL=tailwindConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwindConfig.d.ts","sourceRoot":"","sources":["../src/tailwindConfig.ts"],"names":[],"mappings":"AAmDA,eAAO,MAAM,WAAW;;;;;wBAKA,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkE5C,CAAC"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import defaultTheme from'tailwindcss/defaultTheme.js';import {themeRegistry}from'./components/ThemeProvider/themeRegistry.js';// Extract the tailwindDesignPro theme for use in the config
|
|
2
|
+
const tailwindTheme = themeRegistry.default;
|
|
3
|
+
// Utility to convert HSL format to more standard format
|
|
4
|
+
const parseHsl = hslString => {
|
|
5
|
+
const [h, s, l] = hslString.split(' ').map((val, index) => {
|
|
6
|
+
if (index === 0) return val;
|
|
7
|
+
return val; // Keep percentage format
|
|
8
|
+
});
|
|
9
|
+
return `hsl(${h}, ${s}, ${l})`;
|
|
10
|
+
};
|
|
11
|
+
// Convert theme colors to Tailwind-compatible format
|
|
12
|
+
const generateTailwindColors = themeColors => {
|
|
13
|
+
const colors = {
|
|
14
|
+
gray: {
|
|
15
|
+
0: '#fff',
|
|
16
|
+
100: '#fafafa',
|
|
17
|
+
200: '#eaeaea',
|
|
18
|
+
300: '#999999',
|
|
19
|
+
400: '#888888',
|
|
20
|
+
500: '#666666',
|
|
21
|
+
600: '#444444',
|
|
22
|
+
700: '#333333',
|
|
23
|
+
800: '#222222',
|
|
24
|
+
900: '#111111'
|
|
25
|
+
},
|
|
26
|
+
'blue-opaque': 'rgb(13 42 148 / 18%)'
|
|
27
|
+
};
|
|
28
|
+
// Add light mode colors
|
|
29
|
+
Object.entries(themeColors.light).forEach(([key, value]) => {
|
|
30
|
+
if (typeof value === 'string') {
|
|
31
|
+
colors[key] = parseHsl(value);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return colors;
|
|
35
|
+
};
|
|
36
|
+
// Default spacing and theme from Tailwind
|
|
37
|
+
const themeConfig = {
|
|
38
|
+
colors: generateTailwindColors(tailwindTheme.colors),
|
|
39
|
+
fontFamily: {
|
|
40
|
+
sans: ['Work Sans', ...defaultTheme.fontFamily.sans]
|
|
41
|
+
},
|
|
42
|
+
typography: theme => ({
|
|
43
|
+
DEFAULT: {
|
|
44
|
+
css: {
|
|
45
|
+
color: theme('colors.gray.700'),
|
|
46
|
+
a: {
|
|
47
|
+
color: theme('colors.blue.500'),
|
|
48
|
+
'&:hover': {
|
|
49
|
+
color: theme('colors.blue.700')
|
|
50
|
+
},
|
|
51
|
+
code: {
|
|
52
|
+
color: theme('colors.blue.400')
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
'h2,h3,h4': {
|
|
56
|
+
'scroll-margin-top': defaultTheme.spacing[32]
|
|
57
|
+
},
|
|
58
|
+
thead: {
|
|
59
|
+
borderBottomColor: theme('colors.gray.200')
|
|
60
|
+
},
|
|
61
|
+
code: {
|
|
62
|
+
color: theme('colors.pink.500')
|
|
63
|
+
},
|
|
64
|
+
'blockquote p:first-of-type::before': false,
|
|
65
|
+
'blockquote p:last-of-type::after': false
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
dark: {
|
|
69
|
+
css: {
|
|
70
|
+
color: theme('colors.gray.200'),
|
|
71
|
+
a: {
|
|
72
|
+
color: theme('colors.blue.400'),
|
|
73
|
+
'&:hover': {
|
|
74
|
+
color: theme('colors.blue.600')
|
|
75
|
+
},
|
|
76
|
+
code: {
|
|
77
|
+
color: theme('colors.blue.400')
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
blockquote: {
|
|
81
|
+
borderLeftColor: theme('colors.gray.700'),
|
|
82
|
+
color: theme('colors.gray.300')
|
|
83
|
+
},
|
|
84
|
+
'h2,h3,h4': {
|
|
85
|
+
color: theme('colors.gray.100'),
|
|
86
|
+
'scroll-margin-top': defaultTheme.spacing[32]
|
|
87
|
+
},
|
|
88
|
+
hr: {
|
|
89
|
+
borderColor: theme('colors.gray.700')
|
|
90
|
+
},
|
|
91
|
+
ol: {
|
|
92
|
+
li: {
|
|
93
|
+
'&:before': {
|
|
94
|
+
color: theme('colors.gray.500')
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
ul: {
|
|
99
|
+
li: {
|
|
100
|
+
'&:before': {
|
|
101
|
+
backgroundColor: theme('colors.gray.500')
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
strong: {
|
|
106
|
+
color: theme('colors.gray.100')
|
|
107
|
+
},
|
|
108
|
+
thead: {
|
|
109
|
+
th: {
|
|
110
|
+
color: theme('colors.gray.100')
|
|
111
|
+
},
|
|
112
|
+
borderBottomColor: theme('colors.gray.600')
|
|
113
|
+
},
|
|
114
|
+
tbody: {
|
|
115
|
+
tr: {
|
|
116
|
+
borderBottomColor: theme('colors.gray.700')
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
})
|
|
122
|
+
};export{themeConfig};//# sourceMappingURL=tailwindConfig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tailwindConfig.js","sources":["../src/tailwindConfig.ts"],"sourcesContent":[null],"names":[],"mappings":"8HAGA;AACA,MAAM,aAAa,GAAG,aAAa,CAAC,OAAO;AAE3C;AACA,MAAM,QAAQ,GAAG,SAAC,IAAqB;QAC7B,CAAA,CAAA,EAAE,CAAE,EAAC,EAAE,GAAK,SAAA,CAAA,KAAU,CAAA,GAAS,CAAA,CAAA,GAAK,CAAA,CAAA,GAAK,EAAA,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D,UAAA,EAAA,EAAA;AACH,YAAA,UAAA,EAAA;AACD,cAAA,eAAO,EAAA,KAAA,CAAA,iBAAA;AACH;AACI;AACH,SAAA;AACJ,QAAA,MAAA,EAAA;AACJ,UAAA,KAAA,EAAA,KAAA,CAAA,iBAAA;AACJ,SAAA;QACH,KAAA,EAAA;UACJ,EAAA,EAAA;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/tailwind-design-pro",
|
|
3
|
-
"version": "10.0.9-alpha.
|
|
3
|
+
"version": "10.0.9-alpha.32",
|
|
4
4
|
"description": "Sample core for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "99fce53dcf8796b8dbb7dd3c583a931c2062c4d3",
|
|
62
62
|
"typescript": {
|
|
63
63
|
"definition": "lib/index.d.ts"
|
|
64
64
|
}
|