@clickhouse/click-ui 0.0.237-sc-deprecation.1 → 0.0.238

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 (130) hide show
  1. package/README.md +20 -161
  2. package/dist/click-ui.bundled.es.js +49537 -41533
  3. package/dist/click-ui.bundled.es.js.map +1 -0
  4. package/dist/click-ui.bundled.umd.js +53057 -78
  5. package/dist/click-ui.bundled.umd.js.map +1 -0
  6. package/dist/click-ui.es.js +48004 -41168
  7. package/dist/click-ui.es.js.map +1 -0
  8. package/dist/click-ui.umd.js +51888 -78
  9. package/dist/click-ui.umd.js.map +1 -0
  10. package/dist/components/Accordion/Accordion.d.ts +3 -3
  11. package/dist/components/Alert/Alert.d.ts +9 -3
  12. package/dist/components/AutoComplete/AutoComplete.d.ts +1 -0
  13. package/dist/components/Avatar/Avatar.d.ts +1 -1
  14. package/dist/components/Badge/Badge.d.ts +1 -1
  15. package/dist/components/BigStat/BigStat.d.ts +1 -1
  16. package/dist/components/Button/Button.d.ts +1 -1
  17. package/dist/components/ButtonGroup/ButtonGroup.d.ts +1 -1
  18. package/dist/components/CardHorizontal/CardHorizontal.d.ts +1 -1
  19. package/dist/components/CardPrimary/CardPrimaryTopBadge.d.ts +3 -14
  20. package/dist/components/CardPromotion/CardPromotion.d.ts +1 -1
  21. package/dist/components/CardSecondary/CardSecondary.d.ts +1 -1
  22. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  23. package/dist/components/ClickUIProvider/ClickUIProvider.d.ts +15 -0
  24. package/dist/components/CodeBlock/CodeBlock.d.ts +1 -1
  25. package/dist/components/CodeBlock/useColorStyle.d.ts +1 -1
  26. package/dist/components/Collapsible/Collapsible.d.ts +3 -3
  27. package/dist/components/Container/Container.d.ts +6 -5
  28. package/dist/components/DatePicker/Common.d.ts +3 -8
  29. package/dist/components/Dialog/Dialog.d.ts +2 -2
  30. package/dist/components/EllipsisContent/EllipsisContent.d.ts +6 -4
  31. package/dist/components/FileTabs/FileTabs.d.ts +2 -2
  32. package/dist/components/Flyout/Flyout.d.ts +1 -1
  33. package/dist/components/GenericMenu.d.ts +10 -22
  34. package/dist/components/Grid/Cell.d.ts +1 -2
  35. package/dist/components/Grid/StyledCell.d.ts +2 -5
  36. package/dist/components/Grid/types.d.ts +1 -1
  37. package/dist/components/GridContainer/GridContainer.d.ts +5 -4
  38. package/dist/components/Icon/IconCommon.d.ts +3 -3
  39. package/dist/components/Icon/types.d.ts +0 -2
  40. package/dist/components/IconWrapper/IconWrapper.d.ts +2 -2
  41. package/dist/components/Input/InputWrapper.d.ts +18 -25
  42. package/dist/components/Link/Link.d.ts +6 -4
  43. package/dist/components/Link/common.d.ts +7 -0
  44. package/dist/components/Logos/Logo.d.ts +1 -1
  45. package/dist/components/MultiAccordion/MultiAccordion.d.ts +1 -1
  46. package/dist/components/Panel/Panel.d.ts +1 -1
  47. package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
  48. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  49. package/dist/components/Select/common/SelectStyled.d.ts +26 -24
  50. package/dist/components/Separator/Separator.d.ts +3 -4
  51. package/dist/components/SidebarNavigationItem/SidebarNavigationItem.d.ts +9 -5
  52. package/dist/components/SidebarNavigationTitle/SidebarNavigationTitle.d.ts +7 -5
  53. package/dist/components/Spacer/Spacer.d.ts +1 -2
  54. package/dist/components/SplitButton/SplitButton.d.ts +1 -1
  55. package/dist/components/Tabs/Tabs.d.ts +24 -26
  56. package/dist/components/Typography/Text/Text.d.ts +5 -4
  57. package/dist/components/VerticalStepper/VerticalStepper.d.ts +2 -2
  58. package/dist/components/commonElement.d.ts +17 -21
  59. package/dist/components/commonTypes.d.ts +1 -1
  60. package/dist/components/icons/HorizontalLoading.d.ts +1 -3
  61. package/dist/components/icons/Loading.d.ts +1 -1
  62. package/dist/components/icons/LoadingAnimated.d.ts +1 -3
  63. package/dist/components/index.d.ts +3 -6
  64. package/dist/components/types.d.ts +83 -51
  65. package/dist/index.d.ts +1 -77
  66. package/dist/styles/variables.classic.json.d.ts +993 -0
  67. package/dist/{theme/tokens → styles}/variables.dark.json.d.ts +117 -117
  68. package/dist/{theme/tokens → styles}/variables.light.json.d.ts +142 -142
  69. package/dist/theme/index.d.ts +12 -6
  70. package/dist/theme/theme.d.ts +7 -0
  71. package/dist/utils/test-utils.d.ts +3 -1
  72. package/package.json +14 -40
  73. package/bin/README.md +0 -178
  74. package/bin/click-ui.config.example.ts +0 -70
  75. package/bin/click-ui.js +0 -97
  76. package/bin/commands/build-default-theme.ts +0 -48
  77. package/bin/commands/generate.js +0 -117
  78. package/bin/commands/init.js +0 -110
  79. package/bin/utils/config-loader.ts +0 -61
  80. package/bin/utils/css-generator.js +0 -32
  81. package/dist/components/Link/linkStyles.d.ts +0 -134
  82. package/dist/components/ThemeToggle/ThemeToggle.d.ts +0 -4
  83. package/dist/config/tokens/types.d.ts +0 -15296
  84. package/dist/config/tokens/types.d.ts.map +0 -1
  85. package/dist/config/tokens/types.js +0 -2
  86. package/dist/config/tokens/types.js.map +0 -1
  87. package/dist/config/types.d.ts +0 -55
  88. package/dist/config/types.d.ts.map +0 -1
  89. package/dist/config/types.js +0 -2
  90. package/dist/config/types.js.map +0 -1
  91. package/dist/config/utils/css-builder.d.ts +0 -38
  92. package/dist/config/utils/css-builder.d.ts.map +0 -1
  93. package/dist/config/utils/css-builder.js +0 -56
  94. package/dist/config/utils/css-builder.js.map +0 -1
  95. package/dist/config/utils/css-generator.d.ts +0 -25
  96. package/dist/config/utils/css-generator.d.ts.map +0 -1
  97. package/dist/config/utils/css-generator.js +0 -151
  98. package/dist/config/utils/css-generator.js.map +0 -1
  99. package/dist/config/utils/find-config.d.ts +0 -17
  100. package/dist/config/utils/find-config.d.ts.map +0 -1
  101. package/dist/config/utils/find-config.js +0 -28
  102. package/dist/config/utils/find-config.js.map +0 -1
  103. package/dist/cui-components.css +0 -1
  104. package/dist/cui-default-theme.css +0 -1809
  105. package/dist/cui.css +0 -3
  106. package/dist/stories/ChartColorComponent.d.ts +0 -1
  107. package/dist/stories/chart-examples/ChartTooltip.d.ts +0 -12
  108. package/dist/stories/chart-examples/ColorSwatchesChart.d.ts +0 -1
  109. package/dist/stories/chart-examples/GroupedBarChart.d.ts +0 -1
  110. package/dist/stories/chart-examples/MultiLineChart.d.ts +0 -1
  111. package/dist/stories/chart-examples/StackedAreaChart.d.ts +0 -1
  112. package/dist/stories/chart-examples/StackedBarChartDemo.d.ts +0 -1
  113. package/dist/theme/ClickUIProvider/ClickUIProvider.d.ts +0 -5
  114. package/dist/theme/ClickUIProvider/ServerClickUIProvider.d.ts +0 -23
  115. package/dist/theme/ClickUIProvider/context.d.ts +0 -24
  116. package/dist/theme/ClickUIProvider/hooks.d.ts +0 -4
  117. package/dist/theme/ClickUIProvider/index.d.ts +0 -6
  118. package/dist/theme/ClickUIProvider/types.d.ts +0 -39
  119. package/dist/theme/config.d.ts +0 -22
  120. package/dist/theme/hooks/useSystemColorSchemePreference.d.ts +0 -7
  121. package/dist/theme/types.d.ts +0 -54
  122. package/dist/theme/utils/css-builder.d.ts +0 -37
  123. package/dist/theme/utils/css-generator.d.ts +0 -25
  124. package/dist/theme/utils/find-config.d.ts +0 -16
  125. package/dist/theme/utils/theme-attribute.d.ts +0 -13
  126. package/dist/theme/utils.d.ts +0 -29
  127. package/dist/utils/capitalize.d.ts +0 -12
  128. package/dist/utils/polymorphic/index.d.ts +0 -48
  129. /package/dist/{theme/tokens → styles}/types.d.ts +0 -0
  130. /package/dist/{theme/tokens → styles}/variables.json.d.ts +0 -0
