@clickhouse/click-ui 0.2.0-rc.6 → 0.2.0-rc.8

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 (86) hide show
  1. package/README.md +67 -0
  2. package/dist/cjs/click-ui.css +3861 -0
  3. package/dist/cjs/components/Button/Button.css +261 -0
  4. package/dist/cjs/components/Button/Button.module.css.cjs +38 -0
  5. package/dist/cjs/components/Button/Button.module.css.cjs.map +1 -0
  6. package/dist/cjs/components/Button/index.cjs +42 -126
  7. package/dist/cjs/components/Button/index.cjs.map +1 -1
  8. package/dist/cjs/components/ButtonGroup/index.cjs +1 -1
  9. package/dist/cjs/components/ButtonGroup/index.cjs.map +1 -1
  10. package/dist/cjs/components/DatePicker/Common.cjs +100 -73
  11. package/dist/cjs/components/DatePicker/Common.cjs.map +1 -1
  12. package/dist/cjs/components/DatePicker/DateRangePicker.cjs +24 -24
  13. package/dist/cjs/components/DatePicker/DateRangePicker.cjs.map +1 -1
  14. package/dist/cjs/components/DatePicker/DateTimeRangePicker.cjs +96 -50
  15. package/dist/cjs/components/DatePicker/DateTimeRangePicker.cjs.map +1 -1
  16. package/dist/cjs/components/DatePicker/index.cjs +29 -18
  17. package/dist/cjs/components/DatePicker/index.cjs.map +1 -1
  18. package/dist/cjs/components/DatePicker/utils.cjs +42 -14
  19. package/dist/cjs/components/DatePicker/utils.cjs.map +1 -1
  20. package/dist/cjs/components/GenericMenu/index.cjs +1 -1
  21. package/dist/cjs/components/GenericMenu/index.cjs.map +1 -1
  22. package/dist/cjs/lib/cva.cjs +15 -0
  23. package/dist/cjs/lib/cva.cjs.map +1 -0
  24. package/dist/cjs/providers/ThemeProvider.cjs +4 -0
  25. package/dist/cjs/providers/ThemeProvider.cjs.map +1 -1
  26. package/dist/cjs/theme/styles/tokens-dark.css +1806 -0
  27. package/dist/cjs/theme/styles/tokens-light.css +1795 -0
  28. package/dist/cjs/theme/theme.config.json.cjs +12 -0
  29. package/dist/cjs/theme/theme.config.json.cjs.map +1 -0
  30. package/dist/cjs/theme/tokens/variables.dark.cjs +2 -4
  31. package/dist/cjs/theme/tokens/variables.dark.cjs.map +1 -1
  32. package/dist/cjs/theme/tokens/variables.light.cjs +1 -6
  33. package/dist/cjs/theme/tokens/variables.light.cjs.map +1 -1
  34. package/dist/cjs/utils/localStorage.cjs +3 -1
  35. package/dist/cjs/utils/localStorage.cjs.map +1 -1
  36. package/dist/esm/click-ui.css +3861 -0
  37. package/dist/esm/components/Button/Button.css +261 -0
  38. package/dist/esm/components/Button/Button.module.css.js +25 -0
  39. package/dist/esm/components/Button/Button.module.css.js.map +1 -0
  40. package/dist/esm/components/Button/index.js +42 -126
  41. package/dist/esm/components/Button/index.js.map +1 -1
  42. package/dist/esm/components/ButtonGroup/index.js +1 -1
  43. package/dist/esm/components/ButtonGroup/index.js.map +1 -1
  44. package/dist/esm/components/DatePicker/Common.js +101 -74
  45. package/dist/esm/components/DatePicker/Common.js.map +1 -1
  46. package/dist/esm/components/DatePicker/DateRangePicker.js +25 -25
  47. package/dist/esm/components/DatePicker/DateRangePicker.js.map +1 -1
  48. package/dist/esm/components/DatePicker/DateTimeRangePicker.js +97 -51
  49. package/dist/esm/components/DatePicker/DateTimeRangePicker.js.map +1 -1
  50. package/dist/esm/components/DatePicker/index.js +30 -19
  51. package/dist/esm/components/DatePicker/index.js.map +1 -1
  52. package/dist/esm/components/DatePicker/utils.js +36 -10
  53. package/dist/esm/components/DatePicker/utils.js.map +1 -1
  54. package/dist/esm/components/GenericMenu/index.js +1 -1
  55. package/dist/esm/components/GenericMenu/index.js.map +1 -1
  56. package/dist/esm/lib/cva.js +7 -0
  57. package/dist/esm/lib/cva.js.map +1 -0
  58. package/dist/esm/providers/ThemeProvider.js +4 -0
  59. package/dist/esm/providers/ThemeProvider.js.map +1 -1
  60. package/dist/esm/theme/styles/tokens-dark.css +1806 -0
  61. package/dist/esm/theme/styles/tokens-light.css +1795 -0
  62. package/dist/esm/theme/theme.config.json.js +7 -0
  63. package/dist/esm/theme/theme.config.json.js.map +1 -0
  64. package/dist/esm/theme/tokens/variables.dark.js +2 -4
  65. package/dist/esm/theme/tokens/variables.dark.js.map +1 -1
  66. package/dist/esm/theme/tokens/variables.light.js +1 -6
  67. package/dist/esm/theme/tokens/variables.light.js.map +1 -1
  68. package/dist/esm/utils/localStorage.js +3 -1
  69. package/dist/esm/utils/localStorage.js.map +1 -1
  70. package/dist/types/components/Button/Button.d.ts +25 -2
  71. package/dist/types/components/DatePicker/Common.d.ts +9 -4
  72. package/dist/types/components/DatePicker/DatePicker.d.ts +11 -2
  73. package/dist/types/components/DatePicker/DateRangePicker.d.ts +3 -2
  74. package/dist/types/components/DatePicker/DateTimeRangePicker.d.ts +7 -3
  75. package/dist/types/components/DatePicker/index.d.ts +3 -2
  76. package/dist/types/components/DatePicker/utils.d.ts +9 -8
  77. package/dist/types/index.d.ts +1 -1
  78. package/dist/types/lib/cva.d.ts +3 -0
  79. package/dist/types/theme/theme.config.json.d.ts +6 -0
  80. package/dist/types/theme/theme.core.d.ts +0 -7
  81. package/dist/types/theme/tokens/variables.dark.d.ts +0 -2
  82. package/dist/types/theme/tokens/variables.light.d.ts +0 -5
  83. package/dist/types/utils/dom.d.ts +1 -1
  84. package/dist/types/utils/localStorage.d.ts +1 -1
  85. package/package.json +26 -10
  86. package/dist/types/components/DatePicker/DatePicker.types.d.ts +0 -9
