@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,14 +1,19 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from
|
|
3
|
-
import { cn } from
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '../../../lib/utils';
|
|
4
4
|
|
|
5
|
+
// Props
|
|
5
6
|
const props = defineProps<{
|
|
6
|
-
|
|
7
|
-
}>()
|
|
7
|
+
class?: HTMLAttributes['class'];
|
|
8
|
+
}>();
|
|
8
9
|
</script>
|
|
9
10
|
|
|
10
11
|
<template>
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
<span data-slot="command-shortcut" :class="cn(
|
|
13
|
+
'text-muted-foreground ml-auto text-xs tracking-widest',
|
|
14
|
+
props.class,
|
|
15
|
+
)
|
|
16
|
+
">
|
|
17
|
+
<slot />
|
|
18
|
+
</span>
|
|
19
|
+
</template>
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
import type { Ref } from
|
|
2
|
-
import { createContext } from
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import { createContext } from 'reka-ui';
|
|
3
3
|
|
|
4
|
-
export { default as Command } from
|
|
5
|
-
export { default as CommandDialog } from
|
|
6
|
-
export { default as CommandEmpty } from
|
|
7
|
-
export { default as CommandGroup } from
|
|
8
|
-
export { default as CommandInput } from
|
|
9
|
-
export { default as CommandItem } from
|
|
10
|
-
export { default as CommandList } from
|
|
11
|
-
export { default as CommandSeparator } from
|
|
12
|
-
export { default as CommandShortcut } from
|
|
4
|
+
export { default as Command } from './Command.vue';
|
|
5
|
+
export { default as CommandDialog } from './CommandDialog.vue';
|
|
6
|
+
export { default as CommandEmpty } from './CommandEmpty.vue';
|
|
7
|
+
export { default as CommandGroup } from './CommandGroup.vue';
|
|
8
|
+
export { default as CommandInput } from './CommandInput.vue';
|
|
9
|
+
export { default as CommandItem } from './CommandItem.vue';
|
|
10
|
+
export { default as CommandList } from './CommandList.vue';
|
|
11
|
+
export { default as CommandSeparator } from './CommandSeparator.vue';
|
|
12
|
+
export { default as CommandShortcut } from './CommandShortcut.vue';
|
|
13
13
|
|
|
14
14
|
export const [useCommand, provideCommandContext] = createContext<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
allItems: Ref<Map<string, string>>;
|
|
16
|
+
allGroups: Ref<Map<string, Set<string>>>;
|
|
17
|
+
filterState: {
|
|
18
|
+
search: string;
|
|
19
|
+
filtered: {
|
|
20
|
+
count: number;
|
|
21
|
+
items: Map<string, number>;
|
|
22
|
+
groups: Set<string>;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}>('Command');
|
|
22
26
|
|
|
23
27
|
export const [useCommandGroup, provideCommandGroupContext] = createContext<{
|
|
24
|
-
|
|
25
|
-
}>(
|
|
28
|
+
id?: string;
|
|
29
|
+
}>('CommandGroup');
|
|
@@ -1,63 +1,72 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'vue'
|
|
3
|
-
import { DateFormatter, getLocalTimeZone, today } from '@internationalized/date'
|
|
4
|
-
import { Calendar03Icon } from '@hugeicons/core-free-icons'
|
|
5
|
-
import { HugeiconsIcon } from '@hugeicons/vue'
|
|
6
|
-
import type { DateValue } from 'reka-ui'
|
|
7
|
-
import { computed, ref } from 'vue'
|
|
8
|
-
import { cn } from '../../../lib/utils'
|
|
9
|
-
import { Button } from '../button'
|
|
10
|
-
import { Calendar } from '../calendar'
|
|
11
|
-
import {
|
|
12
|
-
Popover,
|
|
13
|
-
PopoverContent,
|
|
14
|
-
PopoverTrigger,
|
|
15
|
-
} from '../popover'
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { DateFormatter, getLocalTimeZone, today, } from '@internationalized/date';
|
|
4
|
+
import { Calendar03Icon } from '@hugeicons/core-free-icons';
|
|
5
|
+
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
6
|
+
import type { DateValue } from 'reka-ui';
|
|
7
|
+
import { computed, ref } from 'vue';
|
|
8
|
+
import { cn } from '../../../lib/utils';
|
|
9
|
+
import { Button } from '../button';
|
|
10
|
+
import { Calendar } from '../calendar';
|
|
11
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../popover';
|
|
16
12
|
|
|
13
|
+
// Props
|
|
17
14
|
const props = withDefaults(defineProps<{
|
|
18
|
-
defaultValue?: DateValue
|
|
19
|
-
modelValue?: DateValue
|
|
20
|
-
minValue?: DateValue
|
|
21
|
-
maxValue?: DateValue
|
|
22
|
-
placeholder?: string
|
|
23
|
-
disabled?: boolean
|
|
24
|
-
class?: HTMLAttributes['class']
|
|
25
|
-
contentClass?: HTMLAttributes['class']
|
|
15
|
+
defaultValue?: DateValue;
|
|
16
|
+
modelValue?: DateValue;
|
|
17
|
+
minValue?: DateValue;
|
|
18
|
+
maxValue?: DateValue;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
class?: HTMLAttributes['class'];
|
|
22
|
+
contentClass?: HTMLAttributes['class'];
|
|
26
23
|
}>(), {
|
|
27
24
|
placeholder: 'Pick a date',
|
|
28
|
-
disabled: false
|
|
29
|
-
})
|
|
25
|
+
disabled: false
|
|
26
|
+
});
|
|
30
27
|
|
|
28
|
+
// Emits
|
|
31
29
|
const emits = defineEmits<{
|
|
32
|
-
(e: 'update:modelValue', payload: DateValue | undefined): void
|
|
33
|
-
}>()
|
|
30
|
+
(e: 'update:modelValue', payload: DateValue | undefined): void;
|
|
31
|
+
}>();
|
|
34
32
|
|
|
35
|
-
const internalDate = ref<DateValue | undefined>(props.defaultValue)
|
|
36
|
-
const isControlled = computed(() => props.modelValue !== undefined)
|
|
33
|
+
const internalDate = ref<DateValue | undefined>(props.defaultValue);
|
|
34
|
+
const isControlled = computed(() => props.modelValue !== undefined);
|
|
37
35
|
|
|
38
36
|
const date = computed({
|
|
39
|
-
get: () =>
|
|
37
|
+
get: () =>
|
|
38
|
+
(isControlled.value ? props.modelValue : internalDate.value) as any,
|
|
40
39
|
set: (value: DateValue | undefined) => {
|
|
41
|
-
if (!isControlled.value)
|
|
42
|
-
internalDate.value = value
|
|
40
|
+
if (!isControlled.value) internalDate.value = value;
|
|
43
41
|
|
|
44
|
-
emits('update:modelValue', value)
|
|
42
|
+
emits('update:modelValue', value);
|
|
45
43
|
},
|
|
46
|
-
})
|
|
44
|
+
});
|
|
47
45
|
|
|
48
|
-
const defaultPlaceholder = computed(
|
|
46
|
+
const defaultPlaceholder = computed(
|
|
47
|
+
() => (date.value ?? today(getLocalTimeZone())) as any,
|
|
48
|
+
);
|
|
49
49
|
|
|
50
50
|
const formatter = new DateFormatter('en-US', {
|
|
51
51
|
dateStyle: 'long',
|
|
52
|
-
})
|
|
52
|
+
});
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
<template>
|
|
56
56
|
<Popover v-slot="{ close }">
|
|
57
57
|
<PopoverTrigger as-child>
|
|
58
|
-
<Button variant="secondary" :disabled="disabled" :class="cn(
|
|
58
|
+
<Button variant="secondary" :disabled="disabled" :class="cn(
|
|
59
|
+
'h-13 w-60 justify-start text-left font-normal enabled:active:scale-100',
|
|
60
|
+
!date && 'text-muted-foreground',
|
|
61
|
+
props.class,
|
|
62
|
+
)
|
|
63
|
+
">
|
|
59
64
|
<HugeiconsIcon :icon="Calendar03Icon" class="size-4" />
|
|
60
|
-
{{
|
|
65
|
+
{{
|
|
66
|
+
date
|
|
67
|
+
? formatter.format(date.toDate(getLocalTimeZone()))
|
|
68
|
+
: placeholder
|
|
69
|
+
}}
|
|
61
70
|
</Button>
|
|
62
71
|
</PopoverTrigger>
|
|
63
72
|
<PopoverContent :class="cn('w-auto p-0', props.contentClass)" align="start">
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as DatePicker } from './DatePicker.vue'
|
|
2
|
-
export { default } from './DatePicker.vue'
|
|
1
|
+
export { default as DatePicker } from './DatePicker.vue';
|
|
2
|
+
export { default } from './DatePicker.vue';
|
|
@@ -1,72 +1,74 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from 'vue'
|
|
3
|
-
import { fromDate, getLocalTimeZone, toCalendarDate } from '@internationalized/date'
|
|
4
|
-
import type { DateValue } from 'reka-ui'
|
|
5
|
-
import { computed, ref } from 'vue'
|
|
6
|
-
import { cn } from '../../../lib/utils'
|
|
7
|
-
import { DatePicker } from '../date-picker'
|
|
8
|
-
import { TimePicker } from '../time-picker'
|
|
9
|
-
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { fromDate, getLocalTimeZone, toCalendarDate, } from '@internationalized/date';
|
|
4
|
+
import type { DateValue } from 'reka-ui';
|
|
5
|
+
import { computed, ref } from 'vue';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { DatePicker } from '../date-picker';
|
|
8
|
+
import { TimePicker } from '../time-picker';
|
|
9
|
+
|
|
10
|
+
// Props
|
|
10
11
|
const props = withDefaults(defineProps<{
|
|
11
|
-
defaultValue?: Date | null
|
|
12
|
-
modelValue?: Date | null
|
|
13
|
-
minDate?: Date | null
|
|
14
|
-
maxDate?: Date | null
|
|
15
|
-
step?: string | number
|
|
16
|
-
disabled?: boolean
|
|
17
|
-
datePlaceholder?: string
|
|
18
|
-
class?: HTMLAttributes['class']
|
|
19
|
-
datePickerClass?: HTMLAttributes['class']
|
|
20
|
-
timePickerClass?: HTMLAttributes['class']
|
|
21
|
-
datePickerContentClass?: HTMLAttributes['class']
|
|
12
|
+
defaultValue?: Date | null;
|
|
13
|
+
modelValue?: Date | null;
|
|
14
|
+
minDate?: Date | null;
|
|
15
|
+
maxDate?: Date | null;
|
|
16
|
+
step?: string | number;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
datePlaceholder?: string;
|
|
19
|
+
class?: HTMLAttributes['class'];
|
|
20
|
+
datePickerClass?: HTMLAttributes['class'];
|
|
21
|
+
timePickerClass?: HTMLAttributes['class'];
|
|
22
|
+
datePickerContentClass?: HTMLAttributes['class'];
|
|
22
23
|
}>(), {
|
|
23
24
|
defaultValue: null,
|
|
24
25
|
minDate: null,
|
|
25
26
|
maxDate: null,
|
|
26
27
|
step: 60,
|
|
27
28
|
disabled: false,
|
|
28
|
-
datePlaceholder: 'Pick a date'
|
|
29
|
-
})
|
|
29
|
+
datePlaceholder: 'Pick a date'
|
|
30
|
+
});
|
|
30
31
|
|
|
32
|
+
// Emits
|
|
31
33
|
const emits = defineEmits<{
|
|
32
|
-
(e: 'update:modelValue', payload: Date | null): void
|
|
33
|
-
}>()
|
|
34
|
+
(e: 'update:modelValue', payload: Date | null): void;
|
|
35
|
+
}>();
|
|
34
36
|
|
|
35
|
-
const localTimeZone = getLocalTimeZone()
|
|
36
|
-
const internalValue = ref<Date | null>(props.defaultValue)
|
|
37
|
-
const isControlled = computed(() => props.modelValue !== undefined)
|
|
37
|
+
const localTimeZone = getLocalTimeZone();
|
|
38
|
+
const internalValue = ref<Date | null>(props.defaultValue);
|
|
39
|
+
const isControlled = computed(() => props.modelValue !== undefined);
|
|
38
40
|
|
|
39
41
|
const value = computed({
|
|
40
|
-
get: () =>
|
|
42
|
+
get: () =>
|
|
43
|
+
(isControlled.value ? props.modelValue : internalValue.value) ?? null,
|
|
41
44
|
set: (nextValue: Date | null) => {
|
|
42
|
-
const resolvedValue = clampDate(nextValue)
|
|
45
|
+
const resolvedValue = clampDate(nextValue);
|
|
43
46
|
|
|
44
|
-
if (!isControlled.value)
|
|
45
|
-
internalValue.value = resolvedValue
|
|
47
|
+
if (!isControlled.value) internalValue.value = resolvedValue;
|
|
46
48
|
|
|
47
|
-
emits('update:modelValue', resolvedValue)
|
|
49
|
+
emits('update:modelValue', resolvedValue);
|
|
48
50
|
},
|
|
49
|
-
})
|
|
51
|
+
});
|
|
50
52
|
|
|
51
|
-
const toPickerDateValue = (
|
|
53
|
+
const toPickerDateValue = (
|
|
54
|
+
date: Date | null | undefined,
|
|
55
|
+
): DateValue | undefined => {
|
|
52
56
|
if (!(date instanceof Date) || Number.isNaN(date.getTime()))
|
|
53
|
-
return undefined
|
|
57
|
+
return undefined;
|
|
54
58
|
|
|
55
|
-
return toCalendarDate(fromDate(date, localTimeZone))
|
|
56
|
-
}
|
|
59
|
+
return toCalendarDate(fromDate(date, localTimeZone));
|
|
60
|
+
};
|
|
57
61
|
|
|
58
62
|
const toTimeString = (date: Date | null | undefined) => {
|
|
59
|
-
if (!(date instanceof Date) || Number.isNaN(date.getTime()))
|
|
60
|
-
return ''
|
|
63
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) return '';
|
|
61
64
|
|
|
62
|
-
return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}
|
|
63
|
-
}
|
|
65
|
+
return `${String(date.getHours()).padStart(2, '0')}:${String(date.getMinutes()).padStart(2, '0')}`;
|
|
66
|
+
};
|
|
64
67
|
|
|
65
68
|
const buildDate = (dateValue: DateValue | undefined, timeValue: string) => {
|
|
66
|
-
if (!dateValue)
|
|
67
|
-
return null
|
|
69
|
+
if (!dateValue) return null;
|
|
68
70
|
|
|
69
|
-
const [hours = '0', minutes = '0'] = (timeValue || '00:00').split(':')
|
|
71
|
+
const [hours = '0', minutes = '0'] = (timeValue || '00:00').split(':');
|
|
70
72
|
const nextDate = new Date(
|
|
71
73
|
dateValue.year,
|
|
72
74
|
dateValue.month - 1,
|
|
@@ -75,96 +77,98 @@ const buildDate = (dateValue: DateValue | undefined, timeValue: string) => {
|
|
|
75
77
|
Number(minutes),
|
|
76
78
|
0,
|
|
77
79
|
0,
|
|
78
|
-
)
|
|
80
|
+
);
|
|
79
81
|
|
|
80
|
-
return Number.isNaN(nextDate.getTime()) ? null : nextDate
|
|
81
|
-
}
|
|
82
|
+
return Number.isNaN(nextDate.getTime()) ? null : nextDate;
|
|
83
|
+
};
|
|
82
84
|
|
|
83
|
-
const areSameCalendarDay = (
|
|
84
|
-
|
|
85
|
-
|
|
85
|
+
const areSameCalendarDay = (
|
|
86
|
+
left: DateValue | undefined,
|
|
87
|
+
right: DateValue | undefined,
|
|
88
|
+
) => {
|
|
89
|
+
if (!left || !right) return false;
|
|
86
90
|
|
|
87
|
-
return
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
+
return (
|
|
92
|
+
left.year === right.year &&
|
|
93
|
+
left.month === right.month &&
|
|
94
|
+
left.day === right.day
|
|
95
|
+
);
|
|
96
|
+
};
|
|
91
97
|
|
|
92
98
|
const clampDate = (date: Date | null) => {
|
|
93
|
-
if (!date)
|
|
94
|
-
return null
|
|
99
|
+
if (!date) return null;
|
|
95
100
|
|
|
96
101
|
if (props.minDate && date.getTime() < props.minDate.getTime())
|
|
97
|
-
return new Date(props.minDate)
|
|
102
|
+
return new Date(props.minDate);
|
|
98
103
|
|
|
99
104
|
if (props.maxDate && date.getTime() > props.maxDate.getTime())
|
|
100
|
-
return new Date(props.maxDate)
|
|
105
|
+
return new Date(props.maxDate);
|
|
101
106
|
|
|
102
|
-
return date
|
|
103
|
-
}
|
|
107
|
+
return date;
|
|
108
|
+
};
|
|
104
109
|
|
|
105
|
-
const getFallbackDate = () =>
|
|
110
|
+
const getFallbackDate = () =>
|
|
111
|
+
value.value ?? props.minDate ?? props.maxDate ?? new Date();
|
|
106
112
|
|
|
107
113
|
const dateValue = computed({
|
|
108
114
|
get: () => toPickerDateValue(value.value),
|
|
109
115
|
set: (nextDateValue: DateValue | undefined) => {
|
|
110
116
|
if (!nextDateValue) {
|
|
111
|
-
value.value = null
|
|
112
|
-
return
|
|
117
|
+
value.value = null;
|
|
118
|
+
return;
|
|
113
119
|
}
|
|
114
120
|
|
|
115
|
-
const fallbackTime = toTimeString(
|
|
116
|
-
|
|
121
|
+
const fallbackTime = toTimeString(
|
|
122
|
+
value.value ?? props.minDate ?? props.maxDate,
|
|
123
|
+
);
|
|
124
|
+
value.value = buildDate(nextDateValue, fallbackTime);
|
|
117
125
|
},
|
|
118
|
-
})
|
|
126
|
+
});
|
|
119
127
|
|
|
120
128
|
const timeValue = computed({
|
|
121
129
|
get: () => toTimeString(value.value),
|
|
122
130
|
set: (nextTimeValue: string) => {
|
|
123
|
-
value.value = buildDate(
|
|
131
|
+
value.value = buildDate(
|
|
132
|
+
toPickerDateValue(getFallbackDate()),
|
|
133
|
+
nextTimeValue || toTimeString(getFallbackDate()),
|
|
134
|
+
);
|
|
124
135
|
},
|
|
125
|
-
})
|
|
136
|
+
});
|
|
126
137
|
|
|
127
|
-
const minDateValue = computed(() => toPickerDateValue(props.minDate))
|
|
128
|
-
const maxDateValue = computed(() => toPickerDateValue(props.maxDate))
|
|
138
|
+
const minDateValue = computed(() => toPickerDateValue(props.minDate));
|
|
139
|
+
const maxDateValue = computed(() => toPickerDateValue(props.maxDate));
|
|
129
140
|
|
|
130
141
|
const minTimeValue = computed(() => {
|
|
131
|
-
const selectedDate = dateValue.value
|
|
132
|
-
const minimumDate = minDateValue.value
|
|
142
|
+
const selectedDate = dateValue.value;
|
|
143
|
+
const minimumDate = minDateValue.value;
|
|
133
144
|
|
|
134
|
-
return areSameCalendarDay(selectedDate, minimumDate)
|
|
135
|
-
|
|
145
|
+
return areSameCalendarDay(selectedDate, minimumDate)
|
|
146
|
+
? toTimeString(props.minDate)
|
|
147
|
+
: undefined;
|
|
148
|
+
});
|
|
136
149
|
|
|
137
150
|
const maxTimeValue = computed(() => {
|
|
138
|
-
const selectedDate = dateValue.value
|
|
139
|
-
const maximumDate = maxDateValue.value
|
|
151
|
+
const selectedDate = dateValue.value;
|
|
152
|
+
const maximumDate = maxDateValue.value;
|
|
140
153
|
|
|
141
|
-
return areSameCalendarDay(selectedDate, maximumDate)
|
|
142
|
-
|
|
154
|
+
return areSameCalendarDay(selectedDate, maximumDate)
|
|
155
|
+
? toTimeString(props.maxDate)
|
|
156
|
+
: undefined;
|
|
157
|
+
});
|
|
143
158
|
</script>
|
|
144
159
|
|
|
145
160
|
<template>
|
|
146
|
-
<div :class="cn(
|
|
161
|
+
<div :class="cn(
|
|
162
|
+
'grid grid-cols-1 gap-3 md:grid-cols-[minmax(0,1.35fr)_minmax(0,1fr)]',
|
|
163
|
+
props.class,
|
|
164
|
+
)
|
|
165
|
+
">
|
|
147
166
|
<div>
|
|
148
|
-
<DatePicker
|
|
149
|
-
v-model="dateValue"
|
|
150
|
-
:disabled="props.disabled"
|
|
151
|
-
:placeholder="props.datePlaceholder"
|
|
152
|
-
:min-value="minDateValue"
|
|
153
|
-
:max-value="maxDateValue"
|
|
154
|
-
:class="cn('w-full', props.datePickerClass)"
|
|
155
|
-
:content-class="props.datePickerContentClass"
|
|
156
|
-
/>
|
|
167
|
+
<DatePicker v-model="dateValue" :disabled="props.disabled" :placeholder="props.datePlaceholder" :min-value="minDateValue" :max-value="maxDateValue" :class="cn('w-full', props.datePickerClass)" :content-class="props.datePickerContentClass" />
|
|
157
168
|
</div>
|
|
158
169
|
|
|
159
170
|
<div>
|
|
160
|
-
<TimePicker
|
|
161
|
-
v-model="timeValue"
|
|
162
|
-
:disabled="props.disabled"
|
|
163
|
-
:step="props.step"
|
|
164
|
-
:min="minTimeValue"
|
|
165
|
-
:max="maxTimeValue"
|
|
166
|
-
:class="cn('w-full', props.timePickerClass)"
|
|
167
|
-
/>
|
|
171
|
+
<TimePicker v-model="timeValue" :disabled="props.disabled" :step="props.step" :min="minTimeValue" :max="maxTimeValue" :class="cn('w-full', props.timePickerClass)" />
|
|
168
172
|
</div>
|
|
169
173
|
</div>
|
|
170
174
|
</template>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default as DateTimePicker } from './DateTimePicker.vue'
|
|
2
|
-
export { default } from './DateTimePicker.vue'
|
|
1
|
+
export { default as DateTimePicker } from './DateTimePicker.vue';
|
|
2
|
+
export { default } from './DateTimePicker.vue';
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { DialogRootEmits, DialogRootProps } from
|
|
3
|
-
import { DialogRoot, useForwardPropsEmits } from
|
|
2
|
+
import type { DialogRootEmits, DialogRootProps } from 'reka-ui';
|
|
3
|
+
import { DialogRoot, useForwardPropsEmits } from 'reka-ui';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
const
|
|
5
|
+
// Props
|
|
6
|
+
const props = defineProps<DialogRootProps>();
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Emits
|
|
9
|
+
const emits = defineEmits<DialogRootEmits>();
|
|
10
|
+
|
|
11
|
+
const forwarded = useForwardPropsEmits(props, emits);
|
|
9
12
|
</script>
|
|
10
13
|
|
|
11
14
|
<template>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</template>
|
|
15
|
+
<DialogRoot v-slot="slotProps" data-slot="dialog" v-bind="forwarded">
|
|
16
|
+
<slot v-bind="slotProps" />
|
|
17
|
+
</DialogRoot>
|
|
18
|
+
</template>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { DialogCloseProps } from
|
|
3
|
-
import { DialogClose } from
|
|
2
|
+
import type { DialogCloseProps } from 'reka-ui';
|
|
3
|
+
import { DialogClose } from 'reka-ui';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// Props
|
|
6
|
+
const props = defineProps<DialogCloseProps>();
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<template>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<slot />
|
|
14
|
-
</DialogClose>
|
|
15
|
-
</template>
|
|
10
|
+
<DialogClose data-slot="dialog-close" v-bind="props">
|
|
11
|
+
<slot />
|
|
12
|
+
</DialogClose>
|
|
13
|
+
</template>
|
|
@@ -1,54 +1,48 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { DialogContentEmits, DialogContentProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
useForwardPropsEmits,
|
|
10
|
-
} from "reka-ui"
|
|
11
|
-
import { cn } from "../../../lib/utils"
|
|
12
|
-
import { Button } from "../button"
|
|
13
|
-
import DialogOverlay from "./DialogOverlay.vue"
|
|
2
|
+
import type { DialogContentEmits, DialogContentProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { DialogClose, DialogContent, DialogPortal, useForwardPropsEmits } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { Button } from '../button';
|
|
8
|
+
import DialogOverlay from './DialogOverlay.vue';
|
|
14
9
|
|
|
15
10
|
defineOptions({
|
|
16
|
-
|
|
17
|
-
})
|
|
11
|
+
inheritAttrs: false
|
|
12
|
+
});
|
|
18
13
|
|
|
14
|
+
// Props
|
|
19
15
|
const props = withDefaults(defineProps<DialogContentProps & {
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
class?: HTMLAttributes['class'];
|
|
17
|
+
showCloseButton?: boolean;
|
|
22
18
|
}>(), {
|
|
23
|
-
|
|
24
|
-
})
|
|
25
|
-
const emits = defineEmits<DialogContentEmits>()
|
|
19
|
+
showCloseButton: false
|
|
20
|
+
});
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
// Emits
|
|
23
|
+
const emits = defineEmits<DialogContentEmits>();
|
|
28
24
|
|
|
29
|
-
const
|
|
25
|
+
const delegatedProps = reactiveOmit(props, 'class');
|
|
26
|
+
|
|
27
|
+
const forwarded = useForwardPropsEmits(delegatedProps, emits);
|
|
30
28
|
</script>
|
|
31
29
|
|
|
32
30
|
<template>
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
props.class,
|
|
42
|
-
)"
|
|
43
|
-
>
|
|
44
|
-
<slot />
|
|
31
|
+
<DialogPortal>
|
|
32
|
+
<DialogOverlay />
|
|
33
|
+
<DialogContent data-slot="dialog-content" v-bind="{ ...$attrs, ...forwarded }" :class="cn(
|
|
34
|
+
'bg-card text-card-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded border border-border p-6 outline-none duration-200 sm:max-w-106.25',
|
|
35
|
+
props.class
|
|
36
|
+
)
|
|
37
|
+
">
|
|
38
|
+
<slot />
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</template>
|
|
40
|
+
<DialogClose v-if="props.showCloseButton" data-slot="dialog-close" as-child>
|
|
41
|
+
<Button variant="ghost" size="icon-sm" class="absolute top-4 right-4 p-0.5">
|
|
42
|
+
<span aria-hidden="true">X</span>
|
|
43
|
+
<span class="sr-only">Close</span>
|
|
44
|
+
</Button>
|
|
45
|
+
</DialogClose>
|
|
46
|
+
</DialogContent>
|
|
47
|
+
</DialogPortal>
|
|
48
|
+
</template>
|
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { DialogDescriptionProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { DialogDescription, useForwardProps } from
|
|
6
|
-
import { cn } from
|
|
2
|
+
import type { DialogDescriptionProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { DialogDescription, useForwardProps } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
// Props
|
|
9
|
+
const props = defineProps<DialogDescriptionProps & { 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
|
-
|
|
17
|
+
<DialogDescription data-slot="dialog-description" v-bind="forwardedProps" :class="cn(
|
|
18
|
+
'text-xs sm:text-sm leading-5 text-muted-foreground',
|
|
19
|
+
props.class
|
|
20
|
+
)
|
|
21
|
+
">
|
|
22
|
+
<slot />
|
|
23
|
+
</DialogDescription>
|
|
19
24
|
</template>
|