package/README.md CHANGED
@@ -6,175 +6,34 @@ The home of the ClickHouse design system and component library. Click UI is in v
6
6
 
7
7
  Click UI has been tested in NextJS, Gatsby, and Vite. If you run into problems using it in your app, please create an issue and our team will try to answer.
8
8
 
9
- ### Quick Start
10
-
11
- 1. **Install Click UI**
12
- ```bash
13
- npm install @clickhouse/click-ui
14
- ```
15
-
16
- 2. **Import the required styles**
17
-
18
- Add these imports at the top of your main application file (before other styles):
19
-
20
- **Option A: Simple (Recommended for most projects)**
21
- ```typescript
22
- // All-in-one: Includes both component styles and default theme
23
- import '@clickhouse/click-ui/cui.css';
24
- ```
25
-
26
- **Option B: Granular (For custom theming)**
27
- ```typescript
28
- // Component styles only
29
- import '@clickhouse/click-ui/cui-components.css';
30
-
31
- // Default theme (light + dark with automatic switching)
32
- import '@clickhouse/click-ui/cui-default-theme.css';
33
-
34
- // OR import your custom theme instead:
35
- // import './my-custom-theme.css';
36
- ```
37
-
38
- **Where to import:**
39
- - **Next.js App Router**: Add to your root `layout.tsx`
40
- - **Next.js Pages Router**: Add to `pages/_app.tsx`
41
- - **Gatsby**: Add to `gatsby-browser.js`
42
- - **Vite/React**: Add to `main.tsx` or `App.tsx`
43
-
44
- 3. **Wrap your app with ClickUIProvider**
45
-
46
- ```typescript
47
- import '@clickhouse/click-ui/cui.css';
48
- import { ClickUIProvider, Text, Title } from '@clickhouse/click-ui'
49
-
50
- function App() {
51
- return (
52
- <ClickUIProvider>
53
- <Title type='h1'>Click UI Example</Title>
54
- <Text>Welcome to Click UI!</Text>
55
- </ClickUIProvider>
56
- )
57
- }
58
-
59
- export default App
60
- ```
61
-
62
- ### Customizing Your Theme
63
-
64
- Click UI supports extensive theming through a CLI-based approach:
65
-
66
- #### Step 1: Create a config file
67
-
68
- ```bash
69
- npx click-ui init
70
- ```
71
-
72
- This creates a `click-ui.config.ts` file in your project root.
73
-
74
- #### Step 2: Customize your theme
9
+ 1. Navigate to your app's route and run
10
+ `npm i @clickhouse/click-ui`
11
+ or
12
+ `yarn add @clickhouse/click-ui`
13
+ 2. Make sure to wrap your application in the Click UI `ClickUIProvider`, without doing this, you may run into issues with styled-components. Once thats done, you'll be able to import the individual components that you want to use on each page. Here's an example an `App.tsx` in NextJS.
75
14
 
