@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.
Files changed (114) hide show
  1. package/README.md +306 -250
  2. package/lib/cdm-locales/en/settings.json +6 -1
  3. package/lib/cdm-locales/es/settings.json +6 -1
  4. package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
  5. package/lib/components/LanguageMenu/LanguageMenu.js +8 -18
  6. package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
  7. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  8. package/lib/components/Layout/BasicLayout/index.js +18 -28
  9. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  10. package/lib/components/Layout/BasicLayout/utils.js +1 -14
  11. package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
  12. package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
  13. package/lib/components/Layout/GlobalHeader/Header.js +30 -31
  14. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  15. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
  16. package/lib/components/Layout/GlobalHeader/MainHeader.js +25 -27
  17. package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
  18. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
  19. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +4 -4
  20. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
  21. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
  22. package/lib/components/Layout/GlobalHeader/RightMenu.js +13 -29
  23. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
  24. package/lib/components/Layout/GlobalHeader/SearchBar.d.ts.map +1 -1
  25. package/lib/components/Layout/GlobalHeader/SearchBar.js +7 -7
  26. package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
  27. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +1 -1
  28. package/lib/components/Layout/Sidebar/Sidebar.js +32 -38
  29. package/lib/components/Layout/Sidebar/Sidebar.js.map +1 -1
  30. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +1 -1
  31. package/lib/components/Layout/Sidebar/SidebarMenu.js +25 -32
  32. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +1 -1
  33. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  34. package/lib/components/Layout/TailwindLayout.js +7 -3
  35. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  36. package/lib/components/SettingDrawer/InvitationSettings.d.ts +3 -0
  37. package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +1 -0
  38. package/lib/components/SettingDrawer/InvitationSettings.js +79 -0
  39. package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -0
  40. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  41. package/lib/components/SettingDrawer/SettingDrawer.js +8 -2
  42. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  43. package/lib/components/UI/PropertyCard.d.ts.map +1 -1
  44. package/lib/components/UI/PropertyCard.js +73 -31
  45. package/lib/components/UI/PropertyCard.js.map +1 -1
  46. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +7 -3
  47. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
  48. package/lib/components/index.d.ts +0 -1
  49. package/lib/components/index.d.ts.map +1 -1
  50. package/lib/components/index.js +1 -1
  51. package/lib/compute.d.ts.map +1 -1
  52. package/lib/compute.js.map +1 -1
  53. package/lib/config/analytics-config.d.ts +59 -0
  54. package/lib/config/analytics-config.d.ts.map +1 -0
  55. package/lib/config/env-config.d.ts +3 -0
  56. package/lib/config/env-config.d.ts.map +1 -1
  57. package/lib/config/env-config.js +11 -1
  58. package/lib/config/env-config.js.map +1 -1
  59. package/lib/config/index.d.ts +3 -0
  60. package/lib/config/index.d.ts.map +1 -0
  61. package/lib/index.d.ts +0 -1
  62. package/lib/index.d.ts.map +1 -1
  63. package/lib/index.js +1 -1
  64. package/lib/index.js.map +1 -1
  65. package/lib/redux/searchReducer.d.ts +1 -1
  66. package/lib/redux/searchReducer.d.ts.map +1 -1
  67. package/lib/redux/searchReducer.js.map +1 -1
  68. package/lib/styles/index-bk.css +443 -0
  69. package/lib/styles/index.css +602 -372
  70. package/lib/tailwindConfig.d.ts +85 -27
  71. package/lib/tailwindConfig.d.ts.map +1 -1
  72. package/lib/tailwindConfig.js +96 -18
  73. package/lib/tailwindConfig.js.map +1 -1
  74. package/lib/utils/analytics-utils.d.ts +43 -0
  75. package/lib/utils/analytics-utils.d.ts.map +1 -0
  76. package/lib/utils/analytics.d.ts +48 -0
  77. package/lib/utils/analytics.d.ts.map +1 -0
  78. package/package.json +6 -4
  79. package/lib/components/ThemeProvider/ThemeProvider.d.ts +0 -8
  80. package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +0 -1
  81. package/lib/components/ThemeProvider/ThemeProvider.js +0 -60
  82. package/lib/components/ThemeProvider/ThemeProvider.js.map +0 -1
  83. package/lib/components/ThemeProvider/ThemeToggle.d.ts +0 -7
  84. package/lib/components/ThemeProvider/ThemeToggle.d.ts.map +0 -1
  85. package/lib/components/ThemeProvider/ThemeToggle.js +0 -50
  86. package/lib/components/ThemeProvider/ThemeToggle.js.map +0 -1
  87. package/lib/components/ThemeProvider/index.d.ts +0 -4
  88. package/lib/components/ThemeProvider/index.d.ts.map +0 -1
  89. package/lib/components/ThemeProvider/themes/airbnb.d.ts +0 -3
  90. package/lib/components/ThemeProvider/themes/airbnb.d.ts.map +0 -1
  91. package/lib/components/ThemeProvider/themes/airbnb.js +0 -186
  92. package/lib/components/ThemeProvider/themes/airbnb.js.map +0 -1
  93. package/lib/components/ThemeProvider/themes/default.d.ts +0 -3
  94. package/lib/components/ThemeProvider/themes/default.d.ts.map +0 -1
  95. package/lib/components/ThemeProvider/themes/default.js +0 -183
  96. package/lib/components/ThemeProvider/themes/default.js.map +0 -1
  97. package/lib/components/ThemeProvider/themes/github.d.ts +0 -3
  98. package/lib/components/ThemeProvider/themes/github.d.ts.map +0 -1
  99. package/lib/components/ThemeProvider/themes/github.js +0 -190
  100. package/lib/components/ThemeProvider/themes/github.js.map +0 -1
  101. package/lib/components/ThemeProvider/themes/index.d.ts +0 -15
  102. package/lib/components/ThemeProvider/themes/index.d.ts.map +0 -1
  103. package/lib/components/ThemeProvider/themes/index.js +0 -7
  104. package/lib/components/ThemeProvider/themes/index.js.map +0 -1
  105. package/lib/components/ThemeProvider/themes/slack.d.ts +0 -3
  106. package/lib/components/ThemeProvider/themes/slack.d.ts.map +0 -1
  107. package/lib/components/ThemeProvider/themes/slack.js +0 -188
  108. package/lib/components/ThemeProvider/themes/slack.js.map +0 -1
  109. package/lib/components/ThemeProvider/themes/spotify.d.ts +0 -3
  110. package/lib/components/ThemeProvider/themes/spotify.d.ts.map +0 -1
  111. package/lib/components/ThemeProvider/themes/spotify.js +0 -189
  112. package/lib/components/ThemeProvider/themes/spotify.js.map +0 -1
  113. package/lib/components/ThemeProvider/types.d.ts +0 -112
  114. 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 use across all projects.
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
- - 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
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
- ## Usage in Servers
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. Use the Universal Tailwind Config
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
- Create a `tailwind.config.js` or `tailwind.config.ts` file in your server project and import the universal config:
29
+ ### 3. Configure Tailwind
25
30
 