package/README.md CHANGED
@@ -18,11 +18,13 @@ You can find the official docs for the Click UI design system and component libr
18
18
  ## Overview
19
19
 
20
20
  * [Requirements](#requirements)
21
+ * [Browser Support](#browser-support)
21
22
  * [Quick Start](#quick-start)
22
23
  * [Development](#development)
23
24
  - [Generating design tokens](#generating-design-tokens)
24
25
  - [Local development](#local-development)
25
26
  - [Circular dependency check](#circular-dependency-check)
27
+ - [CSS Modules](#css-modules)
26
28
  * [Tests](#Tests)
27
29
  - [Functional tests](#functional-tests)
28
30
  - [Visual regression tests](#visual-regression-tests)
@@ -55,6 +57,27 @@ You can find the official docs for the Click UI design system and component libr
55
57
  - Nodejs (>= 22.12.x) as runtime
56
58
  - Yarn (>= 4.5.3) for development, any other package manager in a host project
57
59
 
60
+ ## Browser Support
61
+
62
+ Click UI targets modern browsers from the last 4 years with significant market share (>0.5%). This ensures broad compatibility while allowing the use of modern CSS features.
63
+
64
+ | Browser | Minimum Version |
65
+ |---------|-----------------|
66
+ | Chrome | 100+ |
67
+ | Edge | 100+ |
68
+ | Firefox | 99+ |
69
+ | Safari | 15.5+ |
70
+
71
+ The following browsers are explicitly **not supported** due to limited CSS feature support:
72
+ - QQ Browser
73
+ - Baidu Browser
74
+ - UC Browser
75
+ - KaiOS Browser
76
+ - Opera Mini
77
+
78
+ > [!NOTE]
79
+ > The browser support list is defined in `.browserslistrc` and enforced via CSS linting during development. CSS features that aren't supported by the target browsers will trigger linting errors.
80
+
58
81
  ## Quick Start
59
82
 
60
83
  Install the package via npm or your favourite package manager:
@@ -144,6 +167,50 @@ By avoiding local preview files, we ensure that component experimentation happen
144
167
 
145
168
  To get started with the development playground, refer to the Storybook section [here](#storybook).
146
169
 
170
+ ### CSS Modules
171
+
172
+ This library uses [CSS Modules](https://github.com/css-modules/css-modules) for styling and is distributed unbundled, giving your application full control over bundling and optimizations. This means you only include what you actually use, resulting in smaller bundle sizes and better performance!
173
+
174
+ Most modern React frameworks support CSS Modules out of the box, including Next.js, Vite, Create React App, and TanStack Start, with no configuration required.
175
+
176
+ > [!IMPORTANT]
177
+ > **Next.js apps** must add `@clickhouse/click-ui` to `transpilePackages` configuration (available in Next.js 13+):
178
+ > ```js
179
+ > // next.config.ts
180
+ > module.exports = {
181
+ > transpilePackages: ['@clickhouse/click-ui'],
182
+ > };
183
+ > ```
184
+ > This is required because Next.js restricts global CSS imports from `node_modules` by default. Transpiling the package allows Next.js to process the CSS through its build pipeline. See the [Next.js example](docs/examples/nextjs-app-router-with-ssr.md) for full setup instructions.
185
+
186
+ > [!NOTE]
187
+ > We're currently migrating from Styled-Components to CSS Modules. Some components may still use Styled-Components during this transition period.
188
+
189
+ #### Benefits
190
+
191
+ CSS Modules align naturally with component-level imports. When you import a component like `Button`, its `Button.module.css` is automatically included. If you don't use the component, neither the JavaScript, or CSS will be bundled in your application's output. Only the necessary stylesheets will be included in the output bundle.
192
+
193
+ #### Custom Build Configurations
194
+
195
+ Although most modern React setups have CSS Modules built-in, if your build tool doesn't support it by default, you'll need to configure it.
196
+
197
+ Let's assume you have an old Webpack setup. Here's an example of how that'd look like:
198
+
199
+ ```js
200
+ {
201
+ test: /\.module\.css$/,
202
+ use: [
203
+ 'style-loader',
204
+ {
205
+ loader: 'css-loader',
206
+ options: { modules: true }
207
+ }
208
+ ]
209
+ }
210
+ ```
211
+
212
+ For other bundlers, refer to their documentation on CSS Modules configuration.
213
+
147
214
  ## Tests
148
215
 
149
216
  ### Functional tests