76
15
  ```typescript
77
- // click-ui.config.ts
78
- export default {
79
- // Light mode theme tokens
80
- theme: {
81
- button: {
82
- color: {
83
- primary: {
84
- 'background-default': '#FF6B00',
85
- 'background-hover': '#FF8533',
86
- }
87
- }
88
- }
89
- },
90
-
91
- // Dark mode overrides
92
- dark: {
93
- button: {
94
- color: {
95
- primary: {
96
- 'background-default': '#FF8533',
97
- 'background-hover': '#FFA366',
98
- }
99
- }
100
- }
101
- },
102
-
103
- // Runtime configuration (optional)
104
- storageKey: 'my-app-theme',
105
- tooltipConfig: { delayDuration: 200 }
106
- }
107
- ```
16
+ import { ClickUIProvider, Text, ThemeName, Title, Switch } from '@clickhouse/click-ui'
108
17
 
109
- #### Step 3: Generate your custom theme CSS
18
+ function App() {
19
+ const [theme, setTheme] = useState<ThemeName>('dark')
110
20
 
111
- ```bash
112
- npx click-ui generate
113
- ```
21
+ const toggleTheme = () => {
22
+ theme === 'dark' ? setTheme('light') : setTheme('dark')
23
+ }
114
24
 
115
- This creates `cui-custom-theme.css` in your `public/` folder.
25
+ return (
26
+ <ClickUIProvider theme={theme} config={{tooltip:{ delayDuration: 0 }}}>
27
+ <Switch checked={theme === 'dark'} onClick={() => toggleTheme() } />
116
28
 
117
- #### Step 4: Import your custom theme instead of the default
118
-
119
- ```typescript
120
- import '@clickhouse/click-ui/cui-components.css'; // Component styles only
121
- import './public/cui-custom-theme.css'; // Your custom theme
122
- import { ClickUIProvider } from '@clickhouse/click-ui'
123
- ```
124
-
125
- **Resources:**
126
- - **[CLI Theme Generation](CLI_THEME_GENERATION.md)** - Complete CLI documentation
127
- - **[Theme System](src/theme/index.md)** - Runtime theming, hooks, and theme switching
128
- - **[Build-Time Configuration](BUILD_TIME_CONFIG_CLICK_UI.md)** - Theme config API reference
129
-
130
- ---
131
-
132
- ## How It Works
133
-
134
- Click UI uses a **pre-built CSS approach** for optimal performance:
135
-
136
- 1. **CSS Files Generated at Build Time**
137
- - Default theme included in the library (~10 KB)
138
- - Custom themes generated via CLI
139
- - Uses CSS `light-dark()` function for automatic theme switching
140
-
141
- 2. **Minimal Runtime JavaScript**
142
- - Provider only sets `data-theme` attribute (~600 bytes)
143
- - Zero runtime CSS generation
144
- - Instant theme switching via CSS attributes
145
-
146
- 3. **Perfect Tree-Shaking**
147
- - Import only the components you use
148
- - Unused CSS automatically eliminated by your bundler
149
- - Optimal bundle size
150
-
151
- ### Theme Switching
152
-
153
- Themes are controlled via HTML attributes and CSS custom properties:
154
-
155
- ```html
156
- <!-- Light mode -->
157
- <html data-theme="light">
158
-
159
- <!-- Dark mode -->
160
- <html data-theme="dark">
161
-
162
- <!-- System preference mode (automatic) -->
163
- <html data-theme="system">
164
- ```
165
-
166
- All theme tokens are available as CSS variables with the `--click` prefix:
167
-
168
- ```css
169
- .my-component {
170
- background: var(--click-global-color-background-default);
171
- color: var(--click-global-color-text-default);
29
+ <Title type='h1'>Click UI Example</Title>
30
+ <Text>Welcome to Click UI. Get started here.</Text>
31
+ </ClickUIProvider>
32
+ )
172
33
  }
173
- ```
174
34
 
175
- The provider automatically sets the theme attribute based on user preference and system settings.
176
-
177
- ---
35
+ export default App
36
+ ```
178
37
 
179
38
  ## To develop this library locally 🚀
180
39