@brumaombra/ui-vintage 0.7.7 → 0.7.9
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/BlogFAQSection.vue +8 -3
- package/src/components/blog/BlogHeaderSection.vue +14 -11
- package/src/components/blog/BlogInfoSection.vue +13 -11
- 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 +11 -11
- package/src/components/blog/TableOfContents.vue +29 -13
- 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 +49 -65
- 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 +15 -17
- package/src/components/landing/landing-navbar/index.ts +2 -2
- package/src/components/landing/landing-shell/LandingShell.vue +10 -13
- 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/theme-selector/ThemeSelector.vue +4 -4
- package/src/components/ui/accordion/Accordion.vue +12 -15
- 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,139 +1,185 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarRootEmits, CalendarRootProps, DateValue } from
|
|
3
|
-
import type { HTMLAttributes, Ref } from
|
|
4
|
-
import type { LayoutTypes } from
|
|
5
|
-
import { getLocalTimeZone, today } from
|
|
6
|
-
import { createReusableTemplate, reactiveOmit, useVModel } from
|
|
7
|
-
import { CalendarRoot, useDateFormatter, useForwardPropsEmits } from
|
|
8
|
-
import { createYear, createYearRange, toDate } from
|
|
9
|
-
import { computed, toRaw } from
|
|
10
|
-
import { cn } from
|
|
11
|
-
import { NativeSelect, NativeSelectOption } from '../native-select'
|
|
12
|
-
import {
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarRootEmits, CalendarRootProps, DateValue } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes, Ref } from 'vue';
|
|
4
|
+
import type { LayoutTypes } from '.';
|
|
5
|
+
import { getLocalTimeZone, today } from '@internationalized/date';
|
|
6
|
+
import { createReusableTemplate, reactiveOmit, useVModel } from '@vueuse/core';
|
|
7
|
+
import { CalendarRoot, useDateFormatter, useForwardPropsEmits } from 'reka-ui';
|
|
8
|
+
import { createYear, createYearRange, toDate } from 'reka-ui/date';
|
|
9
|
+
import { computed, toRaw } from 'vue';
|
|
10
|
+
import { cn } from '../../../lib/utils';
|
|
11
|
+
import { NativeSelect, NativeSelectOption } from '../native-select';
|
|
12
|
+
import {
|
|
13
|
+
CalendarCell,
|
|
14
|
+
CalendarCellTrigger,
|
|
15
|
+
CalendarGrid,
|
|
16
|
+
CalendarGridBody,
|
|
17
|
+
CalendarGridHead,
|
|
18
|
+
CalendarGridRow,
|
|
19
|
+
CalendarHeadCell,
|
|
20
|
+
CalendarHeader,
|
|
21
|
+
CalendarHeading,
|
|
22
|
+
CalendarNextButton,
|
|
23
|
+
CalendarPrevButton,
|
|
24
|
+
} from '.';
|
|
13
25
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
// Props
|
|
27
|
+
const props = withDefaults(defineProps<CalendarRootProps & {
|
|
28
|
+
class?: HTMLAttributes['class'];
|
|
29
|
+
layout?: LayoutTypes;
|
|
30
|
+
yearRange?: DateValue[];
|
|
31
|
+
}>(), {
|
|
32
|
+
modelValue: undefined,
|
|
33
|
+
layout: undefined
|
|
34
|
+
});
|
|
19
35
|
|
|
20
|
-
|
|
36
|
+
// Emits
|
|
37
|
+
const emits = defineEmits<CalendarRootEmits>();
|
|
21
38
|
|
|
22
|
-
const
|
|
23
|
-
passive: true,
|
|
24
|
-
defaultValue: props.defaultPlaceholder ?? today(getLocalTimeZone()),
|
|
25
|
-
}) as Ref<DateValue>
|
|
39
|
+
const delegatedProps = reactiveOmit(props, 'class', 'layout', 'placeholder');
|
|
26
40
|
|
|
27
|
-
const
|
|
41
|
+
const placeholder = useVModel(props, 'placeholder', emits, {
|
|
42
|
+
passive: true,
|
|
43
|
+
defaultValue: props.defaultPlaceholder ?? today(getLocalTimeZone()),
|
|
44
|
+
}) as Ref<DateValue>;
|
|
45
|
+
|
|
46
|
+
const formatter = useDateFormatter(props.locale ?? 'en');
|
|
28
47
|
|
|
29
48
|
const yearRange = computed(() => {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
49
|
+
return (
|
|
50
|
+
props.yearRange ??
|
|
51
|
+
createYearRange({
|
|
52
|
+
start:
|
|
53
|
+
props?.minValue ??
|
|
54
|
+
(
|
|
55
|
+
toRaw(props.placeholder) ??
|
|
56
|
+
props.defaultPlaceholder ??
|
|
57
|
+
today(getLocalTimeZone())
|
|
58
|
+
).cycle('year', -100),
|
|
33
59
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
end:
|
|
61
|
+
props?.maxValue ??
|
|
62
|
+
(
|
|
63
|
+
toRaw(props.placeholder) ??
|
|
64
|
+
props.defaultPlaceholder ??
|
|
65
|
+
today(getLocalTimeZone())
|
|
66
|
+
).cycle('year', 10),
|
|
67
|
+
})
|
|
68
|
+
);
|
|
69
|
+
});
|
|
38
70
|
|
|
39
|
-
const [DefineMonthTemplate, ReuseMonthTemplate] = createReusableTemplate<{
|
|
40
|
-
|
|
71
|
+
const [DefineMonthTemplate, ReuseMonthTemplate] = createReusableTemplate<{
|
|
72
|
+
date: DateValue;
|
|
73
|
+
}>();
|
|
74
|
+
const [DefineYearTemplate, ReuseYearTemplate] = createReusableTemplate<{
|
|
75
|
+
date: DateValue;
|
|
76
|
+
}>();
|
|
41
77
|
|
|
42
|
-
const forwarded = useForwardPropsEmits(delegatedProps, emits)
|
|
78
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
43
79
|
</script>
|
|
44
80
|
|
|
45
81
|
<template>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
82
|
+
<DefineMonthTemplate v-slot="{ date }">
|
|
83
|
+
<div class="**:data-[slot=native-select-icon]:right-1">
|
|
84
|
+
<div class="relative h-10 rounded border border-(--border-light) bg-(--button-secondary-light) transition-all duration-300 ease-in-out hover:border-(--border-hover-light) focus-within:border-(--border-hover-light) dark:border-(--border-dark) dark:bg-(--button-secondary-dark) dark:hover:border-(--border-hover-dark) dark:focus-within:border-(--border-hover-dark)">
|
|
85
|
+
<div class="absolute inset-0 z-10 flex h-full items-center text-sm pl-2 pointer-events-none">
|
|
86
|
+
{{ formatter.custom(toDate(date), { month: 'short' }) }}
|
|
87
|
+
</div>
|
|
88
|
+
<NativeSelect class="relative z-20 h-full min-h-0 w-23 rounded-none border-0 bg-transparent pl-2 pr-6 text-xs font-semibold text-transparent shadow-none transition-all duration-300 ease-in-out outline-none ring-0 focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent sm:text-sm" :model-value="date.month" @change="
|
|
89
|
+
(e: Event) => {
|
|
90
|
+
placeholder = placeholder.set({
|
|
91
|
+
month: Number((e?.target as any)?.value),
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
">
|
|
95
|
+
<NativeSelectOption v-for="month in createYear({ dateObj: date })" :key="month.toString()" :value="month.month" :selected="date.month === month.month">
|
|
96
|
+
{{
|
|
97
|
+
formatter.custom(toDate(month), { month: 'short' })
|
|
98
|
+
}}
|
|
99
|
+
</NativeSelectOption>
|
|
100
|
+
</NativeSelect>
|
|
101
|
+
</div>
|
|
51
102
|
</div>
|
|
52
|
-
|
|
53
|
-
placeholder = placeholder.set({
|
|
54
|
-
month: Number((e?.target as any)?.value),
|
|
55
|
-
})
|
|
56
|
-
}">
|
|
57
|
-
<NativeSelectOption v-for="(month) in createYear({ dateObj: date })" :key="month.toString()" :value="month.month" :selected="date.month === month.month">
|
|
58
|
-
{{ formatter.custom(toDate(month), { month: 'short' }) }}
|
|
59
|
-
</NativeSelectOption>
|
|
60
|
-
</NativeSelect>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
</DefineMonthTemplate>
|
|
103
|
+
</DefineMonthTemplate>
|
|
64
104
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
105
|
+
<DefineYearTemplate v-slot="{ date }">
|
|
106
|
+
<div class="**:data-[slot=native-select-icon]:right-1">
|
|
107
|
+
<div class="relative h-10 rounded border border-(--border-light) bg-(--button-secondary-light) transition-all duration-300 ease-in-out hover:border-(--border-hover-light) focus-within:border-(--border-hover-light) dark:border-(--border-dark) dark:bg-(--button-secondary-dark) dark:hover:border-(--border-hover-dark) dark:focus-within:border-(--border-hover-dark)">
|
|
108
|
+
<div class="absolute inset-0 z-10 flex h-full items-center text-sm pl-2 pointer-events-none">
|
|
109
|
+
{{ formatter.custom(toDate(date), { year: 'numeric' }) }}
|
|
110
|
+
</div>
|
|
111
|
+
<NativeSelect class="relative z-20 h-full min-h-0 w-24 rounded-none border-0 bg-transparent pl-2 pr-6 text-xs font-semibold text-transparent shadow-none transition-all duration-300 ease-in-out outline-none ring-0 focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent sm:text-sm" :model-value="date.year" @change="
|
|
112
|
+
(e: Event) => {
|
|
113
|
+
placeholder = placeholder.set({
|
|
114
|
+
year: Number((e?.target as any)?.value),
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
">
|
|
118
|
+
<NativeSelectOption v-for="year in yearRange" :key="year.toString()" :value="year.year" :selected="date.year === year.year">
|
|
119
|
+
{{
|
|
120
|
+
formatter.custom(toDate(year), { year: 'numeric' })
|
|
121
|
+
}}
|
|
122
|
+
</NativeSelectOption>
|
|
123
|
+
</NativeSelect>
|
|
124
|
+
</div>
|
|
70
125
|
</div>
|
|
71
|
-
|
|
72
|
-
placeholder = placeholder.set({
|
|
73
|
-
year: Number((e?.target as any)?.value),
|
|
74
|
-
})
|
|
75
|
-
}">
|
|
76
|
-
<NativeSelectOption v-for="(year) in yearRange" :key="year.toString()" :value="year.year" :selected="date.year === year.year">
|
|
77
|
-
{{ formatter.custom(toDate(year), { year: 'numeric' }) }}
|
|
78
|
-
</NativeSelectOption>
|
|
79
|
-
</NativeSelect>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</DefineYearTemplate>
|
|
126
|
+
</DefineYearTemplate>
|
|
83
127
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
128
|
+
<CalendarRoot v-slot="{ grid, weekDays, date }" v-bind="forwarded" v-model:placeholder="placeholder" data-slot="calendar" :class="cn('p-3', props.class)">
|
|
129
|
+
<CalendarHeader class="pt-0">
|
|
130
|
+
<nav class="flex items-center gap-1 absolute top-0 inset-x-0 justify-between">
|
|
131
|
+
<CalendarPrevButton>
|
|
132
|
+
<slot name="calendar-prev-icon" />
|
|
133
|
+
</CalendarPrevButton>
|
|
134
|
+
<CalendarNextButton>
|
|
135
|
+
<slot name="calendar-next-icon" />
|
|
136
|
+
</CalendarNextButton>
|
|
137
|
+
</nav>
|
|
94
138
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
139
|
+
<slot name="calendar-heading" :date="date" :month="ReuseMonthTemplate" :year="ReuseYearTemplate">
|
|
140
|
+
<template v-if="layout === 'month-and-year'">
|
|
141
|
+
<div class="flex items-center justify-center gap-1">
|
|
142
|
+
<ReuseMonthTemplate :date="date" />
|
|
143
|
+
<ReuseYearTemplate :date="date" />
|
|
144
|
+
</div>
|
|
145
|
+
</template>
|
|
146
|
+
<template v-else-if="layout === 'month-only'">
|
|
147
|
+
<div class="flex items-center justify-center gap-1">
|
|
148
|
+
<ReuseMonthTemplate :date="date" />
|
|
149
|
+
{{
|
|
150
|
+
formatter.custom(toDate(date), { year: 'numeric' })
|
|
151
|
+
}}
|
|
152
|
+
</div>
|
|
153
|
+
</template>
|
|
154
|
+
<template v-else-if="layout === 'year-only'">
|
|
155
|
+
<div class="flex items-center justify-center gap-1">
|
|
156
|
+
{{ formatter.custom(toDate(date), { month: 'short' }) }}
|
|
157
|
+
<ReuseYearTemplate :date="date" />
|
|
158
|
+
</div>
|
|
159
|
+
</template>
|
|
160
|
+
<template v-else>
|
|
161
|
+
<CalendarHeading />
|
|
162
|
+
</template>
|
|
163
|
+
</slot>
|
|
164
|
+
</CalendarHeader>
|
|
119
165
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</template>
|
|
166
|
+
<div class="flex flex-col gap-y-4 mt-4 sm:flex-row sm:gap-x-4 sm:gap-y-0">
|
|
167
|
+
<CalendarGrid v-for="month in grid" :key="month.value.toString()">
|
|
168
|
+
<CalendarGridHead>
|
|
169
|
+
<CalendarGridRow>
|
|
170
|
+
<CalendarHeadCell v-for="day in weekDays" :key="day">
|
|
171
|
+
{{ day }}
|
|
172
|
+
</CalendarHeadCell>
|
|
173
|
+
</CalendarGridRow>
|
|
174
|
+
</CalendarGridHead>
|
|
175
|
+
<CalendarGridBody>
|
|
176
|
+
<CalendarGridRow v-for="(weekDates, index) in month.rows" :key="`weekDate-${index}`" class="mt-2 w-full">
|
|
177
|
+
<CalendarCell v-for="weekDate in weekDates" :key="weekDate.toString()" :date="weekDate">
|
|
178
|
+
<CalendarCellTrigger :day="weekDate" :month="month.value" />
|
|
179
|
+
</CalendarCell>
|
|
180
|
+
</CalendarGridRow>
|
|
181
|
+
</CalendarGridBody>
|
|
182
|
+
</CalendarGrid>
|
|
183
|
+
</div>
|
|
184
|
+
</CalendarRoot>
|
|
185
|
+
</template>
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarCellProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { CalendarCell, useForwardProps } from
|
|
6
|
-
import { cn } from
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarCellProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { CalendarCell, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Props
|
|
9
|
+
const props = defineProps<CalendarCellProps & { class?: HTMLAttributes['class'] }>();
|
|
9
10
|
|
|
10
|
-
const delegatedProps = reactiveOmit(props,
|
|
11
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
11
12
|
|
|
12
|
-
const forwardedProps = useForwardProps(delegatedProps)
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<template>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</template>
|
|
17
|
+
<CalendarCell data-slot="calendar-cell" :class="cn(
|
|
18
|
+
'relative p-0 text-center text-sm focus-within:relative focus-within:z-20 flex-1 [&:has([data-selected])]:rounded-md',
|
|
19
|
+
props.class,
|
|
20
|
+
)
|
|
21
|
+
" v-bind="forwardedProps">
|
|
22
|
+
<slot />
|
|
23
|
+
</CalendarCell>
|
|
24
|
+
</template>
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarCellTriggerProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { CalendarCellTrigger, useForwardProps } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { buttonVariants } from '../button'
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarCellTriggerProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { CalendarCellTrigger, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { buttonVariants } from '../button';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
// Props
|
|
10
|
+
const props = withDefaults(defineProps<CalendarCellTriggerProps & { class?: HTMLAttributes['class'] }>(), {
|
|
11
|
+
as: 'button'
|
|
12
|
+
});
|
|
12
13
|
|
|
13
|
-
const delegatedProps = reactiveOmit(props,
|
|
14
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
14
15
|
|
|
15
|
-
const forwardedProps = useForwardProps(delegatedProps)
|
|
16
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
16
17
|
</script>
|
|
17
18
|
|
|
18
19
|
<template>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<slot />
|
|
38
|
-
</CalendarCellTrigger>
|
|
39
|
-
</template>
|
|
20
|
+
<CalendarCellTrigger data-slot="calendar-cell-trigger" :class="cn(
|
|
21
|
+
buttonVariants({ variant: 'ghost' }),
|
|
22
|
+
'size-8 p-0 font-normal aria-selected:opacity-100 cursor-default',
|
|
23
|
+
'[&[data-today]:not([data-selected])]:bg-accent [&[data-today]:not([data-selected])]:text-accent-foreground',
|
|
24
|
+
// Selected
|
|
25
|
+
'data-selected:bg-primary data-selected:text-primary-foreground data-selected:opacity-100 [&[data-selected]:hover]:bg-primary data-selected:hover:text-primary-foreground data-selected:focus:bg-primary data-selected:focus:text-primary-foreground',
|
|
26
|
+
// Disabled
|
|
27
|
+
'data-disabled:text-muted-foreground data-disabled:opacity-50',
|
|
28
|
+
// Unavailable
|
|
29
|
+
'data-unavailable:text-destructive-foreground data-unavailable:line-through',
|
|
30
|
+
// Outside months
|
|
31
|
+
'data-outside-view:text-muted-foreground',
|
|
32
|
+
props.class,
|
|
33
|
+
)
|
|
34
|
+
" v-bind="forwardedProps">
|
|
35
|
+
<slot />
|
|
36
|
+
</CalendarCellTrigger>
|
|
37
|
+
</template>
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarGridProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { CalendarGrid, useForwardProps } from
|
|
6
|
-
import { cn } from
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarGridProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { CalendarGrid, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Props
|
|
9
|
+
const props = defineProps<CalendarGridProps & { class?: HTMLAttributes['class'] }>();
|
|
9
10
|
|
|
10
|
-
const delegatedProps = reactiveOmit(props,
|
|
11
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
11
12
|
|
|
12
|
-
const forwardedProps = useForwardProps(delegatedProps)
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<template>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
>
|
|
21
|
-
<slot />
|
|
22
|
-
</CalendarGrid>
|
|
23
|
-
</template>
|
|
17
|
+
<CalendarGrid data-slot="calendar-grid" :class="cn('w-full border-collapse space-x-1', props.class)" v-bind="forwardedProps">
|
|
18
|
+
<slot />
|
|
19
|
+
</CalendarGrid>
|
|
20
|
+
</template>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarGridBodyProps } from
|
|
3
|
-
import { CalendarGridBody } from
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarGridBodyProps } from 'reka-ui';
|
|
3
|
+
import { CalendarGridBody } from 'reka-ui';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Props
|
|
6
|
+
const props = defineProps<CalendarGridBodyProps>();
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<template>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<slot />
|
|
14
|
-
</CalendarGridBody>
|
|
15
|
-
</template>
|
|
10
|
+
<CalendarGridBody data-slot="calendar-grid-body" v-bind="props">
|
|
11
|
+
<slot />
|
|
12
|
+
</CalendarGridBody>
|
|
13
|
+
</template>
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarGridHeadProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { CalendarGridHead } from
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarGridHeadProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { CalendarGridHead } from 'reka-ui';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// Props
|
|
7
|
+
const props = defineProps<CalendarGridHeadProps & { class?: HTMLAttributes['class'] }>();
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<template>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<slot />
|
|
15
|
-
</CalendarGridHead>
|
|
16
|
-
</template>
|
|
11
|
+
<CalendarGridHead data-slot="calendar-grid-head" v-bind="props">
|
|
12
|
+
<slot />
|
|
13
|
+
</CalendarGridHead>
|
|
14
|
+
</template>
|
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarGridRowProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { CalendarGridRow, useForwardProps } from
|
|
6
|
-
import { cn } from
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarGridRowProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { CalendarGridRow, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Props
|
|
9
|
+
const props = defineProps<CalendarGridRowProps & { class?: HTMLAttributes['class'] }>();
|
|
9
10
|
|
|
10
|
-
const delegatedProps = reactiveOmit(props,
|
|
11
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
11
12
|
|
|
12
|
-
const forwardedProps = useForwardProps(delegatedProps)
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<template>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<slot />
|
|
21
|
-
</CalendarGridRow>
|
|
22
|
-
</template>
|
|
17
|
+
<CalendarGridRow data-slot="calendar-grid-row" :class="cn('flex', props.class)" v-bind="forwardedProps">
|
|
18
|
+
<slot />
|
|
19
|
+
</CalendarGridRow>
|
|
20
|
+
</template>
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
import type { CalendarHeadCellProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { CalendarHeadCell, useForwardProps } from
|
|
6
|
-
import { cn } from
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CalendarHeadCellProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { CalendarHeadCell, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Props
|
|
9
|
+
const props = defineProps<CalendarHeadCellProps & { class?: HTMLAttributes['class'] }>();
|
|
9
10
|
|
|
10
|
-
const delegatedProps = reactiveOmit(props,
|
|
11
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
11
12
|
|
|
12
|
-
const forwardedProps = useForwardProps(delegatedProps)
|
|
13
|
+
const forwardedProps = useForwardProps(delegatedProps);
|
|
13
14
|
</script>
|
|
14
15
|
|
|
15
16
|
<template>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</template>
|
|
17
|
+
<CalendarHeadCell data-slot="calendar-head-cell" :class="cn(
|
|
18
|
+
'text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem]',
|
|
19
|
+
props.class,
|
|
20
|
+
)
|
|
21
|
+
" v-bind="forwardedProps">
|
|
22
|
+
<slot />
|
|
23
|
+
</CalendarHeadCell>
|
|
24
|
+
</template>
|