26
31
  ```typescript
27
- // tailwind.config.ts or tailwind.config.js
32
+ // tailwind.config.ts
28
33
  import { themeConfig } from '@admin-layout/tailwind-design-pro';
29
34
 
30
35
  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
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
- variants: {
48
- typography: ['dark'],
49
- },
50
- plugins: [typography, forms, aspectRatio],
41
+ plugins: [],
51
42
  };
52
43
  ```
53
44
 
54
- # Theme System Documentation
45
+ ### 4. Set up Theme Provider
55
46
 
56
- ## Overview
47
+ ```tsx
48
+ import { ThemeProviderTailwind } from '@admin-layout/tailwind-ui';
57
49
 
58
- The theme system provides a flexible and powerful way to manage the visual appearance of your application. It supports multiple pre-built themes (default, Airbnb, Slack, GitHub, and Spotify) and includes dark mode functionality.
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
- The system comes with several pre-built themes:
68
+ ### 1. Default Theme
63
69
 
64
- - `default`: A neutral theme with standard components
65
- - `airbnb`: Inspired by Airbnb's design system
66
- - `slack`: Based on Slack's color scheme and components
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
- ## Theme Structure
74
+ ### 2. Airbnb Theme
71
75
 
72
- Each theme follows a consistent structure defined by the `DefaultTheme` interface:
76
+ - Warm, welcoming colors
77
+ - Red accent colors
78
+ - Great for hospitality and travel apps
73
79
 
74
- ```typescript
75
- interface DefaultTheme {
76
- name: string;
77
- colors: {
78
- primary: ColorRamp;
79
- secondary: ColorRamp;
80
- accent: ColorRamp;
81
- success: ColorRamp;
82
- warning: ColorRamp;
83
- error: ColorRamp;
84
- neutral: ColorRamp;
85
- background: {
86
- light: string;
87
- dark: string;
88
- };
89
- text: {
90
- light: {
91
- primary: string;
92
- secondary: string;
93
- tertiary: string;
94
- };
95
- dark: {
96
- primary: string;
97
- secondary: string;
98
- tertiary: string;
99
- };
100
- };
101
- };
102
- borderRadius: {
103
- sm: string;
104
- DEFAULT: string;
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
- ## Setting Up the Theme Provider
113
+ ### Text Colors
147
114
 
148
- To use the theme system, wrap your application with the `ThemeProviderTailwind` component:
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
- ```tsx
151
- import { ThemeProviderTailwind } from 'packages/tailwind-design-pro/src/components/ThemeProvider';
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
- const App = () => {
154
- const settings = {
155
- theme: 'default', // or 'airbnb', 'slack', 'github', 'spotify'
156
- themeType: 'light',
157
- primaryColor: '#your-color',
158
- fontFamily: 'your-font-family',
159
- navTheme: 'light', // or 'dark'
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
- return <ThemeProviderTailwind settings={settings}>{/* Your app components */}</ThemeProviderTailwind>;
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
- ## Using the useTheme Hook
187
+ ### Form Components
167
188
 
168
- The `useTheme` hook provides access to the current theme and theme-related functionality. Here's how to use it:
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 'packages/tailwind-design-pro/src/components/ThemeProvider';
208
+ import { useTheme } from '@admin-layout/tailwind-ui';
172
209
 
173
- const YourComponent = () => {
174
- const { themeName, theme, isDarkMode, toggleDarkMode } = useTheme();
210
+ const ThemeSwitcher = () => {
211
+ const { theme, mode, toggleMode, setTheme, setMode } = useTheme();
175
212
 
176
213
  return (
177
- <div>
178
- {/* Access theme colors */}
179
- <div style={{ color: theme.colors.primary[500] }}>Primary Color</div>
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
- Themed Button
189
- </button>
190
-
191
- {/* Toggle dark mode */}
192
- <button onClick={toggleDarkMode}>Toggle {isDarkMode ? 'Light' : 'Dark'} Mode</button>
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
- ### Available Properties from useTheme
199
-
200
- 1. `themeName`: The current theme name ('default', 'airbnb', 'slack', 'github', or 'spotify')
201
- 2. `theme`: The complete theme object containing all styling properties
202
- 3. `isDarkMode`: Boolean indicating if dark mode is active
203
- 4. `toggleDarkMode`: Function to toggle between light and dark modes
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
- ## Theme Features
260
+ ### Theme-Specific Variables
206
261
 
207
- ### 1. Dark Mode Support
262
+ Each theme has its own set of variables:
208
263
 
209
- - Automatically handles dark mode through the `isDarkMode` state
210
- - Persists dark mode preference in localStorage
211
- - Applies appropriate dark mode classes to the document
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
- ### 2. Dynamic Theme Switching
272
+ ## Best Practices
214
273
 
215
- - Themes can be changed dynamically through the settings prop
216
- - All theme properties are immediately applied when changed
274
+ ### 1. Use Theme-Aware Classes
217
275
 
218
- ### 3. Component-Specific Styling
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
- Each theme includes specific styling for common components:
288
+ ### 2. Leverage Semantic Colors
221
289
 
222
- - Buttons (primary and secondary variants)
223
- - Cards
224
- - Input fields
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
- ### 4. Color System
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
- - Each theme includes a comprehensive color system with:
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
- ### 5. Typography
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
- - Customizable font families for different text styles
240
- - Consistent typography settings across themes
314
+ ### 4. Responsive Design
241
315
 
242
- ## Best Practices
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
- 1. **Theme Access**
325
+ ## Migration Guide
245
326
 
246
- ```tsx
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
- 2. **Dark Mode Handling**
329
+ **Before:**
253
330
 
254
- ```tsx
255
- const { isDarkMode, toggleDarkMode } = useTheme();
256
- // Use isDarkMode to conditionally render styles
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
- 3. **Component Styling**
335
+ <div style={{ color: textColor, backgroundColor: theme.colors.background.light }}>Content</div>;
336
+ ```
261
337
 
262
- ```tsx
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
- ## Theme Customization
340
+ ```tsx
341
+ <div className="bg-background text-foreground">Content</div>
342
+ ```
282
343
 
283
- ### Creating a Custom Theme
344
+ ### From Custom Components to Theme-Aware Components
284
345
 
285
- You can create your own theme by following the `DefaultTheme` interface structure:
346
+ **Before:**
286
347
 
287
- ```typescript
288
- const customTheme: DefaultTheme = {
289
- name: 'custom',
290
- colors: {
291
- // Define your color palette
292
- },
293
- // Define other theme properties
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
- ### Extending Existing Themes
360
+ **After:**
298
361
 
299
- You can extend existing themes by importing them and modifying specific properties:
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
- ### Common Issues
368
+ ### Theme Not Applying
319
369
 
320
- 1. **Theme Not Applying**
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
- - Ensure the `ThemeProviderTailwind` is properly wrapped around your application
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
- 2. **Dark Mode Not Working**
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
- - Check if `navTheme` is properly set in the settings
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
- 3. **Custom Styles Not Taking Effect**
333
- - Verify that your custom theme follows the `DefaultTheme` interface
334
- - Check if the theme is properly registered in the themes object
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 existing theme structure
342
- 2. Maintain consistency with other themes
343
- 3. Include both light and dark mode variants
344
- 4. Document any new theme properties or features
345
- 5. Test the theme across different components and scenarios
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
  }