@admin-layout/tailwind-design-pro 10.1.1-alpha.9 → 12.0.16-alpha.0
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 +306 -250
- package/lib/cdm-locales/en/settings.json +6 -1
- package/lib/cdm-locales/es/settings.json +6 -1
- package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
- package/lib/components/LanguageMenu/LanguageMenu.js +8 -18
- package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +18 -28
- package/lib/components/Layout/BasicLayout/index.js.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.js +1 -14
- package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +30 -31
- package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.js +25 -27
- package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +4 -4
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.js +13 -29
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/SearchBar.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/SearchBar.js +7 -7
- package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
- package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/Sidebar.js +32 -38
- package/lib/components/Layout/Sidebar/Sidebar.js.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.js +25 -32
- package/lib/components/Layout/Sidebar/SidebarMenu.js.map +1 -1
- package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/TailwindLayout.js +7 -3
- package/lib/components/Layout/TailwindLayout.js.map +1 -1
- package/lib/components/SettingDrawer/InvitationSettings.d.ts +3 -0
- package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/InvitationSettings.js +79 -0
- package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -0
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +8 -2
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/UI/PropertyCard.d.ts.map +1 -1
- package/lib/components/UI/PropertyCard.js +73 -31
- package/lib/components/UI/PropertyCard.js.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +7 -3
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js.map +1 -1
- package/lib/config/analytics-config.d.ts +59 -0
- package/lib/config/analytics-config.d.ts.map +1 -0
- package/lib/config/env-config.d.ts +3 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +11 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/config/index.d.ts +3 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/redux/searchReducer.d.ts +1 -1
- package/lib/redux/searchReducer.d.ts.map +1 -1
- package/lib/redux/searchReducer.js.map +1 -1
- package/lib/styles/index-bk.css +443 -0
- package/lib/styles/index.css +602 -372
- package/lib/tailwindConfig.d.ts +85 -27
- package/lib/tailwindConfig.d.ts.map +1 -1
- package/lib/tailwindConfig.js +96 -18
- package/lib/tailwindConfig.js.map +1 -1
- package/lib/utils/analytics-utils.d.ts +43 -0
- package/lib/utils/analytics-utils.d.ts.map +1 -0
- package/lib/utils/analytics.d.ts +48 -0
- package/lib/utils/analytics.d.ts.map +1 -0
- package/package.json +6 -4
- package/lib/components/ThemeProvider/ThemeProvider.d.ts +0 -8
- package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +0 -1
- package/lib/components/ThemeProvider/ThemeProvider.js +0 -60
- package/lib/components/ThemeProvider/ThemeProvider.js.map +0 -1
- package/lib/components/ThemeProvider/ThemeToggle.d.ts +0 -7
- package/lib/components/ThemeProvider/ThemeToggle.d.ts.map +0 -1
- package/lib/components/ThemeProvider/ThemeToggle.js +0 -50
- package/lib/components/ThemeProvider/ThemeToggle.js.map +0 -1
- package/lib/components/ThemeProvider/index.d.ts +0 -4
- package/lib/components/ThemeProvider/index.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themes/airbnb.d.ts +0 -3
- package/lib/components/ThemeProvider/themes/airbnb.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themes/airbnb.js +0 -186
- package/lib/components/ThemeProvider/themes/airbnb.js.map +0 -1
- package/lib/components/ThemeProvider/themes/default.d.ts +0 -3
- package/lib/components/ThemeProvider/themes/default.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themes/default.js +0 -183
- package/lib/components/ThemeProvider/themes/default.js.map +0 -1
- package/lib/components/ThemeProvider/themes/github.d.ts +0 -3
- package/lib/components/ThemeProvider/themes/github.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themes/github.js +0 -190
- package/lib/components/ThemeProvider/themes/github.js.map +0 -1
- package/lib/components/ThemeProvider/themes/index.d.ts +0 -15
- package/lib/components/ThemeProvider/themes/index.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themes/index.js +0 -7
- package/lib/components/ThemeProvider/themes/index.js.map +0 -1
- package/lib/components/ThemeProvider/themes/slack.d.ts +0 -3
- package/lib/components/ThemeProvider/themes/slack.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themes/slack.js +0 -188
- package/lib/components/ThemeProvider/themes/slack.js.map +0 -1
- package/lib/components/ThemeProvider/themes/spotify.d.ts +0 -3
- package/lib/components/ThemeProvider/themes/spotify.d.ts.map +0 -1
- package/lib/components/ThemeProvider/themes/spotify.js +0 -189
- package/lib/components/ThemeProvider/themes/spotify.js.map +0 -1
- package/lib/components/ThemeProvider/types.d.ts +0 -112
- package/lib/components/ThemeProvider/types.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Tailwind Design Pro
|
|
2
2
|
|
|
3
|
-
A universal tailwind design system for
|
|
3
|
+
A universal tailwind design system with multi-theme support and CSS custom properties for seamless theme switching.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
7
|
+
- **Multi-Theme System**: 5 pre-built themes (Default, Airbnb, Slack, GitHub, Spotify)
|
|
8
|
+
- **CSS Custom Properties**: Theme-aware styling with CSS variables
|
|
9
|
+
- **Dark/Light Mode**: Automatic theme switching with persistent preferences
|
|
10
|
+
- **Component Library**: Pre-built UI components with theme integration
|
|
11
|
+
- **Responsive Design**: Mobile-first approach with consistent breakpoints
|
|
12
|
+
- **Accessibility**: WCAG compliant color contrasts and focus states
|
|
11
13
|
|
|
12
|
-
##
|
|
13
|
-
|
|
14
|
-
To use this package in your server project, follow these steps:
|
|
14
|
+
## Quick Start
|
|
15
15
|
|
|
16
16
|
### 1. Install the package
|
|
17
17
|
|
|
@@ -19,327 +19,383 @@ To use this package in your server project, follow these steps:
|
|
|
19
19
|
npm install @admin-layout/tailwind-design-pro
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
### 2.
|
|
22
|
+
### 2. Import the CSS
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// In your main CSS file or entry point
|
|
26
|
+
import '@admin-layout/tailwind-design-pro/src/styles/index.css';
|
|
27
|
+
```
|
|
23
28
|
|
|
24
|
-
|
|
29
|
+
### 3. Configure Tailwind
|
|
25
30
|
|
|
26
31
|
```typescript
|
|
27
|
-
// tailwind.config.ts
|
|
32
|
+
// tailwind.config.ts
|
|
28
33
|
import { themeConfig } from '@admin-layout/tailwind-design-pro';
|
|
29
34
|
|
|
30
35
|
export default {
|
|
31
|
-
|
|
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
|
|
36
|
+
content: ['./src/**/*.{js,jsx,ts,tsx}', '../../packages/**/*.{js,jsx,ts,tsx}'],
|
|
40
37
|
theme: {
|
|
41
|
-
extend:
|
|
42
|
-
// Any server-specific extensions would go here
|
|
43
|
-
...themeConfig,
|
|
44
|
-
},
|
|
38
|
+
extend: themeConfig,
|
|
45
39
|
},
|
|
46
40
|
darkMode: 'class',
|
|
47
|
-
|
|
48
|
-
typography: ['dark'],
|
|
49
|
-
},
|
|
50
|
-
plugins: [typography, forms, aspectRatio],
|
|
41
|
+
plugins: [],
|
|
51
42
|
};
|
|
52
43
|
```
|
|
53
44
|
|
|
54
|
-
|
|
45
|
+
### 4. Set up Theme Provider
|
|
55
46
|
|
|
56
|
-
|
|
47
|
+
```tsx
|
|
48
|
+
import { ThemeProviderTailwind } from '@admin-layout/tailwind-ui';
|
|
57
49
|
|
|
58
|
-
|
|
50
|
+
const App = () => {
|
|
51
|
+
const settings = {
|
|
52
|
+
theme: 'default', // 'default', 'airbnb', 'slack', 'github', 'spotify'
|
|
53
|
+
navTheme: 'light', // 'light' or 'dark'
|
|
54
|
+
primaryColor: '#000000',
|
|
55
|
+
fontFamily: 'Inter, sans-serif',
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<ThemeProviderTailwind settings={settings} actor={actor}>
|
|
60
|
+
<YourApp />
|
|
61
|
+
</ThemeProviderTailwind>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
```
|
|
59
65
|
|
|
60
66
|
## Available Themes
|
|
61
67
|
|
|
62
|
-
|
|
68
|
+
### 1. Default Theme
|
|
63
69
|
|
|
64
|
-
-
|
|
65
|
-
-
|
|
66
|
-
-
|
|
67
|
-
- `github`: Following GitHub's design patterns
|
|
68
|
-
- `spotify`: Matching Spotify's visual identity
|
|
70
|
+
- Clean, professional design
|
|
71
|
+
- Neutral color palette
|
|
72
|
+
- Perfect for business applications
|
|
69
73
|
|
|
70
|
-
|
|
74
|
+
### 2. Airbnb Theme
|
|
71
75
|
|
|
72
|
-
|
|
76
|
+
- Warm, welcoming colors
|
|
77
|
+
- Red accent colors
|
|
78
|
+
- Great for hospitality and travel apps
|
|
73
79
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
md: string;
|
|
106
|
-
lg: string;
|
|
107
|
-
xl: string;
|
|
108
|
-
'2xl': string;
|
|
109
|
-
full: string;
|
|
110
|
-
};
|
|
111
|
-
fontFamily: {
|
|
112
|
-
sans: string[];
|
|
113
|
-
serif: string[];
|
|
114
|
-
mono: string[];
|
|
115
|
-
};
|
|
116
|
-
boxShadow: {
|
|
117
|
-
sm: string;
|
|
118
|
-
DEFAULT: string;
|
|
119
|
-
md: string;
|
|
120
|
-
lg: string;
|
|
121
|
-
xl: string;
|
|
122
|
-
};
|
|
123
|
-
components: {
|
|
124
|
-
buttons: {
|
|
125
|
-
primary: ButtonStyle;
|
|
126
|
-
secondary: ButtonStyle;
|
|
127
|
-
};
|
|
128
|
-
cards: {
|
|
129
|
-
borderRadius: string;
|
|
130
|
-
padding: string;
|
|
131
|
-
shadow: string;
|
|
132
|
-
border: string;
|
|
133
|
-
};
|
|
134
|
-
inputs: {
|
|
135
|
-
borderRadius: string;
|
|
136
|
-
borderColor: string;
|
|
137
|
-
focusBorderColor: string;
|
|
138
|
-
padding: string;
|
|
139
|
-
fontSize: string;
|
|
140
|
-
lineHeight: string;
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
}
|
|
80
|
+
### 3. Slack Theme
|
|
81
|
+
|
|
82
|
+
- Purple-based design
|
|
83
|
+
- Modern, collaborative feel
|
|
84
|
+
- Ideal for team communication tools
|
|
85
|
+
|
|
86
|
+
### 4. GitHub Theme
|
|
87
|
+
|
|
88
|
+
- Dark, developer-friendly
|
|
89
|
+
- High contrast design
|
|
90
|
+
- Perfect for developer tools
|
|
91
|
+
|
|
92
|
+
### 5. Spotify Theme
|
|
93
|
+
|
|
94
|
+
- Green accent colors
|
|
95
|
+
- Music and entertainment focused
|
|
96
|
+
- Great for media applications
|
|
97
|
+
|
|
98
|
+
## Theme-Aware CSS Classes
|
|
99
|
+
|
|
100
|
+
The design system provides theme-aware CSS classes that automatically adapt to the current theme:
|
|
101
|
+
|
|
102
|
+
### Background Colors
|
|
103
|
+
|
|
104
|
+
```css
|
|
105
|
+
.bg-background /* Main background */
|
|
106
|
+
/* Main background */
|
|
107
|
+
.bg-card /* Card background */
|
|
108
|
+
.bg-popover /* Popover background */
|
|
109
|
+
.bg-muted /* Muted background */
|
|
110
|
+
.bg-accent; /* Accent background */
|
|
144
111
|
```
|
|
145
112
|
|
|
146
|
-
|
|
113
|
+
### Text Colors
|
|
147
114
|
|
|
148
|
-
|
|
115
|
+
```css
|
|
116
|
+
.text-foreground /* Primary text */
|
|
117
|
+
/* Primary text */
|
|
118
|
+
.text-muted-foreground /* Secondary text */
|
|
119
|
+
.text-primary /* Primary brand color */
|
|
120
|
+
.text-secondary /* Secondary brand color */
|
|
121
|
+
.text-accent; /* Accent color */
|
|
122
|
+
```
|
|
149
123
|
|
|
150
|
-
|
|
151
|
-
|
|
124
|
+
### Semantic Colors
|
|
125
|
+
|
|
126
|
+
```css
|
|
127
|
+
.text-success /* Success text */
|
|
128
|
+
/* Success text */
|
|
129
|
+
.text-warning /* Warning text */
|
|
130
|
+
.text-error /* Error text */
|
|
131
|
+
.text-info /* Info text */
|
|
132
|
+
.bg-success /* Success background */
|
|
133
|
+
.bg-warning /* Warning background */
|
|
134
|
+
.bg-error /* Error background */
|
|
135
|
+
.bg-info; /* Info background */
|
|
136
|
+
```
|
|
152
137
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
138
|
+
### Component Classes
|
|
139
|
+
|
|
140
|
+
```css
|
|
141
|
+
.themed-button /* Theme-aware button */
|
|
142
|
+
/* Theme-aware button */
|
|
143
|
+
.themed-card /* Theme-aware card */
|
|
144
|
+
.themed-input /* Theme-aware input */
|
|
145
|
+
.themed-modal /* Theme-aware modal */
|
|
146
|
+
.themed-dropdown /* Theme-aware dropdown */
|
|
147
|
+
.themed-sidebar; /* Theme-aware sidebar */
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Interactive Classes
|
|
151
|
+
|
|
152
|
+
```css
|
|
153
|
+
.interactive-hover /* Hover effects */
|
|
154
|
+
/* Hover effects */
|
|
155
|
+
.focus-themed /* Focus states */
|
|
156
|
+
.rounded-themed /* Theme-aware border radius */
|
|
157
|
+
.shadow-themed-sm /* Theme-aware shadows */
|
|
158
|
+
.shadow-themed-md
|
|
159
|
+
.shadow-themed-lg
|
|
160
|
+
.shadow-themed-xl;
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
## Using Theme-Aware Components
|
|
164
|
+
|
|
165
|
+
### Basic Usage
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
import { Button, Card, CardContent, CardHeader, CardTitle } from '@admin-layout/tailwind-ui';
|
|
161
169
|
|
|
162
|
-
|
|
170
|
+
const MyComponent = () => {
|
|
171
|
+
return (
|
|
172
|
+
<div className="bg-background text-foreground p-6">
|
|
173
|
+
<Card className="themed-card">
|
|
174
|
+
<CardHeader>
|
|
175
|
+
<CardTitle className="text-foreground">Card Title</CardTitle>
|
|
176
|
+
</CardHeader>
|
|
177
|
+
<CardContent>
|
|
178
|
+
<p className="text-muted-foreground">Card content</p>
|
|
179
|
+
<Button className="themed-button interactive-hover">Click Me</Button>
|
|
180
|
+
</CardContent>
|
|
181
|
+
</Card>
|
|
182
|
+
</div>
|
|
183
|
+
);
|
|
163
184
|
};
|
|
164
185
|
```
|
|
165
186
|
|
|
166
|
-
|
|
187
|
+
### Form Components
|
|
167
188
|
|
|
168
|
-
|
|
189
|
+
```tsx
|
|
190
|
+
const FormExample = () => {
|
|
191
|
+
return (
|
|
192
|
+
<form className="space-y-4">
|
|
193
|
+
<div>
|
|
194
|
+
<label className="text-foreground font-medium">Email</label>
|
|
195
|
+
<input type="email" className="w-full themed-input focus-themed" placeholder="Enter your email" />
|
|
196
|
+
</div>
|
|
197
|
+
<Button type="submit" className="themed-button">
|
|
198
|
+
Submit
|
|
199
|
+
</Button>
|
|
200
|
+
</form>
|
|
201
|
+
);
|
|
202
|
+
};
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Theme Switching
|
|
169
206
|
|
|
170
207
|
```tsx
|
|
171
|
-
import { useTheme } from '
|
|
208
|
+
import { useTheme } from '@admin-layout/tailwind-ui';
|
|
172
209
|
|
|
173
|
-
const
|
|
174
|
-
const {
|
|
210
|
+
const ThemeSwitcher = () => {
|
|
211
|
+
const { theme, mode, toggleMode, setTheme, setMode } = useTheme();
|
|
175
212
|
|
|
176
213
|
return (
|
|
177
|
-
<div>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
{/* Use theme-specific styles */}
|
|
182
|
-
<button
|
|
183
|
-
style={{
|
|
184
|
-
borderRadius: theme.borderRadius.DEFAULT,
|
|
185
|
-
fontFamily: theme.fontFamily.sans.join(', '),
|
|
186
|
-
}}
|
|
214
|
+
<div className="space-x-2">
|
|
215
|
+
<Button
|
|
216
|
+
onClick={() => setTheme('airbnb')}
|
|
217
|
+
className={theme === 'airbnb' ? 'themed-button' : 'bg-muted text-foreground'}
|
|
187
218
|
>
|
|
188
|
-
|
|
189
|
-
</
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
219
|
+
Airbnb
|
|
220
|
+
</Button>
|
|
221
|
+
<Button
|
|
222
|
+
onClick={() => setTheme('slack')}
|
|
223
|
+
className={theme === 'slack' ? 'themed-button' : 'bg-muted text-foreground'}
|
|
224
|
+
>
|
|
225
|
+
Slack
|
|
226
|
+
</Button>
|
|
227
|
+
<Button onClick={toggleDarkMode}>{mode === 'dark' ? 'Light' : 'Dark'} Mode</Button>
|
|
193
228
|
</div>
|
|
194
229
|
);
|
|
195
230
|
};
|
|
196
231
|
```
|
|
197
232
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
233
|
+
## CSS Custom Properties
|
|
234
|
+
|
|
235
|
+
The design system uses CSS custom properties for dynamic theming:
|
|
236
|
+
|
|
237
|
+
### Color Variables
|
|
238
|
+
|
|
239
|
+
```css
|
|
240
|
+
:root {
|
|
241
|
+
--background: 0 0% 100%;
|
|
242
|
+
--foreground: 222.2 84% 4.9%;
|
|
243
|
+
--primary: 222.2 47.4% 11.2%;
|
|
244
|
+
--primary-foreground: 210 40% 98%;
|
|
245
|
+
--secondary: 210 40% 96.1%;
|
|
246
|
+
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
247
|
+
--muted: 210 40% 96.1%;
|
|
248
|
+
--muted-foreground: 215.4 16.3% 46.9%;
|
|
249
|
+
--accent: 210 40% 96.1%;
|
|
250
|
+
--accent-foreground: 222.2 47.4% 11.2%;
|
|
251
|
+
--destructive: 0 84.2% 60.2%;
|
|
252
|
+
--destructive-foreground: 210 40% 98%;
|
|
253
|
+
--border: 214.3 31.8% 91.4%;
|
|
254
|
+
--input: 214.3 31.8% 91.4%;
|
|
255
|
+
--ring: 222.2 84% 4.9%;
|
|
256
|
+
--radius: 0.5rem;
|
|
257
|
+
}
|
|
258
|
+
```
|
|
204
259
|
|
|
205
|
-
|
|
260
|
+
### Theme-Specific Variables
|
|
206
261
|
|
|
207
|
-
|
|
262
|
+
Each theme has its own set of variables:
|
|
208
263
|
|
|
209
|
-
|
|
210
|
-
-
|
|
211
|
-
|
|
264
|
+
```css
|
|
265
|
+
[data-theme='airbnb'] {
|
|
266
|
+
--primary: 0 100% 60%;
|
|
267
|
+
--background: 0 0% 100%;
|
|
268
|
+
/* ... other theme-specific variables */
|
|
269
|
+
}
|
|
270
|
+
```
|
|
212
271
|
|
|
213
|
-
|
|
272
|
+
## Best Practices
|
|
214
273
|
|
|
215
|
-
|
|
216
|
-
- All theme properties are immediately applied when changed
|
|
274
|
+
### 1. Use Theme-Aware Classes
|
|
217
275
|
|
|
218
|
-
|
|
276
|
+
```tsx
|
|
277
|
+
// ✅ Good - Theme-aware
|
|
278
|
+
<div className="bg-background text-foreground">
|
|
279
|
+
<Button className="themed-button">Click</Button>
|
|
280
|
+
</div>
|
|
281
|
+
|
|
282
|
+
// ❌ Avoid - Hardcoded colors
|
|
283
|
+
<div className="bg-white text-black">
|
|
284
|
+
<Button className="bg-blue-500 text-white">Click</Button>
|
|
285
|
+
</div>
|
|
286
|
+
```
|
|
219
287
|
|
|
220
|
-
|
|
288
|
+
### 2. Leverage Semantic Colors
|
|
221
289
|
|
|
222
|
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
290
|
+
```tsx
|
|
291
|
+
// ✅ Good - Semantic meaning
|
|
292
|
+
<div className="text-success">Success message</div>
|
|
293
|
+
<div className="text-error">Error message</div>
|
|
225
294
|
|
|
226
|
-
|
|
295
|
+
// ❌ Avoid - Hardcoded colors
|
|
296
|
+
<div className="text-green-500">Success message</div>
|
|
297
|
+
<div className="text-red-500">Error message</div>
|
|
298
|
+
```
|
|
227
299
|
|
|
228
|
-
|
|
229
|
-
- Primary colors
|
|
230
|
-
- Secondary colors
|
|
231
|
-
- Accent colors
|
|
232
|
-
- Semantic colors (success, warning, error)
|
|
233
|
-
- Neutral colors
|
|
234
|
-
- Background colors
|
|
235
|
-
- Text colors
|
|
300
|
+
### 3. Use Interactive Classes
|
|
236
301
|
|
|
237
|
-
|
|
302
|
+
```tsx
|
|
303
|
+
// ✅ Good - Built-in interactions
|
|
304
|
+
<Button className="themed-button interactive-hover">
|
|
305
|
+
Hover me
|
|
306
|
+
</Button>
|
|
307
|
+
|
|
308
|
+
// ❌ Avoid - Custom hover states
|
|
309
|
+
<Button className="themed-button hover:scale-105 hover:shadow-lg">
|
|
310
|
+
Hover me
|
|
311
|
+
</Button>
|
|
312
|
+
```
|
|
238
313
|
|
|
239
|
-
|
|
240
|
-
- Consistent typography settings across themes
|
|
314
|
+
### 4. Responsive Design
|
|
241
315
|
|
|
242
|
-
|
|
316
|
+
```tsx
|
|
317
|
+
// ✅ Good - Responsive with theme
|
|
318
|
+
<div className="bg-background p-4 md:p-6 lg:p-8">
|
|
319
|
+
<Card className="themed-card">
|
|
320
|
+
<CardContent className="p-4 md:p-6">Content</CardContent>
|
|
321
|
+
</Card>
|
|
322
|
+
</div>
|
|
323
|
+
```
|
|
243
324
|
|
|
244
|
-
|
|
325
|
+
## Migration Guide
|
|
245
326
|
|
|
246
|
-
|
|
247
|
-
const { theme } = useTheme();
|
|
248
|
-
// Use theme properties directly
|
|
249
|
-
const primaryColor = theme.colors.primary[500];
|
|
250
|
-
```
|
|
327
|
+
### From Inline Styles to CSS Classes
|
|
251
328
|
|
|
252
|
-
|
|
329
|
+
**Before:**
|
|
253
330
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
const backgroundColor = isDarkMode ? theme.colors.background.dark : theme.colors.background.light;
|
|
258
|
-
```
|
|
331
|
+
```tsx
|
|
332
|
+
const { theme, isDarkMode } = useTheme();
|
|
333
|
+
const textColor = isDarkMode ? theme.colors.text.dark.primary : theme.colors.text.light.primary;
|
|
259
334
|
|
|
260
|
-
|
|
335
|
+
<div style={{ color: textColor, backgroundColor: theme.colors.background.light }}>Content</div>;
|
|
336
|
+
```
|
|
261
337
|
|
|
262
|
-
|
|
263
|
-
const { theme } = useTheme();
|
|
264
|
-
// Use theme component styles
|
|
265
|
-
const buttonStyle = {
|
|
266
|
-
...theme.components.buttons.primary,
|
|
267
|
-
// Add custom styles as needed
|
|
268
|
-
};
|
|
269
|
-
```
|
|
270
|
-
|
|
271
|
-
4. **Responsive Design**
|
|
272
|
-
```tsx
|
|
273
|
-
const { theme } = useTheme();
|
|
274
|
-
// Use theme's responsive values
|
|
275
|
-
const cardStyle = {
|
|
276
|
-
borderRadius: theme.borderRadius.md,
|
|
277
|
-
boxShadow: theme.boxShadow.DEFAULT,
|
|
278
|
-
};
|
|
279
|
-
```
|
|
338
|
+
**After:**
|
|
280
339
|
|
|
281
|
-
|
|
340
|
+
```tsx
|
|
341
|
+
<div className="bg-background text-foreground">Content</div>
|
|
342
|
+
```
|
|
282
343
|
|
|
283
|
-
###
|
|
344
|
+
### From Custom Components to Theme-Aware Components
|
|
284
345
|
|
|
285
|
-
|
|
346
|
+
**Before:**
|
|
286
347
|
|
|
287
|
-
```
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
348
|
+
```tsx
|
|
349
|
+
<button
|
|
350
|
+
style={{
|
|
351
|
+
backgroundColor: theme.components.buttons.primary.background,
|
|
352
|
+
color: theme.components.buttons.primary.text,
|
|
353
|
+
borderRadius: theme.components.buttons.primary.borderRadius,
|
|
354
|
+
}}
|
|
355
|
+
>
|
|
356
|
+
Button
|
|
357
|
+
</button>
|
|
295
358
|
```
|
|
296
359
|
|
|
297
|
-
|
|
360
|
+
**After:**
|
|
298
361
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
```typescript
|
|
302
|
-
import { defaultTheme } from './themes/default';
|
|
303
|
-
|
|
304
|
-
const extendedTheme: DefaultTheme = {
|
|
305
|
-
...defaultTheme,
|
|
306
|
-
name: 'extended',
|
|
307
|
-
colors: {
|
|
308
|
-
...defaultTheme.colors,
|
|
309
|
-
primary: {
|
|
310
|
-
// Override primary colors
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
};
|
|
362
|
+
```tsx
|
|
363
|
+
<Button className="themed-button">Button</Button>
|
|
314
364
|
```
|
|
315
365
|
|
|
316
366
|
## Troubleshooting
|
|
317
367
|
|
|
318
|
-
###
|
|
368
|
+
### Theme Not Applying
|
|
319
369
|
|
|
320
|
-
1.
|
|
370
|
+
1. Ensure CSS is imported: `import '@admin-layout/tailwind-design-pro/src/styles/index.css'`
|
|
371
|
+
2. Check that `ThemeProviderTailwind` wraps your app
|
|
372
|
+
3. Verify theme name is valid: `'default'`, `'airbnb'`, `'slack'`, `'github'`, `'spotify'`
|
|
321
373
|
|
|
322
|
-
|
|
323
|
-
- Check if the theme name matches one of the available themes
|
|
324
|
-
- Verify that the settings prop is correctly configured
|
|
374
|
+
### Dark Mode Not Working
|
|
325
375
|
|
|
326
|
-
|
|
376
|
+
1. Check `navTheme` setting: `'light'` or `'dark'`
|
|
377
|
+
2. Ensure `darkMode: 'class'` in Tailwind config
|
|
378
|
+
3. Verify CSS custom properties are being applied
|
|
327
379
|
|
|
328
|
-
|
|
329
|
-
- Verify that the dark mode classes are being applied to the document
|
|
330
|
-
- Ensure localStorage is accessible in your environment
|
|
380
|
+
### Components Not Styled
|
|
331
381
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
- Ensure the theme name is correctly referenced in the settings
|
|
382
|
+
1. Use theme-aware classes: `themed-button`, `themed-card`, etc.
|
|
383
|
+
2. Import components from `@admin-layout/tailwind-ui`
|
|
384
|
+
3. Check that CSS custom properties are loaded
|
|
336
385
|
|
|
337
386
|
## Contributing
|
|
338
387
|
|
|
339
388
|
When contributing to the theme system:
|
|
340
389
|
|
|
341
|
-
1. Follow the
|
|
342
|
-
2.
|
|
343
|
-
3.
|
|
344
|
-
4.
|
|
345
|
-
5.
|
|
390
|
+
1. **Follow the CSS Custom Properties pattern**
|
|
391
|
+
2. **Use semantic color names**
|
|
392
|
+
3. **Test across all themes**
|
|
393
|
+
4. **Ensure accessibility compliance**
|
|
394
|
+
5. **Update documentation for new features**
|
|
395
|
+
|
|
396
|
+
## Examples
|
|
397
|
+
|
|
398
|
+
See the demo applications for complete examples:
|
|
399
|
+
|
|
400
|
+
- `packages-modules/demo/tailwind-browser` - Tailwind examples
|
|
401
|
+
- `packages-modules/demo/chakra-browser` - Chakra UI examples
|
|
@@ -49,5 +49,10 @@
|
|
|
49
49
|
"mobile_background": "Mobile Background",
|
|
50
50
|
"device_settings": "Device Settings",
|
|
51
51
|
"desktop_tab": "Desktop",
|
|
52
|
-
"mobile_tab": "Mobile"
|
|
52
|
+
"mobile_tab": "Mobile",
|
|
53
|
+
"invitation_settings": "Invitation Settings",
|
|
54
|
+
"show_email_invite": "Show Email Invite",
|
|
55
|
+
"show_sms_invite": "Show SMS Invite",
|
|
56
|
+
"show_qr_code_invite": "Show QR Code Invite",
|
|
57
|
+
"show_invite_link": "Show Invite Link"
|
|
53
58
|
}
|
|
@@ -49,5 +49,10 @@
|
|
|
49
49
|
"mobile_background": "Fondo Móvil",
|
|
50
50
|
"device_settings": "Configuración de Dispositivo",
|
|
51
51
|
"desktop_tab": "Escritorio",
|
|
52
|
-
"mobile_tab": "Móvil"
|
|
52
|
+
"mobile_tab": "Móvil",
|
|
53
|
+
"invitation_settings": "Configuración de Invitaciones",
|
|
54
|
+
"show_email_invite": "Mostrar Invitación por Correo Electrónico",
|
|
55
|
+
"show_sms_invite": "Mostrar Invitación por SMS",
|
|
56
|
+
"show_qr_code_invite": "Mostrar Invitación por Código QR",
|
|
57
|
+
"show_invite_link": "Mostrar Enlace de Invitación"
|
|
53
58
|
}
|