vueless 0.0.648 → 0.0.649
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/package.json +1 -1
- package/preset-tailwind.js +6 -4
- package/types.ts +8 -1
- package/ui.data-table/config.ts +4 -1
- package/utils/storybook.ts +10 -2
- package/utils/theme.ts +6 -1
package/package.json
CHANGED
package/preset-tailwind.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* The file has `.js` extension because it is a node script.
|
|
3
3
|
* Please do not change the extension if you do not fully understand the consequences.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
import { merge } from "lodash-es";
|
|
6
6
|
import forms from "@tailwindcss/forms";
|
|
7
7
|
import colors from "tailwindcss/colors.js";
|
|
8
8
|
import {
|
|
@@ -62,7 +62,7 @@ export const vuelessContentNuxt = [
|
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
* Vueless tailwind static config.
|
|
65
|
-
* Exported to use in `@vueless/
|
|
65
|
+
* Exported to use in `@vueless/nuxt`.
|
|
66
66
|
*/
|
|
67
67
|
const safelist = getSafelist();
|
|
68
68
|
const brandColors = getPalette(BRAND_COLOR);
|
|
@@ -100,7 +100,7 @@ export const vuelessTailwindConfig = {
|
|
|
100
100
|
dynamic: "var(--vl-ring-offset)",
|
|
101
101
|
},
|
|
102
102
|
ringOffsetColor: {
|
|
103
|
-
|
|
103
|
+
dynamic: twColorWithOpacity("--vl-ring-offset-color"),
|
|
104
104
|
},
|
|
105
105
|
},
|
|
106
106
|
configViewer: {
|
|
@@ -126,7 +126,9 @@ export const vuelessTailwindConfig = {
|
|
|
126
126
|
*/
|
|
127
127
|
export function vuelessPreset() {
|
|
128
128
|
return {
|
|
129
|
-
|
|
129
|
+
theme: merge({}, globalSettings.tailwindTheme || {}, vuelessTailwindConfig.theme),
|
|
130
|
+
darkMode: vuelessTailwindConfig.darkMode,
|
|
131
|
+
content: vuelessTailwindConfig.content,
|
|
130
132
|
plugins: [forms],
|
|
131
133
|
safelist,
|
|
132
134
|
};
|
package/types.ts
CHANGED
|
@@ -56,8 +56,9 @@ import UInputMoneyConfig from "./ui.form-input-money/config.ts";
|
|
|
56
56
|
import UDataListConfig from "./ui.data-list/config.ts";
|
|
57
57
|
import USelectConfig from "./ui.form-select/config.ts";
|
|
58
58
|
|
|
59
|
-
import type { ComputedRef, Ref, ComponentInternalInstance } from "vue";
|
|
60
59
|
import type { Props } from "tippy.js";
|
|
60
|
+
import type { Config as TailwindConfig } from "tailwindcss";
|
|
61
|
+
import type { ComputedRef, Ref, ComponentInternalInstance } from "vue";
|
|
61
62
|
import type { LocaleOptions } from "./adatper.locale/vueless.ts";
|
|
62
63
|
|
|
63
64
|
export enum ColorMode {
|
|
@@ -137,6 +138,12 @@ export interface Config extends ThemeConfig {
|
|
|
137
138
|
*/
|
|
138
139
|
directive?: Partial<Directives>;
|
|
139
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Tailwind CSS theme config.
|
|
143
|
+
* https://tailwindcss.com/docs/theme
|
|
144
|
+
*/
|
|
145
|
+
tailwindTheme?: TailwindConfig["theme"];
|
|
146
|
+
|
|
140
147
|
/**
|
|
141
148
|
* Tailwind-merge config extension for custom classes.
|
|
142
149
|
* All lists of rules available here:
|
package/ui.data-table/config.ts
CHANGED
|
@@ -74,7 +74,10 @@ export default /*tw*/ {
|
|
|
74
74
|
container: "bg-gray-200",
|
|
75
75
|
},
|
|
76
76
|
bodyCheckbox: "{UCheckbox}",
|
|
77
|
-
bodyDateDivider:
|
|
77
|
+
bodyDateDivider: {
|
|
78
|
+
base: "{UDivider}",
|
|
79
|
+
label: "py-0",
|
|
80
|
+
},
|
|
78
81
|
bodyEmptyState: "{UEmpty} my-8",
|
|
79
82
|
footer: {
|
|
80
83
|
base: "group/footer border-t border-solid border-gray-200",
|
package/utils/storybook.ts
CHANGED
|
@@ -65,11 +65,19 @@ export function getSlotNames(componentName: string | undefined) {
|
|
|
65
65
|
* Create story param config to show component description with a link on GitHub.
|
|
66
66
|
*/
|
|
67
67
|
export function getDocsDescription(componentName: string | undefined) {
|
|
68
|
-
if (!componentName)
|
|
68
|
+
if (!componentName) {
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let viewOnGitHub = "";
|
|
73
|
+
|
|
74
|
+
if (COMPONENTS[componentName as ComponentNames]) {
|
|
75
|
+
viewOnGitHub = `| [View on GitHub](https://github.com/vuelessjs/vueless/tree/main/src/${COMPONENTS[componentName as ComponentNames]})`;
|
|
76
|
+
}
|
|
69
77
|
|
|
70
78
|
return {
|
|
71
79
|
description: {
|
|
72
|
-
component: `The \`${componentName}\` component.
|
|
80
|
+
component: `The \`${componentName}\` component. ${viewOnGitHub}`,
|
|
73
81
|
},
|
|
74
82
|
};
|
|
75
83
|
}
|
package/utils/theme.ts
CHANGED
|
@@ -151,7 +151,12 @@ export function setTheme(config: Config = {}) {
|
|
|
151
151
|
brand = gray;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
const colors: DefaultColors = merge(
|
|
154
|
+
const colors: DefaultColors = merge(
|
|
155
|
+
{},
|
|
156
|
+
tailwindColors,
|
|
157
|
+
tailwindConfig?.theme?.extend?.colors || {},
|
|
158
|
+
vuelessConfig?.tailwindTheme?.extend?.colors || {},
|
|
159
|
+
);
|
|
155
160
|
|
|
156
161
|
const variables: Partial<VuelessCssVariables> = {
|
|
157
162
|
"--vl-rounding-sm": `${Number(roundingSm) / PX_IN_REM}rem`,
|