@clickhouse/click-ui 0.0.234-sc-deprecation.7 → 0.0.234-sc-deprecation.9

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 (41) hide show
  1. package/README.md +26 -152
  2. package/bin/commands/init.js +20 -38
  3. package/dist/click-ui.bundled.es.js +5566 -5520
  4. package/dist/click-ui.bundled.umd.js +44 -24
  5. package/dist/click-ui.es.js +5566 -5520
  6. package/dist/click-ui.umd.js +44 -24
  7. package/dist/components/Link/linkStyles.d.ts +3 -3
  8. package/dist/config/core.d.ts +53 -0
  9. package/dist/config/core.d.ts.map +1 -0
  10. package/dist/config/core.js +188 -0
  11. package/dist/config/core.js.map +1 -0
  12. package/dist/config/index.d.ts +51 -0
  13. package/dist/config/index.d.ts.map +1 -0
  14. package/dist/config/index.js +53 -0
  15. package/dist/config/index.js.map +1 -0
  16. package/dist/config/next.d.ts +8 -0
  17. package/dist/config/next.d.ts.map +1 -0
  18. package/dist/config/next.js +72 -0
  19. package/dist/config/next.js.map +1 -0
  20. package/dist/config/rollup.d.ts +8 -0
  21. package/dist/config/rollup.d.ts.map +1 -0
  22. package/dist/config/rollup.js +85 -0
  23. package/dist/config/rollup.js.map +1 -0
  24. package/dist/config/types.d.ts +37 -0
  25. package/dist/config/types.d.ts.map +1 -0
  26. package/dist/config/types.js +5 -0
  27. package/dist/config/types.js.map +1 -0
  28. package/dist/config/vite.d.ts +8 -0
  29. package/dist/config/vite.d.ts.map +1 -0
  30. package/dist/config/vite.js +76 -0
  31. package/dist/config/vite.js.map +1 -0
  32. package/dist/config/webpack.d.ts +8 -0
  33. package/dist/config/webpack.d.ts.map +1 -0
  34. package/dist/config/webpack.js +87 -0
  35. package/dist/config/webpack.js.map +1 -0
  36. package/dist/theme/ClickUIProvider/ServerClickUIProvider.d.ts +3 -4
  37. package/dist/theme/index.d.ts +2 -2
  38. package/dist/theme/types.d.ts +3 -5
  39. package/dist/theme/utils/css-generator.d.ts +12 -0
  40. package/dist/theme/utils.d.ts +7 -0
  41. package/package.json +30 -3
package/README.md CHANGED
@@ -47,171 +47,45 @@ Click UI has been tested in NextJS, Gatsby, and Vite. If you run into problems u
47
47
 
48
48
  ### Customizing Your Theme
49
49
 
50
- To customize the theme with your own colors, spacing, and styles:
50
+ For detailed theming and configuration options, see:
51
+ - **[Theme System Documentation](src/theme/index.md)** - Complete theme system overview
52
+ - **[Build-Time Configuration](BUILD_TIME_CONFIG_CLICK_UI.md)** - Build-time optimization guide
53
+ - **[Bundler Plugins](config/README.md)** - Vite, Webpack, Rollup, and Next.js plugins
51
54
 
52
- 1. **Initialize configuration**
53
- ```bash
54
- npx @clickhouse/click-ui init
55
- ```
56
-
57
- This creates a `click-ui.config.ts` file in your project root.
58
-
59
- 2. **Setup Vite alias** to enable auto-discovery
60
-
61
- In your `vite.config.ts`:
62
- ```ts
63
- import { defineConfig } from 'vite';
64
- import path from 'path';
65
-
66
- export default defineConfig({
67
- resolve: {
68
- alias: {
69
- 'click-ui-config': path.resolve(__dirname, './click-ui.config.ts'),
70
- },
71
- },
72
- });
73
- ```
74
-
75
- 3. **Customize the generated config file**
76
-
77
- ```typescript
78
- import type { ThemeConfig } from '@clickhouse/click-ui/theme';
79
-
80
- const config: ThemeConfig = {
81
- theme: {
82
- global: {
83
- color: {
84
- brand: '#FFCC00',
85
- background: {
86
- default: '#FFFFFF'
87
- }
88
- }
89
- },
90
- button: {
91
- primary: {
92
- background: {
93
- default: '#FFCC00',
94
- hover: '#FFD700'
95
- }
96
- }
97
- }
98
- }
99
- };
100
-
101
- export default config;
102
- ```
103
-
104
- 4. **That's it!** Your custom theme will be automatically loaded by ClickUIProvider.
105
-
106
- #### CLI Options
107
-
108
- ```bash
109
- # Create TypeScript config (default)
110
- npx @clickhouse/click-ui init
111
-
112
- # Create JavaScript config
113
- npx @clickhouse/click-ui init -f js
114
-
115
- # Overwrite existing config
116
- npx @clickhouse/click-ui init --force
117
- ```
118
-
119
- ### Advanced Configuration Options
120
-
121
- The generated config file supports extensive customization:
122
-
123
- #### System Mode Overrides
124
-
125
- Define different styles for light and dark modes:
55
+ **Quick example:**
126
56
 
