vueless 0.0.703 → 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/config.ts +6 -16
- package/ui.form-input-file/UInputFile.vue +1 -2
- package/ui.form-input-file/config.ts +4 -7
- package/ui.form-input-search/UInputSearch.vue +0 -1
- 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
package/ui.form-switch/config.ts
CHANGED
|
@@ -2,32 +2,35 @@ export default /*tw*/ {
|
|
|
2
2
|
switchLabel: "{ULabel}",
|
|
3
3
|
wrapper: {
|
|
4
4
|
base: `
|
|
5
|
-
flex items-center p-0.5 relative rounded-
|
|
6
|
-
focus-
|
|
5
|
+
flex items-center p-0.5 relative rounded-full cursor-pointer transition
|
|
6
|
+
focus-visible:ring-dynamic focus-visible:ring-offset-dynamic ring-{color}-600 outline-0
|
|
7
7
|
`,
|
|
8
8
|
variants: {
|
|
9
|
-
checked: {
|
|
10
|
-
true: "bg-{color}-600 ring-{color}-700/15 hover:bg-{color}-700 active:bg-{color}-800",
|
|
11
|
-
false: "bg-gray-300 ring-gray-700/15 hover:bg-gray-400 active:bg-gray-500",
|
|
12
|
-
},
|
|
13
9
|
size: {
|
|
14
10
|
sm: "w-6",
|
|
15
11
|
md: "w-8",
|
|
16
12
|
lg: "w-10",
|
|
17
13
|
},
|
|
14
|
+
color: {
|
|
15
|
+
grayscale: "ring-gray-900",
|
|
16
|
+
},
|
|
17
|
+
checked: {
|
|
18
|
+
true: "bg-{color}-600 hover:bg-{color}-700 active:bg-{color}-800",
|
|
19
|
+
false: "bg-gray-300 hover:bg-gray-400 active:bg-gray-600",
|
|
20
|
+
},
|
|
18
21
|
},
|
|
19
22
|
compoundVariants: [
|
|
20
23
|
{ toggleLabel: true, size: "sm", class: "w-10" },
|
|
21
24
|
{ toggleLabel: true, size: "md", class: "w-12" },
|
|
22
25
|
{ toggleLabel: true, size: "lg", class: "w-14" },
|
|
26
|
+
{ color: "grayscale", checked: true, class: "bg-gray-900 hover:bg-gray-800 active:bg-gray-700" },
|
|
23
27
|
{ disabled: true, checked: false, class: "bg-gray-300" },
|
|
24
28
|
{ disabled: true, checked: true, class: "bg-gray-400" },
|
|
25
|
-
{ color: "grayscale", disabled: false, checked: true, class: "bg-gray-900 ring-gray-700/15" },
|
|
26
29
|
],
|
|
27
30
|
},
|
|
28
31
|
input: "absolute size-0 opacity-0",
|
|
29
32
|
circle: {
|
|
30
|
-
base: "
|
|
33
|
+
base: "rounded-full bg-white flex items-center justify-center transition-all",
|
|
31
34
|
variants: {
|
|
32
35
|
size: {
|
|
33
36
|
sm: "size-3",
|
package/ui.form-switch/types.ts
CHANGED
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
export default /*tw*/ {
|
|
2
2
|
textareaLabel: "{ULabel}",
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
slot: "flex items-center justify-center whitespace-nowrap gap-1 rounded-dynamic",
|
|
4
|
+
leftSlot: "{>slot} pl-3 rounded-r-none",
|
|
5
|
+
rightSlot: "{>slot} pr-3 rounded-l-none",
|
|
5
6
|
wrapper: {
|
|
6
7
|
base: `
|
|
7
8
|
flex bg-white transition w-full
|
|
8
|
-
rounded-dynamic border border-gray-300 hover:border-gray-400 hover:focus-within:border-brand-
|
|
9
|
-
focus-within:border-brand-
|
|
10
|
-
focus-within:ring-brand-
|
|
9
|
+
rounded-dynamic border border-gray-300 hover:border-gray-400 hover:focus-within:border-brand-600
|
|
10
|
+
focus-within:border-brand-600 focus-within:ring-dynamic focus-within:ring-offset-0
|
|
11
|
+
focus-within:ring-brand-600 focus-within:outline-none
|
|
11
12
|
`,
|
|
12
13
|
variants: {
|
|
13
14
|
error: {
|
|
14
|
-
true:
|
|
15
|
-
bg-red-50 border-red-300
|
|
16
|
-
hover:border-red-400 hover:focus-within:border-red-500
|
|
17
|
-
focus-within:border-red-500 focus-within:ring-red-700/15
|
|
18
|
-
`,
|
|
15
|
+
true: "!border-red-600 focus-within:ring-red-600",
|
|
19
16
|
},
|
|
20
17
|
disabled: {
|
|
21
|
-
true:
|
|
22
|
-
focus-within:ring-0 focus-within:ring-offset-0 bg-gray-100
|
|
23
|
-
hover:border-gray-300 focus-within:border-gray-300 hover:focus-within:border-gray-300
|
|
24
|
-
`,
|
|
18
|
+
true: "!border-gray-300 focus-within:ring-0 bg-gray-100",
|
|
25
19
|
},
|
|
26
20
|
},
|
|
27
21
|
},
|
|
@@ -76,7 +76,6 @@ const { config, breadcrumbsAttrs, breadcrumbLinkAttrs, breadcrumbIconAttrs, divi
|
|
|
76
76
|
:underlined="underlined"
|
|
77
77
|
:dashed="dashed"
|
|
78
78
|
:disabled="link.disabled || (!link.to && !link.href)"
|
|
79
|
-
:ring="false"
|
|
80
79
|
v-bind="breadcrumbLinkAttrs"
|
|
81
80
|
:data-test="dataTest"
|
|
82
81
|
@click="onClickLink(link)"
|
|
@@ -124,7 +124,6 @@ const {
|
|
|
124
124
|
<div v-bind="paginationAttrs">
|
|
125
125
|
<UButton
|
|
126
126
|
v-if="showFirst"
|
|
127
|
-
:ring="false"
|
|
128
127
|
variant="thirdary"
|
|
129
128
|
:label="firstLabel"
|
|
130
129
|
:square="!firstLabel"
|
|
@@ -138,6 +137,7 @@ const {
|
|
|
138
137
|
<UIcon
|
|
139
138
|
v-if="!firstLabel"
|
|
140
139
|
internal
|
|
140
|
+
color="brand"
|
|
141
141
|
:name="config.defaults.firstIcon"
|
|
142
142
|
v-bind="firstIconAttrs"
|
|
143
143
|
/>
|
|
@@ -145,7 +145,6 @@ const {
|
|
|
145
145
|
</UButton>
|
|
146
146
|
|
|
147
147
|
<UButton
|
|
148
|
-
:ring="false"
|
|
149
148
|
variant="thirdary"
|
|
150
149
|
:label="prevLabel"
|
|
151
150
|
:square="!prevLabel"
|
|
@@ -156,7 +155,13 @@ const {
|
|
|
156
155
|
>
|
|
157
156
|
<!-- @slot Use it to add something instead of the "prev" label. -->
|
|
158
157
|
<slot name="prev">
|
|
159
|
-
<UIcon
|
|
158
|
+
<UIcon
|
|
159
|
+
v-if="!prevLabel"
|
|
160
|
+
internal
|
|
161
|
+
color="brand"
|
|
162
|
+
:name="config.defaults.prevIcon"
|
|
163
|
+
v-bind="prevIconAttrs"
|
|
164
|
+
/>
|
|
160
165
|
</slot>
|
|
161
166
|
</UButton>
|
|
162
167
|
|
|
@@ -165,7 +170,6 @@ const {
|
|
|
165
170
|
v-if="!isFinite(page.number)"
|
|
166
171
|
square
|
|
167
172
|
disabled
|
|
168
|
-
:ring="false"
|
|
169
173
|
variant="thirdary"
|
|
170
174
|
v-bind="inactiveButtonAttrs"
|
|
171
175
|
>
|
|
@@ -176,7 +180,6 @@ const {
|
|
|
176
180
|
<UButton
|
|
177
181
|
v-else-if="page.isActive"
|
|
178
182
|
filled
|
|
179
|
-
:ring="false"
|
|
180
183
|
:variant="variant"
|
|
181
184
|
:label="String(page.number)"
|
|
182
185
|
:disabled="disabled"
|
|
@@ -186,7 +189,6 @@ const {
|
|
|
186
189
|
|
|
187
190
|
<UButton
|
|
188
191
|
v-else
|
|
189
|
-
:ring="false"
|
|
190
192
|
variant="thirdary"
|
|
191
193
|
:label="String(page.number)"
|
|
192
194
|
:disabled="disabled"
|
|
@@ -197,7 +199,6 @@ const {
|
|
|
197
199
|
</template>
|
|
198
200
|
|
|
199
201
|
<UButton
|
|
200
|
-
:ring="false"
|
|
201
202
|
variant="thirdary"
|
|
202
203
|
:label="nextLabel"
|
|
203
204
|
:square="!nextLabel"
|
|
@@ -208,13 +209,18 @@ const {
|
|
|
208
209
|
>
|
|
209
210
|
<!-- @slot Use it to add something instead of the "next" label. -->
|
|
210
211
|
<slot name="next">
|
|
211
|
-
<UIcon
|
|
212
|
+
<UIcon
|
|
213
|
+
v-if="!nextLabel"
|
|
214
|
+
internal
|
|
215
|
+
color="brand"
|
|
216
|
+
:name="config.defaults.nextIcon"
|
|
217
|
+
v-bind="nextIconAttrs"
|
|
218
|
+
/>
|
|
212
219
|
</slot>
|
|
213
220
|
</UButton>
|
|
214
221
|
|
|
215
222
|
<UButton
|
|
216
223
|
v-if="showLast"
|
|
217
|
-
:ring="false"
|
|
218
224
|
variant="thirdary"
|
|
219
225
|
:label="lastLabel"
|
|
220
226
|
:square="!lastLabel"
|
|
@@ -225,7 +231,13 @@ const {
|
|
|
225
231
|
>
|
|
226
232
|
<!-- @slot Use it to add something instead of the "last" label. -->
|
|
227
233
|
<slot name="last">
|
|
228
|
-
<UIcon
|
|
234
|
+
<UIcon
|
|
235
|
+
v-if="!lastLabel"
|
|
236
|
+
internal
|
|
237
|
+
color="brand"
|
|
238
|
+
:name="config.defaults.lastIcon"
|
|
239
|
+
v-bind="lastIconAttrs"
|
|
240
|
+
/>
|
|
229
241
|
</slot>
|
|
230
242
|
</UButton>
|
|
231
243
|
</div>
|
|
@@ -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
|
|