vueless 0.0.662 → 0.0.663
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/composables/useUI.ts
CHANGED
|
@@ -45,7 +45,7 @@ export default function useUI<T>(
|
|
|
45
45
|
? (parent?.type.__name as ComponentNames)
|
|
46
46
|
: (type.__name as ComponentNames);
|
|
47
47
|
|
|
48
|
-
const globalConfig = (vuelessConfig
|
|
48
|
+
const globalConfig = (vuelessConfig.component?.[componentName] || {}) as ComponentConfig<T>;
|
|
49
49
|
|
|
50
50
|
const vuelessStrategy = Object.values(STRATEGY_TYPE).includes(vuelessConfig.strategy || "")
|
|
51
51
|
? (vuelessConfig.strategy as Strategies)
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ export async function setCustomPropTypes(isVuelessEnv) {
|
|
|
19
19
|
const srcDir = isVuelessEnv ? VUELESS_LOCAL_DIR : VUELESS_DIR;
|
|
20
20
|
|
|
21
21
|
for await (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
|
|
22
|
-
const componentGlobalConfig = vuelessConfig.component[componentName];
|
|
22
|
+
const componentGlobalConfig = vuelessConfig.component?.[componentName];
|
|
23
23
|
const customProps = componentGlobalConfig && componentGlobalConfig.props;
|
|
24
24
|
const isHiddenStories = componentGlobalConfig && componentGlobalConfig.storybook === false;
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ export async function setCustomPropTypes(isVuelessEnv) {
|
|
|
27
27
|
await cacheComponentTypes(path.join(srcDir, componentDir));
|
|
28
28
|
await modifyComponentTypes(
|
|
29
29
|
path.join(srcDir, componentDir),
|
|
30
|
-
vuelessConfig.component[componentName]
|
|
30
|
+
vuelessConfig.component?.[componentName]?.props,
|
|
31
31
|
);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -47,7 +47,7 @@ export async function hideHiddenStories(isVuelessEnv) {
|
|
|
47
47
|
const srcDir = isVuelessEnv ? VUELESS_LOCAL_DIR : VUELESS_DIR;
|
|
48
48
|
|
|
49
49
|
for await (const [componentName, componentDir] of Object.entries(COMPONENTS)) {
|
|
50
|
-
const componentGlobalConfig = vuelessConfig.component[componentName];
|
|
50
|
+
const componentGlobalConfig = vuelessConfig.component?.[componentName];
|
|
51
51
|
const isHiddenStories = componentGlobalConfig && componentGlobalConfig.storybook === false;
|
|
52
52
|
|
|
53
53
|
if (isHiddenStories) {
|
package/utils/node/loaderIcon.js
CHANGED
|
@@ -311,5 +311,5 @@ async function getDefaults() {
|
|
|
311
311
|
const defaultConfigPath = path.join(cwd(), defaultIconsDir, COMPONENTS[U_ICON], "config.ts");
|
|
312
312
|
const uIconDefaultConfig = await getComponentDefaultConfig(U_ICON, defaultConfigPath);
|
|
313
313
|
|
|
314
|
-
return merge({}, uIconDefaultConfig?.defaults, vuelessConfig
|
|
314
|
+
return merge({}, uIconDefaultConfig?.defaults, vuelessConfig.component?.[U_ICON]?.defaults);
|
|
315
315
|
}
|
package/utils/theme.ts
CHANGED
|
@@ -40,7 +40,7 @@ export function themeInit() {
|
|
|
40
40
|
|
|
41
41
|
setTheme();
|
|
42
42
|
|
|
43
|
-
if (vuelessConfig
|
|
43
|
+
if (vuelessConfig.colorMode === ColorMode.Auto) {
|
|
44
44
|
const prefersColorSchemeDark = window.matchMedia("(prefers-color-scheme: dark)");
|
|
45
45
|
|
|
46
46
|
prefersColorSchemeDark.addEventListener("change", (event) => {
|
|
@@ -98,11 +98,11 @@ export function setColorMode(colorMode: `${ColorMode}`) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
export function setTheme(config: Config = {}) {
|
|
101
|
-
setColorMode(vuelessConfig
|
|
101
|
+
setColorMode(vuelessConfig.colorMode || config?.colorMode || ColorMode.Light);
|
|
102
102
|
|
|
103
103
|
const rounding = config?.rounding ?? vuelessConfig.rounding ?? DEFAULT_ROUNDING;
|
|
104
|
-
const roundingSm = config?.roundingSm ?? vuelessConfig
|
|
105
|
-
const roundingLg = config?.roundingLg ?? vuelessConfig
|
|
104
|
+
const roundingSm = config?.roundingSm ?? vuelessConfig.roundingSm ?? rounding / 2;
|
|
105
|
+
const roundingLg = config?.roundingLg ?? vuelessConfig.roundingLg ?? rounding * 2;
|
|
106
106
|
const isDarkMode = document.documentElement.classList.contains(DARK_MODE_SELECTOR);
|
|
107
107
|
|
|
108
108
|
let brand: BrandColors | GrayColors | typeof GRAY_COLOR =
|
|
@@ -159,7 +159,7 @@ export function setTheme(config: Config = {}) {
|
|
|
159
159
|
const colors: DefaultColors = merge(
|
|
160
160
|
tailwindColors,
|
|
161
161
|
tailwindConfig?.theme?.extend?.colors || {},
|
|
162
|
-
vuelessConfig
|
|
162
|
+
vuelessConfig.tailwindTheme?.extend?.colors || {},
|
|
163
163
|
);
|
|
164
164
|
|
|
165
165
|
const variables: Partial<VuelessCssVariables> = {
|