vueless 0.0.674 → 0.0.676
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/bin/commands/create.js +77 -0
- package/bin/commands/index.js +2 -0
- package/bin/commands/init.js +4 -8
- package/bin/constants.js +2 -5
- package/bin/index.js +1 -1
- package/bin/utils/dataUtils.js +53 -0
- package/bin/utils/formatUtil.js +48 -0
- package/composables/useUI.ts +12 -1
- package/constants.js +6 -0
- package/package.json +2 -2
- package/plugin-vite.js +3 -1
- package/types.ts +1 -1
- package/ui.boilerplate/storybook/stories.ts +1 -1
- package/ui.boilerplate/types.ts +1 -1
- package/ui.button/UButton.vue +9 -6
- package/ui.button/types.ts +1 -1
- package/ui.button-link/ULink.vue +37 -62
- package/ui.button-link/config.ts +8 -35
- package/ui.button-link/storybook/stories.ts +0 -22
- package/ui.button-link/types.ts +1 -11
- package/ui.button-toggle/types.ts +1 -1
- package/ui.button-toggle-item/types.ts +1 -1
- package/ui.container-accordion/types.ts +1 -1
- package/ui.container-card/types.ts +1 -1
- package/ui.container-col/types.ts +1 -1
- package/ui.container-divider/types.ts +1 -1
- package/ui.container-group/types.ts +1 -1
- package/ui.container-groups/types.ts +1 -1
- package/ui.container-modal/UModal.vue +21 -20
- package/ui.container-modal/config.ts +3 -2
- package/ui.container-modal/types.ts +1 -1
- package/ui.container-modal-confirm/types.ts +1 -1
- package/ui.container-page/UPage.vue +31 -19
- package/ui.container-page/config.ts +1 -0
- package/ui.container-page/types.ts +1 -1
- package/ui.container-row/types.ts +1 -1
- package/ui.data-list/types.ts +1 -1
- package/ui.data-table/types.ts +1 -1
- package/ui.dropdown-badge/types.ts +1 -1
- package/ui.dropdown-button/types.ts +1 -1
- package/ui.dropdown-link/UDropdownLink.vue +29 -33
- package/ui.dropdown-link/config.ts +3 -3
- package/ui.dropdown-link/types.ts +1 -1
- package/ui.dropdown-list/types.ts +1 -1
- package/ui.form-calendar/types.ts +1 -1
- package/ui.form-checkbox/types.ts +1 -1
- package/ui.form-checkbox-group/types.ts +1 -1
- package/ui.form-checkbox-multi-state/types.ts +1 -1
- package/ui.form-date-picker/types.ts +1 -1
- package/ui.form-date-picker-range/types.ts +1 -1
- package/ui.form-input/types.ts +1 -1
- package/ui.form-input-file/types.ts +1 -1
- package/ui.form-input-money/types.ts +1 -1
- package/ui.form-input-number/types.ts +1 -1
- package/ui.form-input-rating/types.ts +1 -1
- package/ui.form-input-search/types.ts +1 -1
- package/ui.form-label/types.ts +1 -1
- package/ui.form-radio/types.ts +1 -1
- package/ui.form-radio-group/types.ts +1 -1
- package/ui.form-select/USelect.vue +8 -6
- package/ui.form-select/types.ts +1 -1
- package/ui.form-switch/types.ts +1 -1
- package/ui.form-textarea/types.ts +1 -1
- package/ui.image-avatar/types.ts +1 -1
- package/ui.image-icon/UIcon.vue +2 -18
- package/ui.image-icon/storybook/stories.ts +0 -3
- package/ui.image-icon/types.ts +1 -13
- package/ui.loader/types.ts +1 -1
- package/ui.loader-overlay/types.ts +1 -1
- package/ui.loader-progress/types.ts +1 -1
- package/ui.navigation-pagination/types.ts +1 -1
- package/ui.navigation-progress/types.ts +2 -2
- package/ui.navigation-tab/types.ts +1 -1
- package/ui.navigation-tabs/types.ts +1 -1
- package/ui.other-dot/types.ts +1 -1
- package/ui.other-theme-color-toggle/storybook/stories.ts +1 -1
- package/ui.other-theme-color-toggle/types.ts +1 -1
- package/ui.text-alert/types.ts +1 -1
- package/ui.text-badge/types.ts +1 -1
- package/ui.text-block/types.ts +1 -1
- package/ui.text-empty/types.ts +1 -1
- package/ui.text-file/types.ts +1 -1
- package/ui.text-files/types.ts +1 -1
- package/ui.text-header/types.ts +1 -1
- package/ui.text-money/types.ts +1 -1
- package/ui.text-notify/types.ts +1 -1
- package/ui.text-number/types.ts +1 -1
- package/utils/theme.ts +5 -1
package/ui.image-icon/UIcon.vue
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { computed, defineAsyncComponent } from "vue";
|
|
3
3
|
|
|
4
4
|
import useUI from "../composables/useUI.ts";
|
|
5
|
-
import { vTooltip } from "../directives";
|
|
6
5
|
import { getDefaults } from "../utils/ui.ts";
|
|
7
6
|
import { isSSR } from "../utils/helper.ts";
|
|
8
7
|
import { VUELESS_ICONS_CACHED_DIR, VUELESS_LIBRARY } from "../constants.js";
|
|
@@ -12,13 +11,11 @@ import defaultConfig from "./config.ts";
|
|
|
12
11
|
|
|
13
12
|
import type { AsyncComponentLoader } from "vue";
|
|
14
13
|
import type { Props, Config, IconLibraries } from "./types.ts";
|
|
15
|
-
import type { Props as TippyProps, Instance as TippyInstance } from "tippy.js";
|
|
16
14
|
|
|
17
15
|
defineOptions({ inheritAttrs: false });
|
|
18
16
|
|
|
19
17
|
const props = withDefaults(defineProps<Props>(), {
|
|
20
18
|
...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
|
|
21
|
-
tooltipSettings: () => ({}) as TippyProps,
|
|
22
19
|
});
|
|
23
20
|
|
|
24
21
|
const emit = defineEmits([
|
|
@@ -128,18 +125,6 @@ const dynamicComponent = computed(() => {
|
|
|
128
125
|
return defineAsyncComponent(libraries[library] as AsyncComponentLoader);
|
|
129
126
|
});
|
|
130
127
|
|
|
131
|
-
const tooltipConfig = computed(() => ({
|
|
132
|
-
...props.tooltipSettings,
|
|
133
|
-
content: props.tooltip,
|
|
134
|
-
onShow: (instance: TippyInstance) => {
|
|
135
|
-
const userOnShow = props.tooltipSettings?.onShow;
|
|
136
|
-
|
|
137
|
-
userOnShow && userOnShow(instance);
|
|
138
|
-
|
|
139
|
-
return !!props.tooltip;
|
|
140
|
-
},
|
|
141
|
-
}));
|
|
142
|
-
|
|
143
128
|
function onClick(event: MouseEvent) {
|
|
144
129
|
emit("click", event);
|
|
145
130
|
}
|
|
@@ -148,16 +133,15 @@ function onClick(event: MouseEvent) {
|
|
|
148
133
|
* Get element / nested component attributes for each config token ✨
|
|
149
134
|
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
150
135
|
*/
|
|
151
|
-
const { config, iconAttrs } = useUI<Config>(defaultConfig);
|
|
136
|
+
const { getDataTest, config, iconAttrs } = useUI<Config>(defaultConfig);
|
|
152
137
|
</script>
|
|
153
138
|
|
|
154
139
|
<template>
|
|
155
140
|
<component
|
|
156
141
|
:is="dynamicComponent"
|
|
157
|
-
v-tooltip="tooltipConfig"
|
|
158
142
|
tabindex="-1"
|
|
159
143
|
v-bind="iconAttrs"
|
|
160
|
-
:data-test="
|
|
144
|
+
:data-test="getDataTest()"
|
|
161
145
|
@click="onClick"
|
|
162
146
|
/>
|
|
163
147
|
</template>
|
|
@@ -79,8 +79,5 @@ Sizes.args = { enum: "size" };
|
|
|
79
79
|
export const Variants = EnumVariantTemplate.bind({});
|
|
80
80
|
Variants.args = { enum: "variant", color: "red" };
|
|
81
81
|
|
|
82
|
-
export const Tooltip = DefaultTemplate.bind({});
|
|
83
|
-
Tooltip.args = { tooltip: "Some text" };
|
|
84
|
-
|
|
85
82
|
export const Interactive = DefaultTemplate.bind({});
|
|
86
83
|
Interactive.args = { interactive: true };
|
package/ui.image-icon/types.ts
CHANGED
|
@@ -3,7 +3,6 @@ import defaultConfig from "./config.ts";
|
|
|
3
3
|
import type { DefineComponent, SVGAttributes } from "vue";
|
|
4
4
|
|
|
5
5
|
import type { ComponentConfig } from "../types.ts";
|
|
6
|
-
import type { Props as TippyProps } from "tippy.js";
|
|
7
6
|
|
|
8
7
|
export type Config = typeof defaultConfig;
|
|
9
8
|
|
|
@@ -68,17 +67,6 @@ export interface Props {
|
|
|
68
67
|
*/
|
|
69
68
|
interactive?: boolean;
|
|
70
69
|
|
|
71
|
-
/**
|
|
72
|
-
* Add tooltip text on hover.
|
|
73
|
-
*/
|
|
74
|
-
tooltip?: string;
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Tooltip settings.
|
|
78
|
-
* [See all settings here](https://kabbouchi.github.io/vue-tippy/4.0/features/placement.html).
|
|
79
|
-
*/
|
|
80
|
-
tooltipSettings?: TippyProps;
|
|
81
|
-
|
|
82
70
|
/**
|
|
83
71
|
* Mark that Icon used inside Vueless components (used to get icons from vueless library).
|
|
84
72
|
*/
|
|
@@ -92,5 +80,5 @@ export interface Props {
|
|
|
92
80
|
/**
|
|
93
81
|
* Data-test attribute for automated testing.
|
|
94
82
|
*/
|
|
95
|
-
dataTest?: string;
|
|
83
|
+
dataTest?: string | null;
|
|
96
84
|
}
|
package/ui.loader/types.ts
CHANGED
|
@@ -63,7 +63,7 @@ export interface UProgressProps {
|
|
|
63
63
|
/**
|
|
64
64
|
* Data-test attribute for automated testing.
|
|
65
65
|
*/
|
|
66
|
-
dataTest?: string;
|
|
66
|
+
dataTest?: string | null;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export interface StepperProgressProps {
|
|
@@ -90,5 +90,5 @@ export interface StepperProgressProps {
|
|
|
90
90
|
/**
|
|
91
91
|
* Data-test attribute for automated testing.
|
|
92
92
|
*/
|
|
93
|
-
dataTest?: string;
|
|
93
|
+
dataTest?: string | null;
|
|
94
94
|
}
|
package/ui.other-dot/types.ts
CHANGED
package/ui.text-alert/types.ts
CHANGED
package/ui.text-badge/types.ts
CHANGED
package/ui.text-block/types.ts
CHANGED
package/ui.text-empty/types.ts
CHANGED
package/ui.text-file/types.ts
CHANGED
package/ui.text-files/types.ts
CHANGED
package/ui.text-header/types.ts
CHANGED
package/ui.text-money/types.ts
CHANGED
package/ui.text-notify/types.ts
CHANGED
package/ui.text-number/types.ts
CHANGED
package/utils/theme.ts
CHANGED
|
@@ -115,7 +115,7 @@ export function setTheme(config: Config = {}) {
|
|
|
115
115
|
const roundingLg = config.roundingLg ?? vuelessConfig.roundingLg ?? rounding * 2;
|
|
116
116
|
const isDarkMode = isCSR && document.documentElement.classList.contains(DARK_MODE_SELECTOR);
|
|
117
117
|
|
|
118
|
-
|
|
118
|
+
let brand: BrandColors =
|
|
119
119
|
config.brand ?? getSelectedBrandColor() ?? vuelessConfig.brand ?? DEFAULT_BRAND_COLOR;
|
|
120
120
|
|
|
121
121
|
let gray: GrayColors =
|
|
@@ -142,6 +142,10 @@ export function setTheme(config: Config = {}) {
|
|
|
142
142
|
gray = GRAY_COLOR;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
if (brand === GRAYSCALE_COLOR) {
|
|
146
|
+
brand = gray;
|
|
147
|
+
}
|
|
148
|
+
|
|
145
149
|
/* Remove deprecated color aliases. */
|
|
146
150
|
delete (tailwindColors as Partial<DefaultColors>).lightBlue;
|
|
147
151
|
delete (tailwindColors as Partial<DefaultColors>).warmGray;
|