vueless 1.1.1-beta.39 → 1.1.1-beta.40
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 +2 -2
- package/index.d.ts +41 -0
- package/index.ts +41 -0
- package/package.json +1 -1
- package/types.ts +4 -12
- package/utils/ui.ts +2 -2
package/composables/useUI.ts
CHANGED
|
@@ -13,7 +13,6 @@ import type { Ref, ComputedRef } from "vue";
|
|
|
13
13
|
import type {
|
|
14
14
|
CVA,
|
|
15
15
|
UseUI,
|
|
16
|
-
Defaults,
|
|
17
16
|
KeyAttrs,
|
|
18
17
|
KeysAttrs,
|
|
19
18
|
MutatedProps,
|
|
@@ -21,6 +20,7 @@ import type {
|
|
|
21
20
|
PrimaryColors,
|
|
22
21
|
ComponentNames,
|
|
23
22
|
NestedComponent,
|
|
23
|
+
ComponentDefaults,
|
|
24
24
|
ComponentConfigFull,
|
|
25
25
|
VuelessComponentInstance,
|
|
26
26
|
} from "../types.ts";
|
|
@@ -235,7 +235,7 @@ export default function useUI<T>(
|
|
|
235
235
|
* Use an object where key = parent component prop value, value = nested component prop value.
|
|
236
236
|
* */
|
|
237
237
|
function getDefaults(defaultAttrs: NestedComponent["defaults"]) {
|
|
238
|
-
const defaults:
|
|
238
|
+
const defaults: ComponentDefaults = {};
|
|
239
239
|
|
|
240
240
|
for (const key in defaultAttrs) {
|
|
241
241
|
defaults[key] =
|
package/index.d.ts
CHANGED
|
@@ -124,6 +124,47 @@ export { default as UChip } from "./ui.other-chip/UChip.vue";
|
|
|
124
124
|
export { default as UThemeColorToggle } from "./ui.other-theme-color-toggle/UThemeColorToggle.vue";
|
|
125
125
|
/* eslint-enable prettier/prettier */
|
|
126
126
|
|
|
127
|
+
/* types */
|
|
128
|
+
export type {
|
|
129
|
+
/* Core configuration types */
|
|
130
|
+
Config,
|
|
131
|
+
ThemeConfig,
|
|
132
|
+
ThemeConfigText,
|
|
133
|
+
ThemeConfigRounding,
|
|
134
|
+
ThemeConfigOutline,
|
|
135
|
+
NestedComponent,
|
|
136
|
+
ComponentConfig,
|
|
137
|
+
ComponentDefaults,
|
|
138
|
+
CreateVuelessOptions,
|
|
139
|
+
/* Color and theme types */
|
|
140
|
+
StateColors,
|
|
141
|
+
PrimaryColors,
|
|
142
|
+
NeutralColors,
|
|
143
|
+
VuelessCssVariables,
|
|
144
|
+
/* Component and Directive types */
|
|
145
|
+
Directives,
|
|
146
|
+
Components,
|
|
147
|
+
ComponentNames,
|
|
148
|
+
/* Utility types */
|
|
149
|
+
UnknownType,
|
|
150
|
+
UnknownArray,
|
|
151
|
+
UnknownObject,
|
|
152
|
+
CVACompoundVariants,
|
|
153
|
+
CVA,
|
|
154
|
+
/* Vue component utility types */
|
|
155
|
+
ComponentType,
|
|
156
|
+
ComponentProps,
|
|
157
|
+
ComponentSlots,
|
|
158
|
+
ComponentEmit,
|
|
159
|
+
ComponentExposed,
|
|
160
|
+
/* Locale types */
|
|
161
|
+
LocaleOptions,
|
|
162
|
+
LocaleInstance,
|
|
163
|
+
LocaleMessages,
|
|
164
|
+
} from "./types.ts";
|
|
165
|
+
/* Export enums directly (not as types) */
|
|
166
|
+
export { ColorMode } from "./types.ts";
|
|
167
|
+
|
|
127
168
|
export declare function createVueless(options?: CreateVuelessOptions): {
|
|
128
169
|
install: (app: App) => void;
|
|
129
170
|
};
|
package/index.ts
CHANGED
|
@@ -130,6 +130,47 @@ export { default as UChip } from "./ui.other-chip/UChip.vue";
|
|
|
130
130
|
export { default as UThemeColorToggle } from "./ui.other-theme-color-toggle/UThemeColorToggle.vue";
|
|
131
131
|
/* eslint-enable prettier/prettier */
|
|
132
132
|
|
|
133
|
+
/* types */
|
|
134
|
+
export type {
|
|
135
|
+
/* Core configuration types */
|
|
136
|
+
Config,
|
|
137
|
+
ThemeConfig,
|
|
138
|
+
ThemeConfigText,
|
|
139
|
+
ThemeConfigRounding,
|
|
140
|
+
ThemeConfigOutline,
|
|
141
|
+
NestedComponent,
|
|
142
|
+
ComponentConfig,
|
|
143
|
+
ComponentDefaults,
|
|
144
|
+
CreateVuelessOptions,
|
|
145
|
+
/* Color and theme types */
|
|
146
|
+
StateColors,
|
|
147
|
+
PrimaryColors,
|
|
148
|
+
NeutralColors,
|
|
149
|
+
VuelessCssVariables,
|
|
150
|
+
/* Component and Directive types */
|
|
151
|
+
Directives,
|
|
152
|
+
Components,
|
|
153
|
+
ComponentNames,
|
|
154
|
+
/* Utility types */
|
|
155
|
+
UnknownType,
|
|
156
|
+
UnknownArray,
|
|
157
|
+
UnknownObject,
|
|
158
|
+
CVACompoundVariants,
|
|
159
|
+
CVA,
|
|
160
|
+
/* Vue component utility types */
|
|
161
|
+
ComponentType,
|
|
162
|
+
ComponentProps,
|
|
163
|
+
ComponentSlots,
|
|
164
|
+
ComponentEmit,
|
|
165
|
+
ComponentExposed,
|
|
166
|
+
/* Locale types */
|
|
167
|
+
LocaleOptions,
|
|
168
|
+
LocaleInstance,
|
|
169
|
+
LocaleMessages,
|
|
170
|
+
} from "./types.ts";
|
|
171
|
+
/* Export enums directly (not as types) */
|
|
172
|
+
export { ColorMode } from "./types.ts";
|
|
173
|
+
|
|
133
174
|
export function createVueless(options: CreateVuelessOptions = {}) {
|
|
134
175
|
const i18n = createLocale(options.i18n);
|
|
135
176
|
const loaderOverlay = createLoaderOverlay();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "1.1.1-beta.
|
|
3
|
+
"version": "1.1.1-beta.40",
|
|
4
4
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
package/types.ts
CHANGED
|
@@ -60,7 +60,7 @@ import UListboxConfig from "./ui.form-listbox/config";
|
|
|
60
60
|
|
|
61
61
|
import type { Props } from "tippy.js";
|
|
62
62
|
import type { Config as TailwindConfig } from "tailwindcss";
|
|
63
|
-
import type { ComputedRef, Ref, ComponentInternalInstance } from "vue";
|
|
63
|
+
import type { ComputedRef, Ref, ComponentInternalInstance, TransitionProps } from "vue";
|
|
64
64
|
|
|
65
65
|
export enum ColorMode {
|
|
66
66
|
Dark = "dark",
|
|
@@ -220,6 +220,7 @@ export type PrimaryColors =
|
|
|
220
220
|
|
|
221
221
|
export interface Directives {
|
|
222
222
|
tooltip?: Partial<Props>;
|
|
223
|
+
clickOutside?: Partial<Props>;
|
|
223
224
|
}
|
|
224
225
|
|
|
225
226
|
export interface Components {
|
|
@@ -289,7 +290,7 @@ export interface Components {
|
|
|
289
290
|
export type ComponentConfig<T> = Partial<{
|
|
290
291
|
[K in keyof T]: K extends string
|
|
291
292
|
? K extends `${string}transition${string}` | `${string}Transition${string}`
|
|
292
|
-
?
|
|
293
|
+
? TransitionProps
|
|
293
294
|
: K extends "i18n"
|
|
294
295
|
? T[K]
|
|
295
296
|
: T[K] | string | UnknownObject
|
|
@@ -304,20 +305,11 @@ export interface NestedComponent {
|
|
|
304
305
|
[key: string]: Record<string, string | UnknownObject> | string | undefined;
|
|
305
306
|
}
|
|
306
307
|
|
|
307
|
-
export type
|
|
308
|
+
export type ComponentDefaults = {
|
|
308
309
|
color?: string;
|
|
309
310
|
[key: string]: unknown | UnknownObject;
|
|
310
311
|
};
|
|
311
312
|
|
|
312
|
-
export interface Transition {
|
|
313
|
-
enterFromClass?: string;
|
|
314
|
-
enterActiveClass?: string;
|
|
315
|
-
enterToClass?: string;
|
|
316
|
-
leaveFromClass?: string;
|
|
317
|
-
leaveActiveClass?: string;
|
|
318
|
-
leaveToClass?: string;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
313
|
export interface CVA {
|
|
322
314
|
base?: string;
|
|
323
315
|
variants?: UnknownObject;
|
package/utils/ui.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { createGetMergedConfig } from "./node/mergeConfigs.js";
|
|
|
7
7
|
import { COMPONENT_NAME as U_ICON } from "../ui.image-icon/constants.ts";
|
|
8
8
|
import { ICON_NON_PROPS_DEFAULTS, TAILWIND_MERGE_EXTENSION } from "../constants.js";
|
|
9
9
|
|
|
10
|
-
import type { Config,
|
|
10
|
+
import type { Config, ComponentDefaults, UnknownObject, ComponentNames } from "../types.ts";
|
|
11
11
|
|
|
12
12
|
interface MergedConfigOptions {
|
|
13
13
|
defaultConfig: unknown;
|
|
@@ -79,7 +79,7 @@ export function getDefaults<Props, Config>(defaultConfig: Config, name: Componen
|
|
|
79
79
|
const componentDefaults = (defaultConfig as UnknownObject).defaults || {};
|
|
80
80
|
const globalDefaults = vuelessConfig.components?.[name]?.defaults || {};
|
|
81
81
|
|
|
82
|
-
const defaults = merge({}, componentDefaults, globalDefaults) as Props &
|
|
82
|
+
const defaults = merge({}, componentDefaults, globalDefaults) as Props & ComponentDefaults;
|
|
83
83
|
|
|
84
84
|
/* Remove non a props defaults. */
|
|
85
85
|
for (const key in defaults) {
|