vueless 0.0.477 → 0.0.478-beta.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/composables/useBreakpoint.js +1 -1
- package/composables/useUI.js +204 -1
- package/composablesTs/useAutoPosition.ts +115 -0
- package/composablesTs/useBreakpoint.ts +106 -0
- package/composablesTs/useLocale.ts +25 -0
- package/composablesTs/useMutationObserver.ts +50 -0
- package/composablesTs/useUI.ts +562 -0
- package/constants.js +2 -1
- package/constants.ts +73 -0
- package/directives/clickOutside/vClickOutside.js +2 -2
- package/directives/tooltip/storybook/stories.js +5 -5
- package/{index.js → index.ts} +10 -7
- package/package.json +28 -17
- package/preset.tailwind.js +16 -7
- package/types.ts +223 -0
- package/ui.button/config.js +12 -0
- package/ui.button-link/ULink.vue +1 -1
- package/ui.button-link/config.js +9 -0
- package/ui.data-list/UDataList.vue +4 -4
- package/ui.dropdown-badge/config.js +1 -0
- package/ui.dropdown-button/config.js +1 -0
- package/ui.form-checkbox/config.js +9 -0
- package/ui.form-color-picker/config.js +7 -0
- package/ui.form-input/UInput.vue +1 -1
- package/ui.form-input-money/useFormatCurrency.js +1 -1
- package/ui.form-input-number/UInputNumber.vue +4 -3
- package/ui.form-label/config.js +2 -2
- package/ui.form-radio/config.js +6 -0
- package/ui.form-switch/config.js +6 -0
- package/ui.image-avatar/config.js +5 -0
- package/ui.image-icon/config.js +5 -0
- package/ui.loader/config.js +1 -0
- package/ui.loader-overlay/config.js +1 -0
- package/ui.loader-progress/config.js +1 -0
- package/ui.navigation-progress/config.js +9 -0
- package/ui.other-dot/config.js +1 -0
- package/ui.text-alert/config.js +7 -0
- package/ui.text-badge/config.js +8 -0
- package/ui.text-block/UText.vue +18 -62
- package/ui.text-block/storybook/Docs.mdx +3 -3
- package/ui.text-block/storybook/{stories.js → stories.ts} +13 -8
- package/ui.text-block/types.ts +33 -0
- package/ui.text-block/useAttrs.ts +20 -0
- package/ui.text-file/UFile.vue +12 -14
- package/ui.text-file/config.js +12 -2
- package/ui.text-files/config.js +1 -1
- package/ui.text-header/config.js +1 -0
- package/ui.text-money/config.js +1 -0
- package/ui.text-money/utilMoney.js +2 -2
- package/utils/utilUI.js +0 -204
- package/utilsTs/utilHelper.ts +68 -0
- package/utilsTs/utilPlatform.ts +53 -0
- package/utilsTs/utilStorybook.ts +296 -0
- package/utilsTs/utilTailwind.ts +38 -0
- package/{utils/utilTheme.js → utilsTs/utilTheme.ts} +31 -27
- package/utilsTs/utilUI.ts +143 -0
- package/web-types.json +1 -1
- package/ui.text-block/useAttrs.js +0 -15
- /package/ui.text-block/{config.js → config.ts} +0 -0
- /package/ui.text-block/{constants.js → constants.ts} +0 -0
package/{index.js → index.ts}
RENAMED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
/* eslint-disable
|
|
1
|
+
/* eslint-disable prettier/prettier */
|
|
2
2
|
import { createLocale, LocaleSymbol } from "./composables/useLocale.js";
|
|
3
3
|
import { createLoaderOverlay, LoaderOverlaySymbol } from "./ui.loader-overlay/useLoaderOverlay.js";
|
|
4
4
|
import { createLoaderProgress, LoaderProgressSymbol } from "./ui.loader-progress/useLoaderProgress.js";
|
|
5
|
-
import { themeInit } from "./
|
|
5
|
+
import { themeInit } from "./utilsTs/utilTheme.ts";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
import type { App } from 'vue'
|
|
8
|
+
import type { CreateVuelessOptions } from './types.ts'
|
|
9
|
+
|
|
10
|
+
export { setTitle } from "./utilsTs/utilHelper.ts";
|
|
11
|
+
export { setTheme } from "./utilsTs/utilTheme.ts";
|
|
9
12
|
export { default as createVueI18nAdapter } from "./adatper.locale/vue-i18n.js";
|
|
10
13
|
export { default as defaultEnLocale } from "./adatper.locale/locales/en.js";
|
|
11
14
|
export { useLocale } from "./composables/useLocale.js";
|
|
@@ -22,14 +25,14 @@ export {
|
|
|
22
25
|
setDelayedNotify,
|
|
23
26
|
getDelayedNotify,
|
|
24
27
|
} from "./ui.text-notify/utilNotify.js";
|
|
25
|
-
/* eslint-enable
|
|
28
|
+
/* eslint-enable prettier/prettier */
|
|
26
29
|
|
|
27
|
-
export function createVueless(options = {}) {
|
|
30
|
+
export function createVueless(options: CreateVuelessOptions = {}) {
|
|
28
31
|
const i18n = createLocale(options.i18n);
|
|
29
32
|
const loaderOverlay = createLoaderOverlay();
|
|
30
33
|
const loaderProgress = createLoaderProgress();
|
|
31
34
|
|
|
32
|
-
const install = (app) => {
|
|
35
|
+
const install = (app: App) => {
|
|
33
36
|
app.provide(LocaleSymbol, i18n);
|
|
34
37
|
app.provide(LoaderOverlaySymbol, loaderOverlay);
|
|
35
38
|
app.provide(LoaderProgressSymbol, loaderProgress);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.478-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
6
6
|
"keywords": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"homepage": "https://vueless.com",
|
|
23
23
|
"author": "Johnny Grid",
|
|
24
|
-
"main": "index.
|
|
24
|
+
"main": "index.ts",
|
|
25
25
|
"type": "module",
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
@@ -31,13 +31,16 @@
|
|
|
31
31
|
"dev": "npx @vueless/web-types && node prepare.icons && STORYBOOK_FULL=1 storybook dev -p 6006 --no-open",
|
|
32
32
|
"build": "npx @vueless/web-types && node prepare.icons && storybook build --docs",
|
|
33
33
|
"preview": "vite preview --host --outDir=storybook-static",
|
|
34
|
-
"
|
|
34
|
+
"ts:check": "vue-tsc --build --force",
|
|
35
|
+
"ts:build": "vue-tsc --build --force --declaration --emitDeclarationOnly",
|
|
36
|
+
"release:prepare": "npx @vueless/web-types && node prepare.icons && rm -rf dist && mkdir -p dist && cp -r src/. package.json LICENSE web-types.json README.md dist/ && node prepare.package && npm run ts:build",
|
|
37
|
+
"release:beta": "release-it --ci --npm.publish --preRelease=beta --increment=prerelease",
|
|
35
38
|
"release:patch": "release-it patch --ci --npm.publish",
|
|
36
39
|
"release:minor": "release-it minor --ci --npm.publish --git.tag --github.release",
|
|
37
40
|
"release:major": "release-it major --ci --npm.publish --git.tag --github.release",
|
|
38
|
-
"lint": "eslint --
|
|
39
|
-
"lint:fix": "eslint --
|
|
40
|
-
"lint:ci": "eslint --
|
|
41
|
+
"lint": "eslint --no-fix src/ .storybook/",
|
|
42
|
+
"lint:fix": "eslint --fix src/ .storybook/",
|
|
43
|
+
"lint:ci": "eslint --no-fix --max-warnings=0"
|
|
41
44
|
},
|
|
42
45
|
"dependencies": {
|
|
43
46
|
"@tailwindcss/forms": "^0.5.7",
|
|
@@ -49,30 +52,38 @@
|
|
|
49
52
|
"vuedraggable": "^4.1.0"
|
|
50
53
|
},
|
|
51
54
|
"devDependencies": {
|
|
55
|
+
"@eslint/js": "^9.12.0",
|
|
52
56
|
"@material-symbols/svg-500": "^0.17.4",
|
|
53
57
|
"@release-it/bumper": "^6.0.1",
|
|
58
|
+
"@tsconfig/node20": "^20.1.4",
|
|
59
|
+
"@types/jsdom": "^21.1.7",
|
|
60
|
+
"@types/lodash-es": "^4.17.12",
|
|
61
|
+
"@types/node": "^22.7.7",
|
|
54
62
|
"@vitejs/plugin-vue": "^5.0.5",
|
|
55
|
-
"@
|
|
63
|
+
"@vitest/eslint-plugin": "^1.1.7",
|
|
64
|
+
"@vue/eslint-config-prettier": "^10.0.0",
|
|
65
|
+
"@vue/eslint-config-typescript": "^14.1.1",
|
|
66
|
+
"@vue/tsconfig": "^0.5.1",
|
|
56
67
|
"@vueless/plugin-vite": "^0.0.74",
|
|
57
68
|
"@vueless/storybook": "^0.0.37",
|
|
58
69
|
"@vueless/web-types": "^0.0.17",
|
|
59
70
|
"autoprefixer": "^10.4.19",
|
|
60
71
|
"cssnano": "^6.1.2",
|
|
61
|
-
"eslint": "^
|
|
62
|
-
"eslint-plugin-
|
|
63
|
-
"eslint-plugin-
|
|
64
|
-
"eslint-plugin-storybook": "^0.8.0",
|
|
65
|
-
"eslint-plugin-tailwindcss": "^3.15.1",
|
|
72
|
+
"eslint": "^9.12.0",
|
|
73
|
+
"eslint-plugin-storybook": "^0.10.0--canary.156.ce8985b.0",
|
|
74
|
+
"eslint-plugin-tailwindcss": "^3.17.5",
|
|
66
75
|
"eslint-plugin-vue": "^9.25.0",
|
|
76
|
+
"globals": "^15.11.0",
|
|
77
|
+
"jsdom": "^25.0.1",
|
|
67
78
|
"postcss": "^8.4.38",
|
|
68
|
-
"prettier": "^3.
|
|
69
|
-
"prettier-eslint": "^16.3.0",
|
|
79
|
+
"prettier": "^3.3.3",
|
|
70
80
|
"release-it": "^17.2.1",
|
|
71
|
-
"
|
|
81
|
+
"typescript": "^5.6.3",
|
|
82
|
+
"vite": "^5.4.9",
|
|
72
83
|
"vite-plugin-compression": "^0.5.1",
|
|
73
|
-
"vite-plugin-eslint": "^1.8.1",
|
|
74
84
|
"vue": "^3.5.4",
|
|
75
|
-
"vue-router": "^4.3.2"
|
|
85
|
+
"vue-router": "^4.3.2",
|
|
86
|
+
"vue-tsc": "^2.1.6"
|
|
76
87
|
},
|
|
77
88
|
"resolutions": {
|
|
78
89
|
"jackspeak": "2.3.6"
|
package/preset.tailwind.js
CHANGED
|
@@ -10,9 +10,14 @@ import {
|
|
|
10
10
|
DEFAULT_RING,
|
|
11
11
|
DEFAULT_RING_OFFSET,
|
|
12
12
|
DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
13
|
+
DEFAULT_BRAND_COLOR,
|
|
14
|
+
DEFAULT_GRAY_COLOR,
|
|
15
|
+
GRAYSCALE_COLOR,
|
|
13
16
|
} from "./constants.js";
|
|
14
17
|
|
|
15
18
|
const isStrategyOverride = process.env.VUELESS_STRATEGY === "override";
|
|
19
|
+
const brandColor = process.env.VUELESS_BRAND || DEFAULT_BRAND_COLOR;
|
|
20
|
+
const grayColor = process.env.VUELESS_GRAY || DEFAULT_GRAY_COLOR;
|
|
16
21
|
|
|
17
22
|
/**
|
|
18
23
|
* Vueless Tailwind CSS `content` config.
|
|
@@ -76,6 +81,9 @@ export const vuelessTailwindConfig = {
|
|
|
76
81
|
fontSize: {
|
|
77
82
|
"2xs": ["0.625rem", "0.875rem"] /* 10px / 14px */,
|
|
78
83
|
},
|
|
84
|
+
borderRadius: {
|
|
85
|
+
dynamic: "var(--vl-rounding)",
|
|
86
|
+
},
|
|
79
87
|
ringWidth: {
|
|
80
88
|
dynamic: "var(--vl-ring)",
|
|
81
89
|
},
|
|
@@ -83,10 +91,7 @@ export const vuelessTailwindConfig = {
|
|
|
83
91
|
dynamic: "var(--vl-ring-offset)",
|
|
84
92
|
},
|
|
85
93
|
ringOffsetColor: {
|
|
86
|
-
dynamic: "
|
|
87
|
-
},
|
|
88
|
-
borderRadius: {
|
|
89
|
-
dynamic: "var(--vl-rounding)",
|
|
94
|
+
dynamic: twColorWithOpacity("--vl-ring-offset-color"),
|
|
90
95
|
},
|
|
91
96
|
},
|
|
92
97
|
configViewer: {
|
|
@@ -96,8 +101,8 @@ export const vuelessTailwindConfig = {
|
|
|
96
101
|
"var(--vl-ring-offset)": DEFAULT_RING_OFFSET,
|
|
97
102
|
"var(--vl-ring-offset-color)": DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
98
103
|
"var(--vl-rounding)": DEFAULT_ROUNDING,
|
|
99
|
-
...getReplacementColors(GRAY_COLOR,
|
|
100
|
-
...getReplacementColors(BRAND_COLOR,
|
|
104
|
+
...getReplacementColors(GRAY_COLOR, grayColor),
|
|
105
|
+
...getReplacementColors(BRAND_COLOR, brandColor),
|
|
101
106
|
},
|
|
102
107
|
},
|
|
103
108
|
},
|
|
@@ -141,7 +146,7 @@ function twColorWithOpacity(variableName) {
|
|
|
141
146
|
* @returns { Object } - TailwindCSS color object palette.
|
|
142
147
|
*/
|
|
143
148
|
function getPalette(color) {
|
|
144
|
-
|
|
149
|
+
const palette = {
|
|
145
150
|
DEFAULT: twColorWithOpacity(`--vl-color-${color}-default`),
|
|
146
151
|
};
|
|
147
152
|
|
|
@@ -159,6 +164,10 @@ function getPalette(color) {
|
|
|
159
164
|
* @returns { Object } - `tailwind-config-viewer` color replacement object.
|
|
160
165
|
*/
|
|
161
166
|
function getReplacementColors(color, tailwindColor) {
|
|
167
|
+
if (tailwindColor === GRAYSCALE_COLOR || tailwindColor === COOL_COLOR) {
|
|
168
|
+
tailwindColor = GRAY_COLOR;
|
|
169
|
+
}
|
|
170
|
+
|
|
162
171
|
const varsPalette = {
|
|
163
172
|
[twColorWithOpacity(`--vl-color-${color}-default`)]: colors[tailwindColor][600],
|
|
164
173
|
};
|
package/types.ts
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { hasSlotContent } from "./composablesTs/useUI.ts";
|
|
2
|
+
|
|
3
|
+
// TODO: Import all components here
|
|
4
|
+
import UTextDefaultConfig from "./ui.text-block/config.ts";
|
|
5
|
+
import UButtonDefaultConfig from "./ui.button/config.ts";
|
|
6
|
+
|
|
7
|
+
import type { ComputedRef } from "vue";
|
|
8
|
+
|
|
9
|
+
export interface ThemeConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Components brand (primary) color.
|
|
12
|
+
*/
|
|
13
|
+
brand?: BrandColors;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Components gray (secondary) color.
|
|
17
|
+
*/
|
|
18
|
+
gray?: GrayColors;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Default components rounding (border-radius).
|
|
22
|
+
*/
|
|
23
|
+
rounding?: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Default components ring width.
|
|
27
|
+
*/
|
|
28
|
+
ring?: number;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Default components ring offset width.
|
|
32
|
+
*/
|
|
33
|
+
ringOffset?: number;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Default components ring color for light theme.
|
|
37
|
+
*/
|
|
38
|
+
ringOffsetColorLight?: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Default components ring color for dark theme.
|
|
42
|
+
*/
|
|
43
|
+
ringOffsetColorDark?: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Default dark mode state.
|
|
47
|
+
*/
|
|
48
|
+
darkMode?: boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface Config extends ThemeConfig {
|
|
52
|
+
/**
|
|
53
|
+
* Component classes merge behavior.
|
|
54
|
+
* – merge (default) – smartly merge provided custom classes with default config classes.
|
|
55
|
+
* – replace – replace default config keys by provided custom keys (override only provided keys, the rest classes will be taken from the default config).
|
|
56
|
+
* – override – override default config by provided custom config (keeps only custom config, removes all default classes).
|
|
57
|
+
*/
|
|
58
|
+
strategy?: Strategies;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Component configs.
|
|
62
|
+
*/
|
|
63
|
+
component?: Partial<Components>;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Tailwind-merge config extension for custom classes.
|
|
67
|
+
* All lists of rules available here:
|
|
68
|
+
* https://github.com/dcastil/tailwind-merge/blob/v2.3.0/src/lib/default-config.ts.
|
|
69
|
+
*/
|
|
70
|
+
tailwindMerge?: UnknownObject;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export type UnknownObject = Record<string, unknown>;
|
|
74
|
+
export type ComponentNames = keyof Components; // keys union
|
|
75
|
+
export type Strategies = "merge" | "replace" | "override";
|
|
76
|
+
export type GrayColors = "slate" | "cool" | "zinc" | "neutral" | "stone";
|
|
77
|
+
export type BrandColors =
|
|
78
|
+
| "grayscale"
|
|
79
|
+
| "red"
|
|
80
|
+
| "orange"
|
|
81
|
+
| "amber"
|
|
82
|
+
| "yellow"
|
|
83
|
+
| "lime"
|
|
84
|
+
| "green"
|
|
85
|
+
| "emerald"
|
|
86
|
+
| "teal"
|
|
87
|
+
| "cyan"
|
|
88
|
+
| "sky"
|
|
89
|
+
| "blue"
|
|
90
|
+
| "indigo"
|
|
91
|
+
| "violet"
|
|
92
|
+
| "purple"
|
|
93
|
+
| "fuchsia"
|
|
94
|
+
| "pink"
|
|
95
|
+
| "rose";
|
|
96
|
+
|
|
97
|
+
export interface Components {
|
|
98
|
+
UText?: Partial<typeof UTextDefaultConfig>;
|
|
99
|
+
UButton?: Partial<typeof UButtonDefaultConfig>;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface Component {
|
|
103
|
+
i18n?: UnknownObject;
|
|
104
|
+
defaults?: Defaults;
|
|
105
|
+
safelist?: () => TailwindSafelist[];
|
|
106
|
+
strategy?: Strategies;
|
|
107
|
+
transition?: Transition;
|
|
108
|
+
safelistColors?: BrandColors;
|
|
109
|
+
[key: string]: (CVA & NestedComponent) | object | string | undefined;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export type Defaults = {
|
|
113
|
+
color?: string;
|
|
114
|
+
[key: string]: unknown;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export interface NestedComponent {
|
|
118
|
+
component: string;
|
|
119
|
+
[key: string]: Record<string, string | object> | string;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface Transition {
|
|
123
|
+
enterFromClass?: string;
|
|
124
|
+
enterActiveClass?: string;
|
|
125
|
+
enterToClass?: string;
|
|
126
|
+
leaveFromClass?: string;
|
|
127
|
+
leaveActiveClass?: string;
|
|
128
|
+
leaveToClass?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface CVA {
|
|
132
|
+
base?: string;
|
|
133
|
+
variants?: UnknownObject;
|
|
134
|
+
compoundVariants?: CVACompoundVariants[] & never[];
|
|
135
|
+
defaultVariants?: UnknownObject;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface CVACompoundVariants {
|
|
139
|
+
class: string;
|
|
140
|
+
[key: string]: string | number | undefined | null;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface VueAttrs {
|
|
144
|
+
id?: string;
|
|
145
|
+
class?: string;
|
|
146
|
+
value?: string;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface UseAttrs {
|
|
150
|
+
hasSlotContent: typeof hasSlotContent;
|
|
151
|
+
[key: string]: object | undefined;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface KeyAttrs extends VueAttrs {
|
|
155
|
+
"vl-component"?: string | null;
|
|
156
|
+
"vl-key"?: string | null;
|
|
157
|
+
"vl-child-component"?: string | null;
|
|
158
|
+
"vl-child-key"?: string | null;
|
|
159
|
+
config?: UnknownObject;
|
|
160
|
+
[key: string]: string | UnknownObject | undefined | null;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export interface KeysToExtend {
|
|
164
|
+
base?: ComputedRef;
|
|
165
|
+
extend?: ComputedRef;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface CreateVuelessOptions {
|
|
169
|
+
i18n?: Record<string, string | object>;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface TailwindSafelist {
|
|
173
|
+
pattern: string;
|
|
174
|
+
variants?: string[];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface TailwindColorShades {
|
|
178
|
+
DEFAULT: string;
|
|
179
|
+
50: string;
|
|
180
|
+
100: string;
|
|
181
|
+
200: string;
|
|
182
|
+
300: string;
|
|
183
|
+
400: string;
|
|
184
|
+
500: string;
|
|
185
|
+
600: string;
|
|
186
|
+
700: string;
|
|
187
|
+
800: string;
|
|
188
|
+
900: string;
|
|
189
|
+
950: string;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface VuelessCssVariables {
|
|
193
|
+
"--vl-ring": string;
|
|
194
|
+
"--vl-ring-offset": string;
|
|
195
|
+
"--vl-ring-offset-color": string;
|
|
196
|
+
"--vl-rounding": string;
|
|
197
|
+
/* Gray CSS variables */
|
|
198
|
+
"--vl-color-gray-50": string;
|
|
199
|
+
"--vl-color-gray-100": string;
|
|
200
|
+
"--vl-color-gray-200": string;
|
|
201
|
+
"--vl-color-gray-300": string;
|
|
202
|
+
"--vl-color-gray-400": string;
|
|
203
|
+
"--vl-color-gray-500": string;
|
|
204
|
+
"--vl-color-gray-600": string;
|
|
205
|
+
"--vl-color-gray-700": string;
|
|
206
|
+
"--vl-color-gray-800": string;
|
|
207
|
+
"--vl-color-gray-900": string;
|
|
208
|
+
"--vl-color-gray-950": string;
|
|
209
|
+
"--vl-color-gray-default": string;
|
|
210
|
+
/* Brand CSS variables */
|
|
211
|
+
"--vl-color-brand-50": string;
|
|
212
|
+
"--vl-color-brand-100": string;
|
|
213
|
+
"--vl-color-brand-200": string;
|
|
214
|
+
"--vl-color-brand-300": string;
|
|
215
|
+
"--vl-color-brand-400": string;
|
|
216
|
+
"--vl-color-brand-500": string;
|
|
217
|
+
"--vl-color-brand-600": string;
|
|
218
|
+
"--vl-color-brand-700": string;
|
|
219
|
+
"--vl-color-brand-800": string;
|
|
220
|
+
"--vl-color-brand-900": string;
|
|
221
|
+
"--vl-color-brand-950": string;
|
|
222
|
+
"--vl-color-brand-default": string;
|
|
223
|
+
}
|
package/ui.button/config.js
CHANGED
|
@@ -161,4 +161,16 @@ export default /*tw*/ {
|
|
|
161
161
|
loading: false,
|
|
162
162
|
disabled: false,
|
|
163
163
|
},
|
|
164
|
+
safelist: (colors) => [
|
|
165
|
+
{ pattern: `border-(${colors})-600` },
|
|
166
|
+
{ pattern: `border-(${colors})-700`, variants: ["hover", "focus"] },
|
|
167
|
+
{ pattern: `border-(${colors})-800`, variants: ["active"] },
|
|
168
|
+
{ pattern: `bg-(${colors})-600` },
|
|
169
|
+
{ pattern: `bg-(${colors})-700`, variants: ["hover", "focus"] },
|
|
170
|
+
{ pattern: `bg-(${colors})-800`, variants: ["active"] },
|
|
171
|
+
{ pattern: `text-(${colors})-600` },
|
|
172
|
+
{ pattern: `text-(${colors})-700`, variants: ["hover", "focus"] },
|
|
173
|
+
{ pattern: `text-(${colors})-800`, variants: ["active"] },
|
|
174
|
+
{ pattern: `ring-(${colors})-700`, variants: ["focus", "focus-within"] },
|
|
175
|
+
],
|
|
164
176
|
};
|
package/ui.button-link/ULink.vue
CHANGED
package/ui.button-link/config.js
CHANGED
|
@@ -80,4 +80,13 @@ export default /*tw*/ {
|
|
|
80
80
|
custom: false,
|
|
81
81
|
replace: false,
|
|
82
82
|
},
|
|
83
|
+
safelist: (colors) => [
|
|
84
|
+
{ pattern: `text-(${colors})-600` },
|
|
85
|
+
{ pattern: `text-(${colors})-700`, variants: ["hover", "focus"] },
|
|
86
|
+
{ pattern: `text-(${colors})-800`, variants: ["active"] },
|
|
87
|
+
{ pattern: `decoration-(${colors})-600` },
|
|
88
|
+
{ pattern: `decoration-(${colors})-700`, variants: ["hover", "focus"] },
|
|
89
|
+
{ pattern: `decoration-(${colors})-800`, variants: ["active"] },
|
|
90
|
+
{ pattern: `ring-(${colors})-700`, variants: ["focus-within"] },
|
|
91
|
+
],
|
|
83
92
|
};
|
|
@@ -366,20 +366,20 @@ function onClickDelete(value, label) {
|
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
function prepareSortData(list, parentId) {
|
|
369
|
-
|
|
369
|
+
const sortData = [];
|
|
370
370
|
|
|
371
371
|
list.forEach((item) => {
|
|
372
|
-
|
|
372
|
+
const hasItemChildren = item?.children?.length;
|
|
373
373
|
|
|
374
374
|
if (hasItemChildren) {
|
|
375
|
-
|
|
375
|
+
const childrenItem = prepareSortData(item.children, item[props.valueKey]);
|
|
376
376
|
|
|
377
377
|
childrenItem.forEach((item) => {
|
|
378
378
|
sortData.push(item);
|
|
379
379
|
});
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
|
|
382
|
+
const parentItem = { ...item, parentId: 0 || parentId };
|
|
383
383
|
|
|
384
384
|
sortData.push(parentItem);
|
|
385
385
|
});
|
|
@@ -51,4 +51,13 @@ export default /*tw*/ {
|
|
|
51
51
|
partiallyCheckedIcon: "remove",
|
|
52
52
|
checkedIcon: "check",
|
|
53
53
|
},
|
|
54
|
+
safelist: (colors) => [
|
|
55
|
+
{ pattern: `bg-(${colors})-600` },
|
|
56
|
+
{ pattern: `bg-(${colors})-700`, variants: ["hover"] },
|
|
57
|
+
{ pattern: `bg-(${colors})-800`, variants: ["active"] },
|
|
58
|
+
{ pattern: `border-(${colors})-500`, variants: ["focus"] },
|
|
59
|
+
{ pattern: `border-(${colors})-800`, variants: ["active"] },
|
|
60
|
+
{ pattern: `text-(${colors})-600`, variants: ["checked"] },
|
|
61
|
+
{ pattern: `ring-(${colors})-700`, variants: ["focus"] },
|
|
62
|
+
],
|
|
54
63
|
};
|
|
@@ -49,4 +49,11 @@ export default /*tw*/ {
|
|
|
49
49
|
/* icons */
|
|
50
50
|
unselectedIcon: "close",
|
|
51
51
|
},
|
|
52
|
+
safelist: (colors) => [
|
|
53
|
+
{ pattern: `bg-(${colors})-400`, variants: ["disabled"] },
|
|
54
|
+
{ pattern: `bg-(${colors})-600` },
|
|
55
|
+
{ pattern: `bg-(${colors})-800`, variants: ["active"] },
|
|
56
|
+
{ pattern: `border-(${colors})-400`, variants: ["disabled"] },
|
|
57
|
+
{ pattern: `border-(${colors})-600`, variants: ["hover"] },
|
|
58
|
+
],
|
|
52
59
|
};
|
package/ui.form-input/UInput.vue
CHANGED
|
@@ -459,7 +459,7 @@ function setLabelPosition() {
|
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
461
|
|
|
462
|
-
|
|
462
|
+
const leftSlotOrIconWidth = leftSlotWrapperRef.value.getBoundingClientRect().width;
|
|
463
463
|
|
|
464
464
|
const leftPaddingValue = parseFloat(getComputedStyle(inputRef.value).paddingLeft);
|
|
465
465
|
|
|
@@ -6,8 +6,9 @@
|
|
|
6
6
|
:error="error"
|
|
7
7
|
:size="size"
|
|
8
8
|
:align="labelAlign"
|
|
9
|
-
|
|
9
|
+
centred
|
|
10
10
|
v-bind="labelAttrs"
|
|
11
|
+
:data-test="dataTest"
|
|
11
12
|
>
|
|
12
13
|
<UButton
|
|
13
14
|
variant="thirdary"
|
|
@@ -17,6 +18,7 @@
|
|
|
17
18
|
round
|
|
18
19
|
:disabled="isRemoveButtonDisabled || disabled"
|
|
19
20
|
v-bind="removeButtonAttrs"
|
|
21
|
+
:data-test="`${dataTest}-remove`"
|
|
20
22
|
@click="onClickRemove"
|
|
21
23
|
>
|
|
22
24
|
<UIcon
|
|
@@ -24,7 +26,6 @@
|
|
|
24
26
|
:size="size"
|
|
25
27
|
:name="config.defaults.removeIcon"
|
|
26
28
|
:color="isRemoveButtonDisabled ? 'gray' : 'grayscale'"
|
|
27
|
-
:data-test="`${dataTest}-remove`"
|
|
28
29
|
v-bind="removeIconAttrs"
|
|
29
30
|
/>
|
|
30
31
|
</UButton>
|
|
@@ -41,6 +42,7 @@
|
|
|
41
42
|
round
|
|
42
43
|
:disabled="isAddButtonDisabled || disabled"
|
|
43
44
|
v-bind="addButtonAttrs"
|
|
45
|
+
:data-test="`${dataTest}-add`"
|
|
44
46
|
@click="onClickAdd"
|
|
45
47
|
>
|
|
46
48
|
<UIcon
|
|
@@ -48,7 +50,6 @@
|
|
|
48
50
|
:size="size"
|
|
49
51
|
:name="config.defaults.addIcon"
|
|
50
52
|
:color="isAddButtonDisabled ? 'gray' : 'grayscale'"
|
|
51
|
-
:data-test="`${dataTest}-add`"
|
|
52
53
|
v-bind="addIconAttrs"
|
|
53
54
|
/>
|
|
54
55
|
</UButton>
|
package/ui.form-label/config.js
CHANGED
|
@@ -20,8 +20,8 @@ export default /*tw*/ {
|
|
|
20
20
|
{ align: "right", size: "sm", class: "gap-2.5" },
|
|
21
21
|
{ align: "right", size: "md", class: "gap-3" },
|
|
22
22
|
{ align: "right", size: "lg", class: "gap-3.5" },
|
|
23
|
-
{ align: "left", centred: true, class: "items-center w-auto" },
|
|
24
|
-
{ align: "right", centred: true, class: "items-center w-auto" },
|
|
23
|
+
{ align: "left", centred: true, class: "items-center justify-end w-auto" },
|
|
24
|
+
{ align: "right", centred: true, class: "items-center justify-start w-auto" },
|
|
25
25
|
],
|
|
26
26
|
},
|
|
27
27
|
content: {
|
package/ui.form-radio/config.js
CHANGED
|
@@ -26,4 +26,10 @@ export default /*tw*/ {
|
|
|
26
26
|
checked: false,
|
|
27
27
|
disabled: false,
|
|
28
28
|
},
|
|
29
|
+
safelist: (colors) => [
|
|
30
|
+
{ pattern: `border-(${colors})-500`, variants: ["focus"] },
|
|
31
|
+
{ pattern: `border-(${colors})-800`, variants: ["active"] },
|
|
32
|
+
{ pattern: `text-(${colors})-600`, variants: ["checked"] },
|
|
33
|
+
{ pattern: `ring-(${colors})-700`, variants: ["focus"] },
|
|
34
|
+
],
|
|
29
35
|
};
|
package/ui.form-switch/config.js
CHANGED
|
@@ -79,4 +79,10 @@ export default /*tw*/ {
|
|
|
79
79
|
onIcon: "check",
|
|
80
80
|
offIcon: "close",
|
|
81
81
|
},
|
|
82
|
+
safelist: (colors) => [
|
|
83
|
+
{ pattern: `ring-(${colors})-700` },
|
|
84
|
+
{ pattern: `bg-(${colors})-600` },
|
|
85
|
+
{ pattern: `bg-(${colors})-700`, variants: ["hover"] },
|
|
86
|
+
{ pattern: `bg-(${colors})-800`, variants: ["active"] },
|
|
87
|
+
],
|
|
82
88
|
};
|
package/ui.image-icon/config.js
CHANGED
package/ui.loader/config.js
CHANGED