@brumaombra/ui-vintage 0.7.8 → 0.7.10
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/README.md +308 -48
- package/module.mjs +1 -1
- package/package.json +2 -1
- package/src/components/background-grid/BackgroundGrid.vue +11 -2
- package/src/components/background-grid/index.ts +2 -2
- package/src/components/blog/AllPostsSection.vue +25 -9
- package/src/components/blog/BlogContentRenderer.vue +133 -0
- package/src/components/blog/BlogFAQSection.vue +8 -3
- package/src/components/blog/BlogHeaderSection.vue +14 -11
- package/src/components/blog/BlogInfoSection.vue +13 -11
- package/src/components/blog/BlogProgressBar.vue +77 -0
- package/src/components/blog/BlogSectionTitle.vue +5 -5
- package/src/components/blog/CategoriesList.vue +11 -3
- package/src/components/blog/CategoriesSection.vue +11 -3
- package/src/components/blog/CategoryCard.vue +10 -8
- package/src/components/blog/HeaderCarousel.vue +24 -15
- package/src/components/blog/PostCard.vue +16 -11
- package/src/components/blog/PostsList.vue +12 -3
- package/src/components/blog/SocialShareSidebar.vue +43 -41
- package/src/components/blog/TableOfContents.vue +29 -13
- package/src/components/blog/index.ts +1 -0
- package/src/components/busy-indicator/BusyIndicator.vue +2 -2
- package/src/components/busy-indicator/busy-indicator-state.ts +11 -12
- package/src/components/busy-indicator/index.ts +3 -3
- package/src/components/card-grid/CardGrid.vue +25 -11
- package/src/components/chip/Chip.vue +15 -15
- package/src/components/chip/index.ts +2 -2
- package/src/components/confirm-dialog/ConfirmDialog.vue +9 -9
- package/src/components/confirm-dialog/confirm-dialog-state.ts +15 -14
- package/src/components/confirm-dialog/index.ts +3 -12
- package/src/components/content/BlogList.vue +11 -8
- package/src/components/content/BlogTable.vue +18 -14
- package/src/components/content/ProseHr.vue +10 -7
- package/src/components/content/Terminal.vue +70 -0
- package/src/components/content/index.ts +2 -1
- package/src/components/dashboard-shell/DashboardShell.vue +43 -64
- package/src/components/dashboard-shell/index.ts +2 -2
- package/src/components/data-list/DataList.vue +11 -13
- package/src/components/data-list/DataListItem.vue +9 -11
- package/src/components/data-list/DataListLabel.vue +9 -11
- package/src/components/data-list/DataListText.vue +9 -11
- package/src/components/data-list/DataListValue.vue +9 -11
- package/src/components/data-list/index.ts +5 -5
- package/src/components/empty-state-card/EmptyStateCard.vue +21 -11
- package/src/components/error-page/ErrorPage.vue +24 -27
- package/src/components/error-page/index.ts +2 -2
- package/src/components/info-card/InfoCard.vue +17 -11
- package/src/components/landing/index.ts +6 -6
- package/src/components/landing/landing-content/LandingContent.vue +5 -7
- package/src/components/landing/landing-content/index.ts +2 -2
- package/src/components/landing/landing-footer/LandingFooter.vue +26 -29
- package/src/components/landing/landing-footer/index.ts +3 -3
- package/src/components/landing/landing-navbar/LandingNavbar.vue +51 -19
- package/src/components/landing/landing-navbar/index.ts +2 -2
- package/src/components/landing/landing-shell/LandingShell.vue +12 -15
- package/src/components/landing/landing-shell/index.ts +2 -2
- package/src/components/language-flag/LanguageFlag.vue +6 -5
- package/src/components/language-flag/index.ts +1 -0
- package/src/components/language-selector/LanguageSelector.vue +20 -21
- package/src/components/load-more-button/LoadMoreButton.vue +18 -14
- package/src/components/loading-state-card/LoadingStateCard.vue +13 -9
- package/src/components/message-dialog/MessageDialog.vue +19 -19
- package/src/components/message-dialog/index.ts +3 -11
- package/src/components/message-dialog/message-dialog-state.ts +12 -11
- package/src/components/message-toast/MessageToast.vue +16 -16
- package/src/components/message-toast/index.ts +2 -9
- package/src/components/message-toast/message-toast-state.ts +9 -9
- package/src/components/page-header/PageHeader.vue +8 -5
- package/src/components/progress-component/ProgressComponent.vue +13 -10
- package/src/components/single-value-card/SingleValueCard.vue +22 -19
- package/src/components/slider-form-component/SliderFormComponent.vue +11 -20
- package/src/components/slider-form-component/index.ts +2 -2
- package/src/components/switch-form-component/SwitchFormComponent.vue +7 -9
- package/src/components/switch-form-component/index.ts +2 -2
- package/src/components/text-link/TextLink.vue +11 -7
- package/src/components/ui/accordion/Accordion.vue +10 -13
- package/src/components/ui/accordion/index.ts +1 -1
- package/src/components/ui/alert/Alert.vue +11 -10
- package/src/components/ui/alert/AlertDescription.vue +9 -8
- package/src/components/ui/alert/AlertTitle.vue +9 -8
- package/src/components/ui/alert/index.ts +10 -10
- package/src/components/ui/alert-dialog/AlertDialog.vue +13 -9
- package/src/components/ui/alert-dialog/AlertDialogAction.vue +14 -12
- package/src/components/ui/alert-dialog/AlertDialogCancel.vue +14 -16
- package/src/components/ui/alert-dialog/AlertDialogContent.vue +24 -27
- package/src/components/ui/alert-dialog/AlertDialogDescription.vue +13 -13
- package/src/components/ui/alert-dialog/AlertDialogFooter.vue +9 -12
- package/src/components/ui/alert-dialog/AlertDialogHeader.vue +9 -8
- package/src/components/ui/alert-dialog/AlertDialogTitle.vue +13 -11
- package/src/components/ui/alert-dialog/AlertDialogTrigger.vue +8 -7
- package/src/components/ui/alert-dialog/index.ts +9 -9
- package/src/components/ui/badge/Badge.vue +11 -12
- package/src/components/ui/badge/index.ts +1 -1
- package/src/components/ui/breadcrumb/Breadcrumb.vue +9 -12
- package/src/components/ui/breadcrumb/BreadcrumbEllipsis.vue +15 -19
- package/src/components/ui/breadcrumb/BreadcrumbItem.vue +10 -12
- package/src/components/ui/breadcrumb/BreadcrumbLink.vue +13 -17
- package/src/components/ui/breadcrumb/BreadcrumbList.vue +10 -12
- package/src/components/ui/breadcrumb/BreadcrumbPage.vue +10 -15
- package/src/components/ui/breadcrumb/BreadcrumbSeparator.vue +14 -18
- package/src/components/ui/breadcrumb/index.ts +7 -7
- package/src/components/ui/busy/Busy.vue +36 -29
- package/src/components/ui/busy/index.ts +1 -1
- package/src/components/ui/button/Button.vue +18 -19
- package/src/components/ui/button/index.ts +54 -35
- package/src/components/ui/calendar/Calendar.vue +167 -121
- package/src/components/ui/calendar/CalendarCell.vue +18 -17
- package/src/components/ui/calendar/CalendarCellTrigger.vue +31 -33
- package/src/components/ui/calendar/CalendarGrid.vue +14 -17
- package/src/components/ui/calendar/CalendarGridBody.vue +9 -11
- package/src/components/ui/calendar/CalendarGridHead.vue +10 -12
- package/src/components/ui/calendar/CalendarGridRow.vue +14 -16
- package/src/components/ui/calendar/CalendarHeadCell.vue +18 -17
- package/src/components/ui/calendar/CalendarHeader.vue +18 -17
- package/src/components/ui/calendar/CalendarHeading.vue +18 -22
- package/src/components/ui/calendar/CalendarNextButton.vue +29 -26
- package/src/components/ui/calendar/CalendarPrevButton.vue +29 -26
- package/src/components/ui/calendar/index.ts +17 -13
- package/src/components/ui/card/Card.vue +21 -13
- package/src/components/ui/card/CardAction.vue +12 -7
- package/src/components/ui/card/CardContent.vue +8 -7
- package/src/components/ui/card/CardDescription.vue +16 -7
- package/src/components/ui/card/CardFooter.vue +8 -7
- package/src/components/ui/card/CardHeader.vue +12 -7
- package/src/components/ui/card/CardText.vue +12 -7
- package/src/components/ui/card/CardTitle.vue +9 -7
- package/src/components/ui/card/index.ts +8 -8
- package/src/components/ui/command/Command.vue +71 -61
- package/src/components/ui/command/CommandDialog.vue +33 -23
- package/src/components/ui/command/CommandEmpty.vue +19 -20
- package/src/components/ui/command/CommandGroup.vue +32 -35
- package/src/components/ui/command/CommandInput.vue +25 -21
- package/src/components/ui/command/CommandItem.vue +62 -59
- package/src/components/ui/command/CommandList.vue +21 -18
- package/src/components/ui/command/CommandSeparator.vue +13 -11
- package/src/components/ui/command/CommandShortcut.vue +13 -8
- package/src/components/ui/command/index.ts +24 -20
- package/src/components/ui/date-picker/DatePicker.vue +46 -37
- package/src/components/ui/date-picker/index.ts +2 -2
- package/src/components/ui/date-time-picker/DateTimePicker.vue +99 -95
- package/src/components/ui/date-time-picker/index.ts +2 -2
- package/src/components/ui/dialog/Dialog.vue +12 -9
- package/src/components/ui/dialog/DialogClose.vue +8 -10
- package/src/components/ui/dialog/DialogContent.vue +36 -42
- package/src/components/ui/dialog/DialogDescription.vue +16 -11
- package/src/components/ui/dialog/DialogFooter.vue +13 -12
- package/src/components/ui/dialog/DialogHeader.vue +9 -8
- package/src/components/ui/dialog/DialogOverlay.vue +16 -11
- package/src/components/ui/dialog/DialogScrollContent.vue +47 -45
- package/src/components/ui/dialog/DialogTitle.vue +13 -12
- package/src/components/ui/dialog/DialogTrigger.vue +8 -7
- package/src/components/ui/dialog/index.ts +10 -10
- package/src/components/ui/field/Field.vue +12 -14
- package/src/components/ui/field/FieldContent.vue +13 -11
- package/src/components/ui/field/FieldDescription.vue +15 -13
- package/src/components/ui/field/FieldError.vue +43 -40
- package/src/components/ui/field/FieldGroup.vue +13 -11
- package/src/components/ui/field/FieldLabel.vue +16 -14
- package/src/components/ui/field/FieldLegend.vue +16 -14
- package/src/components/ui/field/FieldSeparator.vue +17 -15
- package/src/components/ui/field/FieldSet.vue +14 -12
- package/src/components/ui/field/FieldTitle.vue +13 -11
- package/src/components/ui/field/index.ts +36 -36
- package/src/components/ui/input/Input.vue +23 -20
- package/src/components/ui/input/index.ts +1 -1
- package/src/components/ui/label/Label.vue +16 -15
- package/src/components/ui/label/index.ts +1 -1
- package/src/components/ui/native-select/NativeSelect.vue +31 -41
- package/src/components/ui/native-select/NativeSelectOptGroup.vue +8 -7
- package/src/components/ui/native-select/NativeSelectOption.vue +8 -7
- package/src/components/ui/native-select/index.ts +3 -3
- package/src/components/ui/popover/Popover.vue +12 -9
- package/src/components/ui/popover/PopoverAnchor.vue +8 -7
- package/src/components/ui/popover/PopoverContent.vue +27 -31
- package/src/components/ui/popover/PopoverTrigger.vue +8 -7
- package/src/components/ui/popover/index.ts +4 -4
- package/src/components/ui/progress/Progress.vue +18 -32
- package/src/components/ui/progress/index.ts +1 -1
- package/src/components/ui/scroll-area/ScrollArea.vue +23 -26
- package/src/components/ui/scroll-area/ScrollBar.vue +22 -26
- package/src/components/ui/scroll-area/index.ts +2 -2
- package/src/components/ui/select/Select.vue +12 -9
- package/src/components/ui/select/SelectContent.vue +39 -40
- package/src/components/ui/select/SelectGroup.vue +8 -7
- package/src/components/ui/select/SelectItem.vue +36 -41
- package/src/components/ui/select/SelectItemContent.vue +22 -15
- package/src/components/ui/select/SelectItemText.vue +8 -7
- package/src/components/ui/select/SelectLabel.vue +10 -9
- package/src/components/ui/select/SelectScrollDownButton.vue +21 -17
- package/src/components/ui/select/SelectScrollUpButton.vue +21 -17
- package/src/components/ui/select/SelectSeparator.vue +11 -9
- package/src/components/ui/select/SelectTrigger.vue +27 -25
- package/src/components/ui/select/SelectValue.vue +8 -7
- package/src/components/ui/select/SelectValueContent.vue +30 -18
- package/src/components/ui/select/index.ts +13 -13
- package/src/components/ui/separator/Separator.vue +17 -18
- package/src/components/ui/separator/index.ts +1 -1
- package/src/components/ui/sheet/Sheet.vue +12 -9
- package/src/components/ui/sheet/SheetClose.vue +8 -7
- package/src/components/ui/sheet/SheetContent.vue +36 -37
- package/src/components/ui/sheet/SheetDescription.vue +12 -11
- package/src/components/ui/sheet/SheetFooter.vue +8 -7
- package/src/components/ui/sheet/SheetHeader.vue +8 -7
- package/src/components/ui/sheet/SheetOverlay.vue +16 -11
- package/src/components/ui/sheet/SheetTitle.vue +12 -11
- package/src/components/ui/sheet/SheetTrigger.vue +8 -7
- package/src/components/ui/sheet/index.ts +8 -8
- package/src/components/ui/sidebar/Sidebar.vue +68 -61
- package/src/components/ui/sidebar/SidebarContent.vue +13 -8
- package/src/components/ui/sidebar/SidebarFooter.vue +13 -8
- package/src/components/ui/sidebar/SidebarGroup.vue +13 -8
- package/src/components/ui/sidebar/SidebarGroupAction.vue +16 -16
- package/src/components/ui/sidebar/SidebarGroupContent.vue +9 -8
- package/src/components/ui/sidebar/SidebarGroupLabel.vue +15 -14
- package/src/components/ui/sidebar/SidebarHeader.vue +13 -8
- package/src/components/ui/sidebar/SidebarInput.vue +14 -12
- package/src/components/ui/sidebar/SidebarInset.vue +14 -12
- package/src/components/ui/sidebar/SidebarMenu.vue +9 -8
- package/src/components/ui/sidebar/SidebarMenuAction.vue +25 -23
- package/src/components/ui/sidebar/SidebarMenuBadge.vue +19 -17
- package/src/components/ui/sidebar/SidebarMenuButton.vue +33 -32
- package/src/components/ui/sidebar/SidebarMenuButtonChild.vue +19 -18
- package/src/components/ui/sidebar/SidebarMenuItem.vue +9 -8
- package/src/components/ui/sidebar/SidebarMenuSkeleton.vue +17 -12
- package/src/components/ui/sidebar/SidebarMenuSub.vue +14 -12
- package/src/components/ui/sidebar/SidebarMenuSubButton.vue +24 -21
- package/src/components/ui/sidebar/SidebarMenuSubItem.vue +9 -8
- package/src/components/ui/sidebar/SidebarProvider.vue +63 -53
- package/src/components/ui/sidebar/SidebarRail.vue +20 -18
- package/src/components/ui/sidebar/SidebarSeparator.vue +10 -9
- package/src/components/ui/sidebar/SidebarTrigger.vue +15 -14
- package/src/components/ui/sidebar/index.ts +62 -58
- package/src/components/ui/sidebar/utils.ts +16 -16
- package/src/components/ui/skeleton/Skeleton.vue +12 -9
- package/src/components/ui/skeleton/index.ts +1 -1
- package/src/components/ui/slider/Slider.vue +24 -19
- package/src/components/ui/slider/index.ts +1 -1
- package/src/components/ui/switch/Switch.vue +26 -23
- package/src/components/ui/switch/index.ts +1 -1
- package/src/components/ui/table/Table.vue +11 -10
- package/src/components/ui/table/TableBody.vue +9 -11
- package/src/components/ui/table/TableCaption.vue +9 -11
- package/src/components/ui/table/TableCell.vue +13 -16
- package/src/components/ui/table/TableEmpty.vue +22 -25
- package/src/components/ui/table/TableFooter.vue +13 -11
- package/src/components/ui/table/TableHead.vue +13 -11
- package/src/components/ui/table/TableHeader.vue +9 -11
- package/src/components/ui/table/TableRow.vue +13 -11
- package/src/components/ui/table/index.ts +9 -9
- package/src/components/ui/tabs/Tabs.vue +18 -18
- package/src/components/ui/tabs/TabsContent.vue +14 -15
- package/src/components/ui/tabs/TabsList.vue +18 -18
- package/src/components/ui/tabs/TabsTrigger.vue +19 -20
- package/src/components/ui/tabs/index.ts +4 -4
- package/src/components/ui/textarea/Textarea.vue +23 -20
- package/src/components/ui/textarea/index.ts +1 -1
- package/src/components/ui/time-picker/TimePicker.vue +33 -38
- package/src/components/ui/time-picker/index.ts +2 -2
- package/src/components/ui/tooltip/Tooltip.vue +12 -9
- package/src/components/ui/tooltip/TooltipContent.vue +28 -20
- package/src/components/ui/tooltip/TooltipProvider.vue +9 -8
- package/src/components/ui/tooltip/TooltipTrigger.vue +8 -7
- package/src/components/ui/tooltip/index.ts +4 -4
- package/src/i18n/de.json +5 -0
- package/src/i18n/en.json +5 -0
- package/src/i18n/es.json +5 -0
- package/src/i18n/fr.json +5 -0
- package/src/i18n/it.json +5 -0
- package/src/i18n/ja.json +5 -0
- package/src/i18n/pt.json +5 -0
- package/src/i18n/ru.json +5 -0
- package/src/i18n/zh.json +5 -0
- package/src/lib/common-types.ts +2 -0
- package/src/lib/i18n.ts +0 -5
- package/src/runtime/{ui-vintage-i18n-plugin.js → ui-vintage-i18n-plugin.ts} +30 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Textarea } from
|
|
1
|
+
export { default as Textarea } from './Textarea.vue';
|
|
@@ -1,56 +1,51 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'vue'
|
|
3
|
-
import { computed, ref } from 'vue'
|
|
4
|
-
import { cn } from '../../../lib/utils'
|
|
5
|
-
import { Input } from '../input'
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { computed, ref } from 'vue';
|
|
4
|
+
import { cn } from '../../../lib/utils';
|
|
5
|
+
import { Input } from '../input';
|
|
6
6
|
|
|
7
|
+
// Props
|
|
7
8
|
const props = withDefaults(defineProps<{
|
|
8
|
-
defaultValue?: string
|
|
9
|
-
modelValue?: string
|
|
10
|
-
step?: string | number
|
|
11
|
-
min?: string
|
|
12
|
-
max?: string
|
|
13
|
-
disabled?: boolean
|
|
14
|
-
class?: HTMLAttributes['class']
|
|
15
|
-
inputClass?: HTMLAttributes['class']
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
modelValue?: string;
|
|
11
|
+
step?: string | number;
|
|
12
|
+
min?: string;
|
|
13
|
+
max?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
class?: HTMLAttributes['class'];
|
|
16
|
+
inputClass?: HTMLAttributes['class'];
|
|
16
17
|
}>(), {
|
|
17
18
|
defaultValue: '',
|
|
18
19
|
step: 1,
|
|
19
|
-
disabled: false
|
|
20
|
-
})
|
|
20
|
+
disabled: false
|
|
21
|
+
});
|
|
21
22
|
|
|
23
|
+
// Emits
|
|
22
24
|
const emits = defineEmits<{
|
|
23
|
-
(e: 'update:modelValue', payload: string): void
|
|
24
|
-
}>()
|
|
25
|
+
(e: 'update:modelValue', payload: string): void;
|
|
26
|
+
}>();
|
|
25
27
|
|
|
26
|
-
const internalValue = ref(props.defaultValue)
|
|
27
|
-
const isControlled = computed(() => props.modelValue !== undefined)
|
|
28
|
+
const internalValue = ref(props.defaultValue);
|
|
29
|
+
const isControlled = computed(() => props.modelValue !== undefined);
|
|
28
30
|
|
|
29
31
|
const time = computed({
|
|
30
|
-
get: () =>
|
|
32
|
+
get: () =>
|
|
33
|
+
(isControlled.value ? props.modelValue : internalValue.value) ?? '',
|
|
31
34
|
set: (value: string | number) => {
|
|
32
|
-
const nextValue = String(value)
|
|
35
|
+
const nextValue = String(value);
|
|
33
36
|
|
|
34
|
-
if (!isControlled.value)
|
|
35
|
-
internalValue.value = nextValue
|
|
37
|
+
if (!isControlled.value) internalValue.value = nextValue;
|
|
36
38
|
|
|
37
|
-
emits('update:modelValue', nextValue)
|
|
38
|
-
}
|
|
39
|
-
})
|
|
39
|
+
emits('update:modelValue', nextValue);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
40
42
|
</script>
|
|
41
43
|
|
|
42
44
|
<template>
|
|
43
|
-
<Input
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
:disabled="props.disabled"
|
|
50
|
-
:class="cn(
|
|
51
|
-
'cursor-pointer font-normal hover:border-(--border-hover-light) hover:bg-(--bg-selected-light) dark:hover:border-(--border-hover-dark) dark:hover:bg-(--bg-selected-dark) [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-70 hover:[&::-webkit-calendar-picker-indicator]:opacity-100',
|
|
52
|
-
props.inputClass,
|
|
53
|
-
props.class,
|
|
54
|
-
)"
|
|
55
|
-
/>
|
|
45
|
+
<Input v-model="time" type="time" :step="props.step" :min="props.min" :max="props.max" :disabled="props.disabled" :class="cn(
|
|
46
|
+
'cursor-pointer font-normal hover:border-(--border-hover-light) hover:bg-(--bg-selected-light) dark:hover:border-(--border-hover-dark) dark:hover:bg-(--bg-selected-dark) [&::-webkit-calendar-picker-indicator]:cursor-pointer [&::-webkit-calendar-picker-indicator]:opacity-70 hover:[&::-webkit-calendar-picker-indicator]:opacity-100',
|
|
47
|
+
props.inputClass,
|
|
48
|
+
props.class
|
|
49
|
+
)
|
|
50
|
+
" />
|
|
56
51
|
</template>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as TimePicker } from './TimePicker.vue'
|
|
2
|
-
export { default } from './TimePicker.vue'
|
|
1
|
+
export { default as TimePicker } from './TimePicker.vue';
|
|
2
|
+
export { default } from './TimePicker.vue';
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { TooltipRootEmits, TooltipRootProps } from
|
|
3
|
-
import { TooltipRoot, useForwardPropsEmits } from
|
|
2
|
+
import type { TooltipRootEmits, TooltipRootProps } from 'reka-ui';
|
|
3
|
+
import { TooltipRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const
|
|
5
|
+
// Props
|
|
6
|
+
const props = defineProps<TooltipRootProps>();
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Emits
|
|
9
|
+
const emits = defineEmits<TooltipRootEmits>();
|
|
10
|
+
|
|
11
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
12
|
</script>
|
|
10
13
|
|
|
11
14
|
<template>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</template>
|
|
15
|
+
<TooltipRoot v-slot="slotProps" data-slot="tooltip" v-bind="forwarded">
|
|
16
|
+
<slot v-bind="slotProps" />
|
|
17
|
+
</TooltipRoot>
|
|
18
|
+
</template>
|
|
@@ -1,30 +1,38 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { TooltipContentEmits, TooltipContentProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { TooltipArrow, TooltipContent, TooltipPortal, useForwardPropsEmits } from
|
|
6
|
-
import { cn } from
|
|
2
|
+
import type { TooltipContentEmits, TooltipContentProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { TooltipArrow, TooltipContent, TooltipPortal, useForwardPropsEmits } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
7
|
|
|
8
8
|
defineOptions({
|
|
9
|
-
|
|
10
|
-
})
|
|
9
|
+
inheritAttrs: false
|
|
10
|
+
});
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
// Props
|
|
13
|
+
const props = withDefaults(defineProps<TooltipContentProps & {
|
|
14
|
+
class?: HTMLAttributes['class'];
|
|
15
|
+
}>(), {
|
|
16
|
+
sideOffset: 4
|
|
17
|
+
});
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
// Emits
|
|
20
|
+
const emits = defineEmits<TooltipContentEmits>();
|
|
17
21
|
|
|
18
|
-
const delegatedProps = reactiveOmit(props,
|
|
19
|
-
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
22
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
23
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
20
24
|
</script>
|
|
21
25
|
|
|
22
26
|
<template>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
<TooltipPortal>
|
|
28
|
+
<TooltipContent data-slot="tooltip-content" v-bind="{ ...forwarded, ...$attrs }" :class="cn(
|
|
29
|
+
'bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit rounded-md px-3 py-1.5 text-xs text-balance',
|
|
30
|
+
props.class
|
|
31
|
+
)
|
|
32
|
+
">
|
|
33
|
+
<slot />
|
|
26
34
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</template>
|
|
35
|
+
<TooltipArrow class="bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-xs" />
|
|
36
|
+
</TooltipContent>
|
|
37
|
+
</TooltipPortal>
|
|
38
|
+
</template>
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { TooltipProviderProps } from
|
|
3
|
-
import { TooltipProvider } from
|
|
2
|
+
import type { TooltipProviderProps } from 'reka-ui';
|
|
3
|
+
import { TooltipProvider } from 'reka-ui';
|
|
4
4
|
|
|
5
|
+
// Props
|
|
5
6
|
const props = withDefaults(defineProps<TooltipProviderProps>(), {
|
|
6
|
-
|
|
7
|
-
})
|
|
7
|
+
delayDuration: 0
|
|
8
|
+
});
|
|
8
9
|
</script>
|
|
9
10
|
|
|
10
11
|
<template>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
</template>
|
|
12
|
+
<TooltipProvider v-bind="props">
|
|
13
|
+
<slot />
|
|
14
|
+
</TooltipProvider>
|
|
15
|
+
</template>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { TooltipTriggerProps } from
|
|
3
|
-
import { TooltipTrigger } from
|
|
2
|
+
import type { TooltipTriggerProps } from 'reka-ui';
|
|
3
|
+
import { TooltipTrigger } from 'reka-ui';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Props
|
|
6
|
+
const props = defineProps<TooltipTriggerProps>();
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<template>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</template>
|
|
10
|
+
<TooltipTrigger data-slot="tooltip-trigger" v-bind="props">
|
|
11
|
+
<slot />
|
|
12
|
+
</TooltipTrigger>
|
|
13
|
+
</template>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as Tooltip } from
|
|
2
|
-
export { default as TooltipContent } from
|
|
3
|
-
export { default as TooltipProvider } from
|
|
4
|
-
export { default as TooltipTrigger } from
|
|
1
|
+
export { default as Tooltip } from './Tooltip.vue';
|
|
2
|
+
export { default as TooltipContent } from './TooltipContent.vue';
|
|
3
|
+
export { default as TooltipProvider } from './TooltipProvider.vue';
|
|
4
|
+
export { default as TooltipTrigger } from './TooltipTrigger.vue';
|
package/src/i18n/de.json
CHANGED
package/src/i18n/en.json
CHANGED
package/src/i18n/es.json
CHANGED
package/src/i18n/fr.json
CHANGED
package/src/i18n/it.json
CHANGED
package/src/i18n/ja.json
CHANGED
package/src/i18n/pt.json
CHANGED
package/src/i18n/ru.json
CHANGED
package/src/i18n/zh.json
CHANGED
package/src/lib/i18n.ts
CHANGED
|
@@ -24,11 +24,6 @@ export const uiVintageMessages = {
|
|
|
24
24
|
// The type of the available locales based on the keys of the messages object
|
|
25
25
|
type UiVintageLocale = keyof typeof uiVintageMessages;
|
|
26
26
|
|
|
27
|
-
// Get the messages for a specific locale
|
|
28
|
-
export const getUiVintageMessagesForLocale = (locale: keyof typeof uiVintageMessages) => {
|
|
29
|
-
return uiVintageMessages[locale];
|
|
30
|
-
};
|
|
31
|
-
|
|
32
27
|
// Resolve the current runtime locale from the document or navigator
|
|
33
28
|
const getUiVintageRuntimeLocale = (): UiVintageLocale => {
|
|
34
29
|
let browserLocale = 'en';
|
|
@@ -1,21 +1,39 @@
|
|
|
1
1
|
import { defineNuxtPlugin } from 'nuxt/app';
|
|
2
|
+
import type { NuxtApp } from 'nuxt/app';
|
|
2
3
|
import { uiVintageMessages } from '../lib/i18n';
|
|
3
4
|
|
|
5
|
+
type MessageComposer = {
|
|
6
|
+
mergeLocaleMessage: (locale: string, messages: unknown) => void;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type I18nInstance = {
|
|
10
|
+
mergeLocaleMessage?: unknown;
|
|
11
|
+
global?: {
|
|
12
|
+
mergeLocaleMessage?: unknown;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type NuxtAppWithI18n = NuxtApp & {
|
|
17
|
+
$i18n?: unknown;
|
|
18
|
+
};
|
|
19
|
+
|
|
4
20
|
// Resolve the active i18n composer from either the Nuxt app or the Vue I18n instance
|
|
5
|
-
const resolveMessageComposer = i18n => {
|
|
21
|
+
const resolveMessageComposer = (i18n: unknown): MessageComposer | null => {
|
|
6
22
|
// If no i18n instance is provided, return null
|
|
7
|
-
if (!i18n) {
|
|
23
|
+
if (!i18n || typeof i18n !== 'object') {
|
|
8
24
|
return null;
|
|
9
25
|
}
|
|
10
26
|
|
|
27
|
+
const instance = i18n as I18nInstance;
|
|
28
|
+
|
|
11
29
|
// Check if the provided i18n instance has the mergeLocaleMessage method (Vue I18n 9+ composer API)
|
|
12
|
-
if (typeof
|
|
13
|
-
return i18n;
|
|
30
|
+
if (typeof instance.mergeLocaleMessage === 'function') {
|
|
31
|
+
return i18n as MessageComposer;
|
|
14
32
|
}
|
|
15
33
|
|
|
16
34
|
// Check if the provided i18n instance has a global property with the mergeLocaleMessage method (Vue I18n 9+ global API)
|
|
17
|
-
if (
|
|
18
|
-
return
|
|
35
|
+
if (instance.global && typeof instance.global.mergeLocaleMessage === 'function') {
|
|
36
|
+
return instance.global as MessageComposer;
|
|
19
37
|
}
|
|
20
38
|
|
|
21
39
|
// If neither check succeeded, return null
|
|
@@ -23,9 +41,13 @@ const resolveMessageComposer = i18n => {
|
|
|
23
41
|
};
|
|
24
42
|
|
|
25
43
|
// Merge the library locale messages into the app composer
|
|
26
|
-
const applyUiVintageMessages = nuxtApp => {
|
|
44
|
+
const applyUiVintageMessages = (nuxtApp: NuxtApp): void => {
|
|
27
45
|
// Attempt to resolve the i18n composer from the Nuxt app or Vue I18n instance
|
|
28
|
-
const
|
|
46
|
+
const app = nuxtApp as NuxtAppWithI18n;
|
|
47
|
+
const globalProperties = app.vueApp.config.globalProperties as {
|
|
48
|
+
$i18n?: unknown;
|
|
49
|
+
};
|
|
50
|
+
const composer = resolveMessageComposer(app.$i18n || globalProperties.$i18n);
|
|
29
51
|
if (!composer) {
|
|
30
52
|
return;
|
|
31
53
|
}
|