@clickhouse/click-ui 0.0.235 → 0.0.237-sc-deprecation.1
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.
- package/README.md +161 -20
- package/bin/README.md +178 -0
- package/bin/click-ui.config.example.ts +70 -0
- package/bin/click-ui.js +97 -0
- package/bin/commands/build-default-theme.ts +48 -0
- package/bin/commands/generate.js +117 -0
- package/bin/commands/init.js +110 -0
- package/bin/utils/config-loader.ts +61 -0
- package/bin/utils/css-generator.js +32 -0
- package/dist/click-ui.bundled.es.js +40740 -48756
- package/dist/click-ui.bundled.umd.js +79 -53070
- package/dist/click-ui.es.js +40747 -47595
- package/dist/click-ui.umd.js +79 -51901
- package/dist/components/Accordion/Accordion.d.ts +3 -3
- package/dist/components/AutoComplete/AutoComplete.d.ts +0 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Badge/Badge.d.ts +1 -1
- package/dist/components/BigStat/BigStat.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/dist/components/CardHorizontal/CardHorizontal.d.ts +5 -1
- package/dist/components/CardPrimary/CardPrimaryTopBadge.d.ts +14 -3
- package/dist/components/CardPromotion/CardPromotion.d.ts +1 -1
- package/dist/components/CardSecondary/CardSecondary.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/CodeBlock/CodeBlock.d.ts +1 -1
- package/dist/components/CodeBlock/useColorStyle.d.ts +1 -1
- package/dist/components/Collapsible/Collapsible.d.ts +3 -3
- package/dist/components/Container/Container.d.ts +5 -6
- package/dist/components/DatePicker/Common.d.ts +8 -3
- package/dist/components/Dialog/Dialog.d.ts +2 -2
- package/dist/components/EllipsisContent/EllipsisContent.d.ts +4 -6
- package/dist/components/FileTabs/FileTabs.d.ts +2 -2
- package/dist/components/Flyout/Flyout.d.ts +1 -1
- package/dist/components/GenericMenu.d.ts +22 -10
- package/dist/components/Grid/Cell.d.ts +2 -1
- package/dist/components/Grid/StyledCell.d.ts +5 -2
- package/dist/components/Grid/types.d.ts +1 -1
- package/dist/components/GridContainer/GridContainer.d.ts +4 -5
- package/dist/components/Icon/IconCommon.d.ts +4 -3
- package/dist/components/Icon/types.d.ts +3 -1
- package/dist/components/IconWrapper/IconWrapper.d.ts +2 -2
- package/dist/components/Input/InputWrapper.d.ts +25 -18
- package/dist/components/Link/Link.d.ts +4 -6
- package/dist/components/Link/linkStyles.d.ts +134 -0
- package/dist/components/Logos/AWSGlue.d.ts +4 -0
- package/dist/components/Logos/Logo.d.ts +1 -1
- package/dist/components/Logos/types.d.ts +1 -1
- package/dist/components/MultiAccordion/MultiAccordion.d.ts +1 -1
- package/dist/components/Panel/Panel.d.ts +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/Select/common/SelectStyled.d.ts +24 -26
- package/dist/components/Separator/Separator.d.ts +4 -3
- package/dist/components/SidebarNavigationItem/SidebarNavigationItem.d.ts +5 -9
- package/dist/components/SidebarNavigationTitle/SidebarNavigationTitle.d.ts +5 -7
- package/dist/components/Spacer/Spacer.d.ts +2 -1
- package/dist/components/SplitButton/SplitButton.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +26 -24
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +4 -0
- package/dist/components/Typography/Text/Text.d.ts +4 -5
- package/dist/components/VerticalStepper/VerticalStepper.d.ts +2 -2
- package/dist/components/commonElement.d.ts +21 -17
- package/dist/components/commonTypes.d.ts +1 -1
- package/dist/components/icons/DataLakes.d.ts +4 -0
- package/dist/components/icons/HorizontalLoading.d.ts +3 -1
- package/dist/components/icons/Loading.d.ts +1 -1
- package/dist/components/icons/LoadingAnimated.d.ts +3 -1
- package/dist/components/index.d.ts +6 -3
- package/dist/components/types.d.ts +51 -83
- package/dist/config/tokens/types.d.ts +15296 -0
- package/dist/config/tokens/types.d.ts.map +1 -0
- package/dist/config/tokens/types.js +2 -0
- package/dist/config/tokens/types.js.map +1 -0
- package/dist/config/types.d.ts +55 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/config/utils/css-builder.d.ts +38 -0
- package/dist/config/utils/css-builder.d.ts.map +1 -0
- package/dist/config/utils/css-builder.js +56 -0
- package/dist/config/utils/css-builder.js.map +1 -0
- package/dist/config/utils/css-generator.d.ts +25 -0
- package/dist/config/utils/css-generator.d.ts.map +1 -0
- package/dist/config/utils/css-generator.js +151 -0
- package/dist/config/utils/css-generator.js.map +1 -0
- package/dist/config/utils/find-config.d.ts +17 -0
- package/dist/config/utils/find-config.d.ts.map +1 -0
- package/dist/config/utils/find-config.js +28 -0
- package/dist/config/utils/find-config.js.map +1 -0
- package/dist/cui-components.css +1 -0
- package/dist/cui-default-theme.css +1809 -0
- package/dist/cui.css +3 -0
- package/dist/index.d.ts +77 -1
- package/dist/stories/ChartColorComponent.d.ts +1 -0
- package/dist/stories/chart-examples/ChartTooltip.d.ts +12 -0
- package/dist/stories/chart-examples/ColorSwatchesChart.d.ts +1 -0
- package/dist/stories/chart-examples/GroupedBarChart.d.ts +1 -0
- package/dist/stories/chart-examples/MultiLineChart.d.ts +1 -0
- package/dist/stories/chart-examples/StackedAreaChart.d.ts +1 -0
- package/dist/stories/chart-examples/StackedBarChartDemo.d.ts +1 -0
- package/dist/theme/ClickUIProvider/ClickUIProvider.d.ts +5 -0
- package/dist/theme/ClickUIProvider/ServerClickUIProvider.d.ts +23 -0
- package/dist/theme/ClickUIProvider/context.d.ts +24 -0
- package/dist/theme/ClickUIProvider/hooks.d.ts +4 -0
- package/dist/theme/ClickUIProvider/index.d.ts +6 -0
- package/dist/theme/ClickUIProvider/types.d.ts +39 -0
- package/dist/theme/config.d.ts +22 -0
- package/dist/theme/hooks/useSystemColorSchemePreference.d.ts +7 -0
- package/dist/theme/index.d.ts +6 -12
- package/dist/{styles → theme/tokens}/types.d.ts +13 -6
- package/dist/{styles → theme/tokens}/variables.dark.json.d.ts +118 -117
- package/dist/{styles → theme/tokens}/variables.json.d.ts +20 -13
- package/dist/{styles → theme/tokens}/variables.light.json.d.ts +146 -145
- package/dist/theme/types.d.ts +54 -0
- package/dist/theme/utils/css-builder.d.ts +37 -0
- package/dist/theme/utils/css-generator.d.ts +25 -0
- package/dist/theme/utils/find-config.d.ts +16 -0
- package/dist/theme/utils/theme-attribute.d.ts +13 -0
- package/dist/theme/utils.d.ts +29 -0
- package/dist/utils/capitalize.d.ts +12 -0
- package/dist/utils/polymorphic/index.d.ts +48 -0
- package/dist/utils/test-utils.d.ts +1 -3
- package/package.json +49 -24
- package/dist/click-ui.bundled.es.js.map +0 -1
- package/dist/click-ui.bundled.umd.js.map +0 -1
- package/dist/click-ui.es.js.map +0 -1
- package/dist/click-ui.umd.js.map +0 -1
- package/dist/components/ClickUIProvider/ClickUIProvider.d.ts +0 -15
- package/dist/components/Link/common.d.ts +0 -7
- package/dist/styles/variables.classic.json.d.ts +0 -993
- package/dist/theme/theme.d.ts +0 -7
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { NestedJSONObject, Theme } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Core traverse function to convert nested theme object to flat variable map
|
|
4
|
+
* Used by generateCSSVariables, themeToFlatVariables, and build plugins to avoid duplication
|
|
5
|
+
*
|
|
6
|
+
* @param obj - Theme or nested JSON object to traverse
|
|
7
|
+
* @param prefix - Prefix for CSS variable names (default: "--")
|
|
8
|
+
* @param skipFields - Fields to skip during traversal (default: ["name", "isSystem", "resolvedTheme"])
|
|
9
|
+
* @returns Record of CSS variable names to their values
|
|
10
|
+
*/
|
|
11
|
+
export declare const traverseThemeObject: (obj: Theme | NestedJSONObject, prefix?: string, skipFields?: string[]) => Record<string, string>;
|
|
12
|
+
/**
|
|
13
|
+
* Generate CSS variables with light-dark() for colors and fallback handling for non-colors
|
|
14
|
+
* Returns an object with base variables and any theme-specific overrides needed
|
|
15
|
+
*/
|
|
16
|
+
export declare const generateLightDarkVariables: (lightTheme: Theme, darkTheme: Theme) => Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Generate separate theme-specific overrides for non-color variables that differ
|
|
19
|
+
* This is needed when non-color values differ between themes and light-dark() can't be used
|
|
20
|
+
*/
|
|
21
|
+
export declare const generateThemeOverrides: (lightTheme: Theme, darkTheme: Theme) => {
|
|
22
|
+
light: Record<string, string>;
|
|
23
|
+
dark: Record<string, string>;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=css-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-generator.d.ts","sourceRoot":"","sources":["../../../src/theme/utils/css-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAmDxD;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,QACzB,KAAK,GAAG,gBAAgB,WACrB,MAAM,eACF,MAAM,EAAE,KACnB,MAAM,CAAC,MAAM,EAAE,MAAM,CAgCvB,CAAC;AAmCF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,eACzB,KAAK,aACN,KAAK,KACf,MAAM,CAAC,MAAM,EAAE,MAAM,CAsBvB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,eACrB,KAAK,aACN,KAAK,KACf;IAAE,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAsB/D,CAAC"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// Cache for color detection results
|
|
2
|
+
const colorValueCache = new Map();
|
|
3
|
+
/**
|
|
4
|
+
* Checks if a value is a color
|
|
5
|
+
* Build-time only - uses pattern matching
|
|
6
|
+
*/
|
|
7
|
+
const isColorValue = (value) => {
|
|
8
|
+
if (!value || typeof value !== "string") {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
// Check cache first
|
|
12
|
+
if (colorValueCache.has(value)) {
|
|
13
|
+
return colorValueCache.get(value);
|
|
14
|
+
}
|
|
15
|
+
// Pattern matching for color detection
|
|
16
|
+
const trimmed = value.trim();
|
|
17
|
+
const isColor = (/^#[0-9A-Fa-f]{3,8}$/.test(trimmed) || // Hex colors
|
|
18
|
+
/^rgba?\([^)]+\)$/.test(trimmed) || // rgb/rgba with any content
|
|
19
|
+
/^hsla?\([^)]+\)$/.test(trimmed) || // hsl/hsla with any content
|
|
20
|
+
/^(lch|lab|oklab|oklch)\([^)]+\)$/.test(trimmed) || // Modern color spaces
|
|
21
|
+
/^color\([^)]+\)$/.test(trimmed) || // color() function
|
|
22
|
+
trimmed.startsWith("var(--") || // CSS variables
|
|
23
|
+
// Named colors (basic set)
|
|
24
|
+
/^(transparent|currentColor|inherit|initial|unset)$/i.test(trimmed));
|
|
25
|
+
// Cache the result
|
|
26
|
+
colorValueCache.set(value, isColor);
|
|
27
|
+
return isColor;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Determines if a variable should use light-dark()
|
|
31
|
+
* Only checks if BOTH values are colors - variable name doesn't matter
|
|
32
|
+
*/
|
|
33
|
+
const shouldUseLightDark = (_varName, // Not used - only value matters
|
|
34
|
+
lightValue, darkValue) => {
|
|
35
|
+
// Use light-dark() only if BOTH values are colors
|
|
36
|
+
return isColorValue(lightValue) && isColorValue(darkValue);
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Core traverse function to convert nested theme object to flat variable map
|
|
40
|
+
* Used by generateCSSVariables, themeToFlatVariables, and build plugins to avoid duplication
|
|
41
|
+
*
|
|
42
|
+
* @param obj - Theme or nested JSON object to traverse
|
|
43
|
+
* @param prefix - Prefix for CSS variable names (default: "--")
|
|
44
|
+
* @param skipFields - Fields to skip during traversal (default: ["name", "isSystem", "resolvedTheme"])
|
|
45
|
+
* @returns Record of CSS variable names to their values
|
|
46
|
+
*/
|
|
47
|
+
export const traverseThemeObject = (obj, prefix = "--", skipFields = ["name", "isSystem", "resolvedTheme"]) => {
|
|
48
|
+
const vars = {};
|
|
49
|
+
const traverse = (current, path = []) => {
|
|
50
|
+
Object.entries(current).forEach(([key, value]) => {
|
|
51
|
+
// Skip non-variable fields
|
|
52
|
+
if (skipFields.includes(key)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const varPath = [...path, key];
|
|
56
|
+
if (typeof value === "string" || typeof value === "number") {
|
|
57
|
+
const varName = `${prefix}${varPath.join("-")}`;
|
|
58
|
+
vars[varName] = String(value);
|
|
59
|
+
}
|
|
60
|
+
else if (Array.isArray(value)) {
|
|
61
|
+
// Handle arrays: convert each element to a CSS variable with index
|
|
62
|
+
// e.g., border.radii[0] -> --border-radii-0
|
|
63
|
+
value.forEach((item, index) => {
|
|
64
|
+
if (typeof item === "string" || typeof item === "number") {
|
|
65
|
+
const varName = `${prefix}${[...varPath, index].join("-")}`;
|
|
66
|
+
vars[varName] = String(item);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else if (typeof value === "object" && value !== null) {
|
|
71
|
+
traverse(value, varPath);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
traverse(obj);
|
|
76
|
+
return vars;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Convert theme object to flat variable map
|
|
80
|
+
* Used for light-dark() generation and theme overrides
|
|
81
|
+
*/
|
|
82
|
+
const themeToFlatVariables = (theme) => {
|
|
83
|
+
return traverseThemeObject(theme);
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* Process a variable and determine its CSS value based on light/dark themes
|
|
87
|
+
* Returns the appropriate CSS value (either direct value or light-dark() function)
|
|
88
|
+
*/
|
|
89
|
+
const processVariable = (varName, lightValue, darkValue) => {
|
|
90
|
+
// Optimization: if both values are identical, declare it once
|
|
91
|
+
if (lightValue === darkValue) {
|
|
92
|
+
return lightValue;
|
|
93
|
+
}
|
|
94
|
+
// Only use light-dark() for color values
|
|
95
|
+
if (shouldUseLightDark(varName, lightValue, darkValue)) {
|
|
96
|
+
return `light-dark(${lightValue}, ${darkValue})`;
|
|
97
|
+
}
|
|
98
|
+
// Non-color values: use light theme value
|
|
99
|
+
// Note: If you need different non-color values per theme,
|
|
100
|
+
// you'll need to handle them separately with [data-theme] selectors
|
|
101
|
+
return lightValue;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Generate CSS variables with light-dark() for colors and fallback handling for non-colors
|
|
105
|
+
* Returns an object with base variables and any theme-specific overrides needed
|
|
106
|
+
*/
|
|
107
|
+
export const generateLightDarkVariables = (lightTheme, darkTheme) => {
|
|
108
|
+
const lightVars = themeToFlatVariables(lightTheme);
|
|
109
|
+
const darkVars = themeToFlatVariables(darkTheme);
|
|
110
|
+
const lightDarkVars = {};
|
|
111
|
+
// Process all light theme variables
|
|
112
|
+
Object.keys(lightVars).forEach(varName => {
|
|
113
|
+
const lightValue = lightVars[varName];
|
|
114
|
+
const darkValue = darkVars[varName] || lightValue;
|
|
115
|
+
lightDarkVars[varName] = processVariable(varName, lightValue, darkValue);
|
|
116
|
+
});
|
|
117
|
+
// Add any dark-only variables
|
|
118
|
+
Object.keys(darkVars).forEach(varName => {
|
|
119
|
+
if (!lightDarkVars[varName]) {
|
|
120
|
+
const darkValue = darkVars[varName];
|
|
121
|
+
const lightValue = lightVars[varName] || darkValue;
|
|
122
|
+
lightDarkVars[varName] = processVariable(varName, lightValue, darkValue);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
return lightDarkVars;
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Generate separate theme-specific overrides for non-color variables that differ
|
|
129
|
+
* This is needed when non-color values differ between themes and light-dark() can't be used
|
|
130
|
+
*/
|
|
131
|
+
export const generateThemeOverrides = (lightTheme, darkTheme) => {
|
|
132
|
+
const lightVars = themeToFlatVariables(lightTheme);
|
|
133
|
+
const darkVars = themeToFlatVariables(darkTheme);
|
|
134
|
+
const lightOverrides = {};
|
|
135
|
+
const darkOverrides = {};
|
|
136
|
+
// Find non-color variables that have different values
|
|
137
|
+
Object.keys(lightVars).forEach(varName => {
|
|
138
|
+
const lightValue = lightVars[varName];
|
|
139
|
+
const darkValue = darkVars[varName];
|
|
140
|
+
if (darkValue && lightValue !== darkValue) {
|
|
141
|
+
// Skip if both values are colors (already handled by light-dark())
|
|
142
|
+
// Only add to overrides if they're non-color values that differ
|
|
143
|
+
if (!isColorValue(lightValue) || !isColorValue(darkValue)) {
|
|
144
|
+
lightOverrides[varName] = lightValue;
|
|
145
|
+
darkOverrides[varName] = darkValue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
return { light: lightOverrides, dark: darkOverrides };
|
|
150
|
+
};
|
|
151
|
+
//# sourceMappingURL=css-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-generator.js","sourceRoot":"","sources":["../../../src/theme/utils/css-generator.ts"],"names":[],"mappings":"AAEA,oCAAoC;AACpC,MAAM,eAAe,GAAG,IAAI,GAAG,EAAmB,CAAC;AAEnD;;;GAGG;AACH,MAAM,YAAY,GAAG,CAAC,KAAa,EAAW,EAAE;IAC9C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,oBAAoB;IACpB,IAAI,eAAe,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,eAAe,CAAC,GAAG,CAAC,KAAK,CAAE,CAAC;IACrC,CAAC;IAED,uCAAuC;IACvC,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,CACd,qBAAqB,CAAC,IAAI,CAAC,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AC,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,UAAiB,EACjB,SAAgB,EACiD,EAAE;IACnE,MAAM,SAAS,GAAG,oBAAoB,CAAC,UAAU,CAAC,CAAC;IACnD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,cAAc,GAA2B,EAAE,CAAC;IAClD,MAAM,aAAa,GAA2B,EAAE,CAAC;IAEjD,sDAAsD;IACtD,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;QACvC,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEpC,IAAI,SAAS,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC1C,mEAAmE;YACnE,gEAAgE;YAChE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC1D,cAAc,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC;gBACrC,aAAa,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AACxD,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find Click UI config file in a directory
|
|
3
|
+
* Searches for click-ui.config with various extensions
|
|
4
|
+
*
|
|
5
|
+
* @param root - Directory to search in (usually process.cwd())
|
|
6
|
+
* @returns Full path to config file, or null if not found
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const configPath = findConfigFile(process.cwd());
|
|
11
|
+
* if (configPath) {
|
|
12
|
+
* console.log('Found config at:', configPath);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function findConfigFile(root: string): string | null;
|
|
17
|
+
//# sourceMappingURL=find-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-config.d.ts","sourceRoot":"","sources":["../../../src/theme/utils/find-config.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAW1D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
/**
|
|
4
|
+
* Find Click UI config file in a directory
|
|
5
|
+
* Searches for click-ui.config with various extensions
|
|
6
|
+
*
|
|
7
|
+
* @param root - Directory to search in (usually process.cwd())
|
|
8
|
+
* @returns Full path to config file, or null if not found
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const configPath = findConfigFile(process.cwd());
|
|
13
|
+
* if (configPath) {
|
|
14
|
+
* console.log('Found config at:', configPath);
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function findConfigFile(root) {
|
|
19
|
+
const extensions = ['ts', 'js', 'mjs', 'cjs'];
|
|
20
|
+
for (const ext of extensions) {
|
|
21
|
+
const configPath = path.join(root, `click-ui.config.${ext}`);
|
|
22
|
+
if (fs.existsSync(configPath)) {
|
|
23
|
+
return configPath;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=find-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-config.js","sourceRoot":"","sources":["../../../src/theme/utils/find-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,MAAM,UAAU,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAE9C,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,GAAG,EAAE,CAAC,CAAC;QAC7D,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9B,OAAO,UAAU,CAAC;QACpB,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|