@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
@@ -1,110 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- import fs from "fs";
4
- import path from "path";
5
-
6
- const CONFIG_BODY = ` // Optional: Customize the storage key for theme persistence
7
- // storageKey: 'click-ui-theme',
8
-
9
- // Optional: Customize light mode theme
10
- // theme: {
11
- // global: {
12
- // color: {
13
- // brand: '#FFCC00',
14
- // background: {
15
- // default: '#FFFFFF'
16
- // }
17
- // }
18
- // },
19
- // button: {
20
- // space: {
21
- // x: '1rem',
22
- // y: '0.5rem'
23
- // },
24
- // radii: {
25
- // all: '0.375rem'
26
- // }
27
- // }
28
- // },
29
-
30
- // Optional: Dark mode overrides
31
- // If not defined, theme values are used for dark mode too
32
- // dark: {
33
- // global: {
34
- // color: {
35
- // background: {
36
- // default: '#0D1117'
37
- // },
38
- // text: {
39
- // default: '#F0F6FC'
40
- // }
41
- // }
42
- // }
43
- // },
44
-
45
- // Optional: Tooltip configuration
46
- // tooltipConfig: {
47
- // delayDuration: 100,
48
- // skipDelayDuration: 300,
49
- // disableHoverableContent: false,
50
- // },
51
-
52
- // Optional: Toast configuration
53
- // toastConfig: {
54
- // duration: 4000,
55
- // swipeDirection: 'right',
56
- // swipeThreshold: 50,
57
- // },`;
58
-
59
- const CONFIG_TEMPLATES = {
60
- ts: `import type { ThemeConfig } from '@clickhouse/click-ui/theme';
61
-
62
- const config: ThemeConfig = {
63
- ${CONFIG_BODY}
64
- };
65
-
66
- export default config;
67
- `,
68
- js: `/** @type {import('@clickhouse/click-ui/theme').ThemeConfig} */
69
- const config = {
70
- ${CONFIG_BODY}
71
- };
72
-
73
- export default config;
74
- `
75
- };
76
-
77
- export const initCommand = options => {
78
- const format = options.format === "js" ? "js" : "ts";
79
- const filename = `click-ui.config.${format}`;
80
- const targetPath = path.join(process.cwd(), filename);
81
- const configExt = format === "ts" ? "ts" : "js";
82
-
83
- // Check if config already exists
84
- if (fs.existsSync(targetPath) && !options.force) {
85
- console.error(`❌ ${filename} already exists. Use --force to overwrite.`);
86
- process.exit(1);
87
- }
88
-
89
- // Write config file
90
- try {
91
- fs.writeFileSync(targetPath, CONFIG_TEMPLATES[format], "utf-8");
92
- console.log(`✅ Created ${filename}\n`);
93
- console.log("📝 Next steps:\n");
94
- console.log(` 1. Customize your theme in ${filename}\n`);
95
- console.log(" 2. Generate your custom theme CSS:\n");
96
- console.log(" npx click-ui generate\n");
97
- console.log(" 3. Import the generated CSS in your app:\n");
98
- console.log(" import '@clickhouse/click-ui/style.css';");
99
- console.log(" import './public/cui-custom-theme.css'; // Your custom theme\n");
100
- console.log(" 4. Use ClickUIProvider in your app:\n");
101
- console.log(" import { ClickUIProvider } from '@clickhouse/click-ui';\n");
102
- console.log(" <ClickUIProvider>");
103
- console.log(" {/* Your app */}");
104
- console.log(" </ClickUIProvider>\n");
105
- console.log(" 🎨 Your custom theme will be applied!");
106
- } catch (error) {
107
- console.error(`❌ Failed to create config file: ${error.message}`);
108
- process.exit(1);
109
- }
110
- };
@@ -1,61 +0,0 @@
1
- import { pathToFileURL } from 'url';
2
-
3
- /**
4
- * Load Click UI configuration file
5
- * Handles TypeScript, JavaScript, ESM, and CommonJS formats
6
- *
7
- * @param configFile - Full path to config file
8
- * @returns Loaded configuration object
9
- * @throws Error if config cannot be loaded or TypeScript file without tsx
10
- *
11
- * @example
12
- * ```typescript
13
- * const config = await loadConfig('/path/to/click-ui.config.js');
14
- * console.log('Theme:', config.theme);
15
- * ```
16
- */
17
- export async function loadConfig(configFile: string): Promise<any> {
18
- try {
19
- // For ES modules (.js, .mjs, .ts)
20
- if (configFile.endsWith('.js') || configFile.endsWith('.mjs') || configFile.endsWith('.ts')) {
21
- // TypeScript files require tsx or ts-node
22
- if (configFile.endsWith('.ts')) {
23
- console.log('⚠️ TypeScript config files require tsx or ts-node to be installed');
24
- console.log(' Run: npx tsx node_modules/@clickhouse/click-ui/bin/commands/generate.js');
25
- console.log(' Or convert your config to .js format');
26
- process.exit(1);
27
- }
28
-
29
- // Convert to file URL for proper ESM import
30
- const fileUrl = pathToFileURL(configFile).href;
31
- const module = await import(fileUrl);
32
- return module.default || module;
33
- }
34
-
35
- // For CommonJS (.cjs)
36
- if (configFile.endsWith('.cjs')) {
37
- return require(configFile);
38
- }
39
-
40
- throw new Error(`Unsupported config file extension: ${configFile}`);
41
- } catch (error: any) {
42
- throw new Error(`Failed to load config from ${configFile}: ${error.message}`);
43
- }
44
- }
45
-
46
- /**
47
- * Validate that config has required theme properties
48
- *
49
- * @param config - Configuration object to validate
50
- * @returns true if config has theme or dark properties
51
- *
52
- * @example
53
- * ```typescript
54
- * if (!validateConfig(config)) {
55
- * console.error('Config missing theme configuration');
56
- * }
57
- * ```
58
- */
59
- export function validateConfig(config: any): boolean {
60
- return !!(config && (config.theme || config.dark));
61
- }
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * CSS Generation for CLI
5
- * Used by CLI generate and build-default-theme commands
6
- */
7
-
8
- import { generateLightDarkVariables, generateThemeOverrides } from '../../src/theme/utils/css-generator.js';
9
- import { buildCSSOutput } from '../../src/theme/utils/css-builder.js';
10
-
11
- /**
12
- * Generate CSS from theme config
13
- * Used by CLI generate command
14
- */
15
- export function generateThemeCSS(config) {
16
- if (!config || (!config.theme && !config.dark)) {
17
- return '';
18
- }
19
-
20
- // Get light and dark themes
21
- const lightTheme = config.theme || {};
22
- const darkTheme = { ...config.theme, ...config.dark };
23
-
24
- // Generate variables using light-dark() for colors
25
- const lightDarkVars = generateLightDarkVariables(lightTheme, darkTheme);
26
- const themeOverrides = generateThemeOverrides(lightTheme, darkTheme);
27
-
28
- // Build CSS using shared builder
29
- return buildCSSOutput(lightDarkVars, themeOverrides, {
30
- headerComment: '/* Click UI Custom Theme */\n/* Generated by click-ui generate command */\n/* Uses light-dark() CSS function for automatic theme switching */\n'
31
- });
32
- }
@@ -1,134 +0,0 @@
1
- /**
2
- * Link styles for styled-components compatibility
3
- *
4
- * This file provides backward compatibility for consumers using styled-components
5
- * to wrap the Link component.
6
- *
7
- * @example Function-based approach (current)
8
- * ```typescript
9
- * import styled from 'styled-components';
10
- * import { Link, linkStyles, StyledLinkProps } from '@clickhouse/click-ui';
11
- *
12
- * const CuiStyledLink = styled(Link)<StyledLinkProps>`
13
- * ${props => linkStyles(props)}
14
- * `;
15
- *
16
- * <CuiStyledLink $size="md" $weight="semibold">My Link</CuiStyledLink>
17
- * ```
18
- *
19
- * @example CSS classes approach (recommended for new code)
20
- * ```typescript
21
- * import { Link, linkClasses } from '@clickhouse/click-ui';
22
- *
23
- * <Link className={linkClasses({ size: 'md', weight: 'semibold' })}>My Link</Link>
24
- * ```
25
- */
26
- export type TextSize = "xs" | "sm" | "md" | "lg" | "xl";
27
- export type TextWeight = "normal" | "medium" | "semibold" | "bold";
28
- /**
29
- * Props for styled-components wrapper
30
- * @deprecated Use LinkStyleProps with linkClasses instead
31
- */
32
- export interface StyledLinkProps {
33
- $size?: TextSize;
34
- $weight?: TextWeight;
35
- }
36
- /**
37
- * Props for CSS classes approach
38
- */
39
- export interface LinkStyleProps {
40
- size?: TextSize;
41
- weight?: TextWeight;
42
- className?: string;
43
- }
44
- /**
45
- * Function-based link styles for styled-components
46
- *
47
- * Returns a CSS string with the appropriate CSS variables based on size and weight.
48
- *
49
- * @param props - Style props with $size and $weight
50
- * @returns CSS string with Click UI link styles
51
- *
52
- * @deprecated This function-based approach is maintained for backward compatibility.
53
- * For new code, use `linkClasses()` instead which doesn't require styled-components.
54
- *
55
- * @example
56
- * ```typescript
57
- * const StyledLink = styled(Link)<StyledLinkProps>`
58
- * ${props => linkStyles(props)}
59
- * `;
60
- * ```
61
- */
62
- export declare const linkStyles: (props?: StyledLinkProps) => string;
63
- /**
64
- * CSS class names helper for Link component styling
65
- *
66
- * Use these classes to apply Click UI link styles to custom components without
67
- * requiring styled-components.
68
- *
69
- * @param options - Size, weight, and additional className
70
- * @returns Combined class name string
71
- *
72
- * @example With React Router
73
- * ```typescript
74
- * import { Link as RouterLink } from 'react-router-dom';
75
- * import { linkClasses } from '@clickhouse/click-ui';
76
- *
77
- * <RouterLink
78
- * to="/dashboard"
79
- * className={linkClasses({ size: 'md', weight: 'semibold' })}
80
- * >
81
- * Go to Dashboard
82
- * </RouterLink>
83
- * ```
84
- *
85
- * @example With Next.js Link
86
- * ```typescript
87
- * import Link from 'next/link';
88
- * import { linkClasses } from '@clickhouse/click-ui';
89
- *
90
- * <Link href="/about" className={linkClasses({ size: 'lg', weight: 'bold' })}>
91
- * About
92
- * </Link>
93
- * ```
94
- */
95
- export declare const linkClasses: ({ size, weight, className }?: LinkStyleProps) => string;
96
- /**
97
- * CSS class name constants for granular control
98
- *
99
- * Use these constants when you need more control over which classes to apply.
100
- *
101
- * @example
102
- * ```typescript
103
- * import { LINK_CLASSES } from '@clickhouse/click-ui';
104
- * import clsx from 'clsx';
105
- *
106
- * <a
107
- * href="/home"
108
- * className={clsx(
109
- * LINK_CLASSES.base,
110
- * LINK_CLASSES.size.lg,
111
- * LINK_CLASSES.weight.bold,
112
- * 'my-custom-class'
113
- * )}
114
- * >
115
- * Home
116
- * </a>
117
- * ```
118
- */
119
- export declare const LINK_CLASSES: {
120
- readonly base: "cui-link";
121
- readonly size: {
122
- readonly xs: "cui-link-xs";
123
- readonly sm: "cui-link-sm";
124
- readonly md: "cui-link-md";
125
- readonly lg: "cui-link-lg";
126
- readonly xl: "cui-link-xl";
127
- };
128
- readonly weight: {
129
- readonly normal: "";
130
- readonly medium: "cui-link-weight-medium";
131
- readonly semibold: "cui-link-weight-semibold";
132
- readonly bold: "cui-link-weight-bold";
133
- };
134
- };
@@ -1,4 +0,0 @@
1
- import { default as React } from 'react';
2
-
3
- export declare const ThemeToggle: React.FC;
4
- export default ThemeToggle;