127
57
  ```typescript
128
- const config: ThemeConfig = {
129
- systemModeOverrides: {
130
- light: {
131
- global: {
132
- color: {
133
- background: { default: '#FFFFFF' }
134
- }
135
- }
136
- },
137
- dark: {
138
- global: {
139
- color: {
140
- background: { default: '#0D1117' },
141
- text: { default: '#F0F6FC' }
142
- }
143
- }
144
- }
145
- }
146
- };
147
- ```
148
-
149
- #### Component-Specific Styling
58
+ import type { ThemeConfig } from '@clickhouse/click-ui/theme';
150
59
 
151
- Customize individual components:
152
-
153
- ```typescript
154
60
  const config: ThemeConfig = {
155
61
  theme: {
156
- button: {
157
- space: { x: '1rem', y: '0.5rem' },
158
- radii: { all: '0.375rem' },
159
- primary: {
160
- background: {
161
- default: '#FFCC00',
162
- hover: '#FFD700'
163
- }
62
+ global: {
63
+ color: {
64
+ brand: '#FFCC00',
65
+ background: { default: '#FFFFFF' }
66
+ }
67
+ }
68
+ },
69
+ // Dark mode overrides
70
+ dark: {
71
+ global: {
72
+ color: {
73
+ background: { default: '#0D1117' },
74
+ text: { default: '#F0F6FC' }
164
75
  }
165
76
  }
166
77
  }
167
78
  };
168
- ```
169
-
170
- ### Manual Theme Control
171
-
172
- You can manually control the theme at runtime:
173
79
 
174
- ```typescript
175
- import { ClickUIProvider, useCUITheme, Switch } from '@clickhouse/click-ui'
176
-
177
- function ThemeToggle() {
178
- const { themeName, toggleTheme } = useCUITheme();
179
-
180
- return (
181
- <Switch
182
- checked={themeName === 'dark'}
183
- onClick={toggleTheme}
184
- />
185
- );
186
- }
187
-
188
- function App() {
189
- return (
190
- <ClickUIProvider theme="dark">
191
- <ThemeToggle />
192
- <Title type='h1'>Click UI Example</Title>
193
- </ClickUIProvider>
194
- )
195
- }
80
+ export default config;
196
81
  ```
197
82
 
198
- ### How It Works
199
-
200
- 1. **Config File**: Create `click-ui.config.ts` in your project root
201
- 2. **Vite Alias**: The alias makes the config discoverable via `'click-ui-config'` import
202
- 3. **Auto-Load**: `ClickUIProvider` automatically imports and applies your config
203
- 4. **Runtime Override**: Props passed to `ClickUIProvider` can override the config
204
-
205
- ### Troubleshooting
206
-
207
- **Config not loading?**
208
- - Verify the Vite alias is correctly set up in `vite.config.ts`
209
- - Ensure `click-ui.config.ts` is in your project root
210
- - Restart your dev server after adding the alias
211
-
212
- **TypeScript errors?**
213
- - Import types from: `import type { ThemeConfig } from '@clickhouse/click-ui/theme';`
214
- - Your IDE will provide autocomplete for all config options
83
+ See the full documentation for advanced features including:
84
+ - CLI tools for config generation
85
+ - Multiple bundler support
86
+ - SSR/RSC compatibility
87
+ - Theme switching and persistence
88
+ - Performance optimization
215
89
 
216
90
  ## To develop this library locally 🚀
217
91
 
@@ -14,6 +14,7 @@ const config: ThemeConfig = {
14
14
  cssPrefix: '--click',
15
15
  storageKey: 'click-ui-theme',
16
16
 
17
+ // Light mode theme (default)
17
18
  theme: {
18
19
  global: {
19
20
  color: {
@@ -34,25 +35,15 @@ const config: ThemeConfig = {
34
35
  }
35
36
  },
36
37
 
37
- systemModeOverrides: {
38
- light: {
39
- global: {
40
- color: {
41
- background: {
42
- default: '#FFFFFF'
43
- }
44
- }
45
- }
46
- },
47
- dark: {
48
- global: {
49
- color: {
50
- background: {
51
- default: '#0D1117'
52
- },
53
- text: {
54
- default: '#F0F6FC'
55
- }
38
+ // Dark mode overrides - if not defined, theme values are used for dark mode too
39
+ dark: {
40
+ global: {
41
+ color: {
42
+ background: {
43
+ default: '#0D1117'
44
+ },
45
+ text: {
46
+ default: '#F0F6FC'
56
47
  }
57
48
  }
58
49
  }
@@ -66,6 +57,7 @@ const config = {
66
57
  cssPrefix: '--click',
67
58
  storageKey: 'click-ui-theme',
68
59
 
60
+ // Light mode theme (default)
69
61
  theme: {
70
62
  global: {
71
63
  color: {
@@ -86,25 +78,15 @@ const config = {
86
78
  }
87
79
  },
88
80
 
89
- systemModeOverrides: {
90
- light: {
91
- global: {
92
- color: {
93
- background: {
94
- default: '#FFFFFF'
95
- }
96
- }
97
- }
98
- },
99
- dark: {
100
- global: {
101
- color: {
102
- background: {
103
- default: '#0D1117'
104
- },
105
- text: {
106
- default: '#F0F6FC'
107
- }
81
+ // Dark mode overrides - if not defined, theme values are used for dark mode too
82
+ dark: {
83
+ global: {
84
+ color: {
85
+ background: {
86
+ default: '#0D1117'
87
+ },
88
+ text: {
89
+ default: '#F0F6FC'
108
90
  }
109
91
  }
110
92
  }