vueless 0.0.702 → 0.0.704
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/constants.js +2 -2
- package/constants.js +2 -2
- package/package.json +1 -1
- package/ui.button/config.ts +8 -26
- package/ui.button/storybook/stories.ts +0 -3
- package/ui.button/types.ts +0 -5
- package/ui.button-link/config.ts +3 -9
- package/ui.button-link/storybook/stories.ts +0 -3
- package/ui.button-link/types.ts +0 -5
- package/ui.button-toggle/UToggle.vue +0 -1
- package/ui.button-toggle/config.ts +1 -6
- package/ui.button-toggle/types.ts +0 -5
- package/ui.button-toggle-item/UToggleItem.vue +0 -2
- package/ui.button-toggle-item/config.ts +1 -1
- package/ui.container-modal/UModal.vue +0 -1
- package/ui.container-page/UPage.vue +0 -1
- package/ui.dropdown-badge/config.ts +4 -5
- package/ui.dropdown-badge/storybook/stories.ts +0 -1
- package/ui.dropdown-button/config.ts +4 -5
- package/ui.dropdown-button/storybook/stories.ts +0 -1
- package/ui.dropdown-link/UDropdownLink.vue +0 -1
- package/ui.dropdown-link/config.ts +3 -7
- package/ui.dropdown-link/storybook/stories.ts +0 -3
- package/ui.dropdown-link/types.ts +0 -5
- package/ui.dropdown-list/config.ts +7 -3
- package/ui.dropdown-list/storybook/stories.ts +1 -0
- package/ui.form-calendar/UCalendar.vue +0 -4
- package/ui.form-calendar/UCalendarDayView.vue +0 -13
- package/ui.form-calendar/UCalendarMonthView.vue +0 -12
- package/ui.form-calendar/UCalendarYearView.vue +0 -12
- package/ui.form-checkbox/config.ts +9 -6
- package/ui.form-color-picker/UColorPicker.vue +0 -1
- package/ui.form-date-picker-range/UDatePickerRange.vue +0 -3
- package/ui.form-date-picker-range/UDatePickerRangePeriodMenu.vue +0 -12
- package/ui.form-date-picker-range/config.ts +7 -20
- package/ui.form-input/UInput.vue +2 -8
- package/ui.form-input/config.ts +6 -16
- package/ui.form-input/storybook/stories.ts +36 -22
- package/ui.form-input/types.ts +1 -1
- package/ui.form-input-file/UInputFile.vue +1 -2
- package/ui.form-input-file/config.ts +4 -7
- package/ui.form-input-money/UInputMoney.vue +5 -4
- package/ui.form-input-money/storybook/stories.ts +126 -49
- package/ui.form-input-number/storybook/stories.ts +43 -21
- package/ui.form-input-rating/UInputRating.vue +1 -0
- package/ui.form-input-rating/config.ts +5 -0
- package/ui.form-input-rating/storybook/stories.ts +62 -19
- package/ui.form-input-rating/types.ts +12 -7
- package/ui.form-input-search/UInputSearch.vue +1 -1
- package/ui.form-input-search/config.ts +8 -11
- package/ui.form-input-search/storybook/stories.ts +110 -31
- package/ui.form-input-search/types.ts +6 -6
- package/ui.form-label/config.ts +3 -3
- package/ui.form-radio/URadio.vue +5 -2
- package/ui.form-radio/config.ts +12 -6
- package/ui.form-radio-group/URadioGroup.vue +1 -0
- package/ui.form-select/config.ts +4 -7
- package/ui.form-switch/USwitch.vue +8 -2
- package/ui.form-switch/config.ts +11 -8
- package/ui.form-switch/types.ts +0 -1
- package/ui.form-textarea/config.ts +8 -14
- package/ui.navigation-breadcrumbs/UBreadcrumbs.vue +0 -1
- package/ui.navigation-breadcrumbs/types.ts +1 -1
- package/ui.navigation-pagination/UPagination.vue +22 -10
- package/ui.navigation-pagination/config.ts +15 -17
- package/ui.navigation-tab/UTab.vue +58 -20
- package/ui.navigation-tab/config.ts +14 -14
- package/ui.navigation-tab/storybook/stories.ts +1 -1
- package/ui.navigation-tab/types.ts +15 -4
- package/ui.navigation-tabs/UTabs.vue +6 -4
- package/ui.navigation-tabs/config.ts +4 -15
- package/ui.navigation-tabs/storybook/stories.ts +0 -3
- package/ui.navigation-tabs/types.ts +8 -3
- package/ui.text-alert/UAlert.vue +0 -1
- package/ui.text-badge/config.ts +3 -6
- package/ui.text-file/UFile.vue +2 -9
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
pagination: "flex",
|
|
3
3
|
paginationButton: {
|
|
4
|
-
base: "font-normal",
|
|
4
|
+
base: "{UButton} font-normal",
|
|
5
5
|
variants: {
|
|
6
6
|
size: {
|
|
7
|
-
|
|
7
|
+
sm: "text-xs",
|
|
8
|
+
md: "text-sm",
|
|
9
|
+
lg: "text-base",
|
|
8
10
|
},
|
|
9
11
|
},
|
|
10
12
|
defaults: {
|
|
11
|
-
size:
|
|
12
|
-
sm: "xs",
|
|
13
|
-
md: "sm",
|
|
14
|
-
lg: "md",
|
|
15
|
-
},
|
|
13
|
+
size: "xs",
|
|
16
14
|
},
|
|
17
15
|
},
|
|
18
|
-
firstButton: "{
|
|
19
|
-
lastButton: "{
|
|
20
|
-
prevButton: "{
|
|
21
|
-
nextButton: "{
|
|
22
|
-
inactiveButton: "{
|
|
23
|
-
activeButton: "{
|
|
16
|
+
firstButton: "{>paginationButton}",
|
|
17
|
+
lastButton: "{>paginationButton}",
|
|
18
|
+
prevButton: "{>paginationButton}",
|
|
19
|
+
nextButton: "{>paginationButton}",
|
|
20
|
+
inactiveButton: "{>paginationButton}",
|
|
21
|
+
activeButton: "{>paginationButton}",
|
|
24
22
|
paginationIcon: {
|
|
25
23
|
base: "{UIcon}",
|
|
26
24
|
defaults: {
|
|
@@ -31,10 +29,10 @@ export default /*tw*/ {
|
|
|
31
29
|
},
|
|
32
30
|
},
|
|
33
31
|
},
|
|
34
|
-
lastIcon: "{
|
|
35
|
-
firstIcon: "{
|
|
36
|
-
prevIcon: "{
|
|
37
|
-
nextIcon: "{
|
|
32
|
+
lastIcon: "{>paginationIcon}",
|
|
33
|
+
firstIcon: "{>paginationIcon}",
|
|
34
|
+
prevIcon: "{>paginationIcon}",
|
|
35
|
+
nextIcon: "{>paginationIcon}",
|
|
38
36
|
defaults: {
|
|
39
37
|
variant: "primary",
|
|
40
38
|
size: "md",
|
|
@@ -3,30 +3,30 @@ import { computed, inject, toValue } from "vue";
|
|
|
3
3
|
|
|
4
4
|
import useUI from "../composables/useUI.ts";
|
|
5
5
|
import { getDefaults } from "../utils/ui.ts";
|
|
6
|
+
import UButton from "../ui.button/UButton.vue";
|
|
6
7
|
|
|
7
8
|
import { COMPONENT_NAME } from "./constants.ts";
|
|
8
9
|
import defaultConfig from "./config.ts";
|
|
9
10
|
|
|
10
|
-
import type { Props,
|
|
11
|
-
import type { SetUTabsSelectedItem } from "../ui.navigation-tabs/types.ts";
|
|
11
|
+
import type { Props, Config } from "./types.ts";
|
|
12
|
+
import type { Props as UTabsProps, SetUTabsSelectedItem } from "../ui.navigation-tabs/types.ts";
|
|
12
13
|
|
|
13
14
|
defineOptions({ inheritAttrs: false });
|
|
14
15
|
|
|
15
|
-
const setUTabsSelectedItem = inject<SetUTabsSelectedItem
|
|
16
|
-
const getUTabsSelectedItem = inject("getUTabsSelectedItem"
|
|
17
|
-
const
|
|
16
|
+
const setUTabsSelectedItem = inject<SetUTabsSelectedItem>("setUTabsSelectedItem");
|
|
17
|
+
const getUTabsSelectedItem = inject("getUTabsSelectedItem");
|
|
18
|
+
const getUTabsSquare = inject<UTabsProps["square"]>("getUTabsSquare");
|
|
19
|
+
const getUTabsBlock = inject<UTabsProps["block"]>("getUTabsBlock");
|
|
20
|
+
const getUTabsSize = inject<UTabsProps["size"]>("getUTabsSize", "md");
|
|
18
21
|
|
|
19
22
|
const props = withDefaults(defineProps<Props>(), {
|
|
20
23
|
...getDefaults<Props, Config>(defaultConfig, COMPONENT_NAME),
|
|
21
24
|
});
|
|
22
25
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const size = computed(() => {
|
|
28
|
-
return toValue(getUTabsSize) || getDefaults<UTabSize, Config>(defaultConfig, COMPONENT_NAME).size;
|
|
29
|
-
});
|
|
26
|
+
const size = computed(() => toValue(getUTabsSize));
|
|
27
|
+
const block = computed(() => toValue(getUTabsBlock));
|
|
28
|
+
const square = computed(() => toValue(getUTabsSquare));
|
|
29
|
+
const isActive = computed(() => toValue(getUTabsSelectedItem) === props.value && !props.disabled);
|
|
30
30
|
|
|
31
31
|
async function onClickSetValue() {
|
|
32
32
|
if (!props.disabled && setUTabsSelectedItem) {
|
|
@@ -40,18 +40,56 @@ async function onClickSetValue() {
|
|
|
40
40
|
*/
|
|
41
41
|
const mutatedProps = computed(() => ({
|
|
42
42
|
size: size.value,
|
|
43
|
+
block: block.value,
|
|
44
|
+
square: square.value,
|
|
43
45
|
/* component state, not a props */
|
|
44
|
-
|
|
46
|
+
active: isActive.value,
|
|
45
47
|
}));
|
|
46
48
|
|
|
47
|
-
const {
|
|
49
|
+
const { tabButtonAttrs, tabButtonActiveAttrs } = useUI<Config>(defaultConfig, mutatedProps);
|
|
48
50
|
</script>
|
|
49
51
|
|
|
50
52
|
<template>
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
<UButton
|
|
54
|
+
variant="thirdary"
|
|
55
|
+
:size="size"
|
|
56
|
+
:label="label"
|
|
57
|
+
:icon="icon"
|
|
58
|
+
:left-icon="leftIcon"
|
|
59
|
+
:right-icon="rightIcon"
|
|
60
|
+
:block="block"
|
|
61
|
+
:square="square"
|
|
62
|
+
:disabled="disabled"
|
|
63
|
+
v-bind="isActive ? tabButtonActiveAttrs : tabButtonAttrs"
|
|
64
|
+
:data-test="dataTest"
|
|
65
|
+
@click="onClickSetValue"
|
|
66
|
+
>
|
|
67
|
+
<template #left="{ iconName }">
|
|
68
|
+
<!--
|
|
69
|
+
@slot Use it to add something before the label.
|
|
70
|
+
@binding {boolean} active
|
|
71
|
+
@binding {string} icon-name
|
|
72
|
+
-->
|
|
73
|
+
<slot name="left" :active="isActive" :icon-name="iconName" />
|
|
74
|
+
</template>
|
|
75
|
+
|
|
76
|
+
<template #default="{ iconName, label }">
|
|
77
|
+
<!--
|
|
78
|
+
@slot Use it to add something instead of the label.
|
|
79
|
+
@binding {string} label
|
|
80
|
+
@binding {boolean} active
|
|
81
|
+
@binding {string} icon-name
|
|
82
|
+
-->
|
|
83
|
+
<slot :label="label" :active="isActive" :icon-name="iconName" />
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<template #right="{ iconName }">
|
|
87
|
+
<!--
|
|
88
|
+
@slot Use it to add something after the label.
|
|
89
|
+
@binding {boolean} active
|
|
90
|
+
@binding {string} icon-name
|
|
91
|
+
-->
|
|
92
|
+
<slot name="right" :active="isActive" :icon-name="iconName" />
|
|
93
|
+
</template>
|
|
94
|
+
</UButton>
|
|
57
95
|
</template>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
|
|
3
|
-
base:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
tabButton: {
|
|
3
|
+
base: `
|
|
4
|
+
{UButton} -mb-px rounded-none border-transparent
|
|
5
|
+
hover:bg-transparent dark:hover:bg-transparent
|
|
6
|
+
active:bg-transparent dark:active:bg-transparent
|
|
7
|
+
`,
|
|
8
|
+
defaults: {
|
|
9
|
+
color: "gray",
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
tabButtonActive: {
|
|
13
|
+
base: "{>tabButton} border-b-brand-600",
|
|
14
|
+
defaults: {
|
|
15
|
+
color: "brand",
|
|
16
16
|
},
|
|
17
17
|
},
|
|
18
18
|
defaults: {
|
|
@@ -3,10 +3,6 @@ import type { ComponentConfig } from "../types.ts";
|
|
|
3
3
|
|
|
4
4
|
export type Config = typeof defaultConfig;
|
|
5
5
|
|
|
6
|
-
export interface UTabSize {
|
|
7
|
-
size: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
6
|
export interface Props {
|
|
11
7
|
/**
|
|
12
8
|
* Tab label.
|
|
@@ -18,6 +14,21 @@ export interface Props {
|
|
|
18
14
|
*/
|
|
19
15
|
value?: string | number;
|
|
20
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Icon name (appears instead of label).
|
|
19
|
+
*/
|
|
20
|
+
icon?: string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Left icon name.
|
|
24
|
+
*/
|
|
25
|
+
leftIcon?: string;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Right icon name.
|
|
29
|
+
*/
|
|
30
|
+
rightIcon?: string;
|
|
31
|
+
|
|
21
32
|
/**
|
|
22
33
|
* Make tab disabled.
|
|
23
34
|
*/
|
|
@@ -32,15 +32,17 @@ const selectedItem = computed({
|
|
|
32
32
|
set: (value) => emit("update:modelValue", value),
|
|
33
33
|
});
|
|
34
34
|
|
|
35
|
-
provide("setUTabsSelectedItem", (value: string) => (selectedItem.value = value));
|
|
36
|
-
provide("getUTabsSelectedItem", () => selectedItem.value);
|
|
37
35
|
provide("getUTabsSize", () => props.size);
|
|
36
|
+
provide("getUTabsBlock", () => props.block);
|
|
37
|
+
provide("getUTabsSquare", () => props.square);
|
|
38
|
+
provide("getUTabsSelectedItem", () => selectedItem.value);
|
|
39
|
+
provide("setUTabsSelectedItem", (value: string) => (selectedItem.value = value));
|
|
38
40
|
|
|
39
41
|
/**
|
|
40
42
|
* Get element / nested component attributes for each config token ✨
|
|
41
43
|
* Applies: `class`, `config`, redefined default `props` and dev `vl-...` attributes.
|
|
42
44
|
*/
|
|
43
|
-
const { tabsAttrs,
|
|
45
|
+
const { tabsAttrs, tabAttrs } = useUI<Config>(defaultConfig);
|
|
44
46
|
</script>
|
|
45
47
|
|
|
46
48
|
<template>
|
|
@@ -54,7 +56,7 @@ const { tabsAttrs, itemAttrs } = useUI<Config>(defaultConfig);
|
|
|
54
56
|
:value="item.value"
|
|
55
57
|
:disabled="item.disabled"
|
|
56
58
|
:size="size"
|
|
57
|
-
v-bind="
|
|
59
|
+
v-bind="tabAttrs"
|
|
58
60
|
:data-test="`${dataTest}-item-${index}`"
|
|
59
61
|
/>
|
|
60
62
|
</slot>
|
|
@@ -1,20 +1,9 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
|
-
tabs:
|
|
3
|
-
|
|
4
|
-
variants: {
|
|
5
|
-
size: {
|
|
6
|
-
sm: "gap-5",
|
|
7
|
-
md: "gap-6",
|
|
8
|
-
lg: "gap-7",
|
|
9
|
-
},
|
|
10
|
-
underlined: {
|
|
11
|
-
true: "border-b border-gray-100",
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
item: "{UTab}",
|
|
2
|
+
tabs: "mb-6 flex border-b border-gray-200 dark:border-gray-700",
|
|
3
|
+
tab: "{UTab}",
|
|
16
4
|
defaults: {
|
|
17
5
|
size: "md",
|
|
18
|
-
|
|
6
|
+
block: false,
|
|
7
|
+
square: false,
|
|
19
8
|
},
|
|
20
9
|
};
|
|
@@ -78,9 +78,6 @@ Default.args = {};
|
|
|
78
78
|
export const Sizes = EnumVariantTemplate.bind({});
|
|
79
79
|
Sizes.args = { enum: "size" };
|
|
80
80
|
|
|
81
|
-
export const BottomLine = DefaultTemplate.bind({});
|
|
82
|
-
BottomLine.args = { underlined: true };
|
|
83
|
-
|
|
84
81
|
export const DisabledTab = DefaultTemplate.bind({});
|
|
85
82
|
DisabledTab.args = {
|
|
86
83
|
options: [
|
|
@@ -28,12 +28,17 @@ export interface Props {
|
|
|
28
28
|
/**
|
|
29
29
|
* Tabs size.
|
|
30
30
|
*/
|
|
31
|
-
size?: "sm" | "md" | "lg";
|
|
31
|
+
size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
34
|
+
* Make the Tabs fill the width with its container.
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
block?: boolean;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Set the same paddings for the tabs.
|
|
40
|
+
*/
|
|
41
|
+
square?: boolean;
|
|
37
42
|
|
|
38
43
|
/**
|
|
39
44
|
* Component config object.
|
package/ui.text-alert/UAlert.vue
CHANGED
package/ui.text-badge/config.ts
CHANGED
|
@@ -16,14 +16,11 @@ export default /*tw*/ {
|
|
|
16
16
|
true: "rounded-full",
|
|
17
17
|
},
|
|
18
18
|
tabindex: {
|
|
19
|
-
true:
|
|
20
|
-
cursor-pointer focus-within:ring-dynamic focus-within:ring-offset-dynamic focus-within:ring-{color}-700/15
|
|
21
|
-
focus:ring-dynamic focus:ring-offset-dynamic focus:ring-{color}-700/15
|
|
22
|
-
`,
|
|
19
|
+
true: "cursor-pointer focus-visible:ring-dynamic focus-visible:ring-offset-dynamic focus-visible:ring-{color}-600",
|
|
23
20
|
},
|
|
24
21
|
color: {
|
|
25
|
-
grayscale: "focus
|
|
26
|
-
white: "
|
|
22
|
+
grayscale: "focus-visible:ring-gray-900",
|
|
23
|
+
white: " focus-visible:ring-gray-900",
|
|
27
24
|
},
|
|
28
25
|
},
|
|
29
26
|
compoundVariants: [
|
package/ui.text-file/UFile.vue
CHANGED
|
@@ -59,7 +59,7 @@ const {
|
|
|
59
59
|
</script>
|
|
60
60
|
|
|
61
61
|
<template>
|
|
62
|
-
<ULink :href="url"
|
|
62
|
+
<ULink :href="url" v-bind="fileAttrs" :data-test="dataTest">
|
|
63
63
|
<slot name="left" :file="{ elementId, label, url, imageUrl }" />
|
|
64
64
|
|
|
65
65
|
<slot :file="{ elementId, label, url, imageUrl }">
|
|
@@ -77,14 +77,7 @@ const {
|
|
|
77
77
|
@blur="onBlur"
|
|
78
78
|
/>
|
|
79
79
|
|
|
80
|
-
<ULink
|
|
81
|
-
:label="label"
|
|
82
|
-
:ring="false"
|
|
83
|
-
:size="size"
|
|
84
|
-
color="gray"
|
|
85
|
-
dashed
|
|
86
|
-
v-bind="fileLabelAttrs"
|
|
87
|
-
/>
|
|
80
|
+
<ULink :label="label" :size="size" color="gray" dashed v-bind="fileLabelAttrs" />
|
|
88
81
|
</div>
|
|
89
82
|
</slot>
|
|
90
83
|
|