@brumaombra/ui-vintage 0.7.8 → 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 +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 +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/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,44 +1,45 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { Component } from
|
|
3
|
-
import type { SidebarMenuButtonProps } from
|
|
4
|
-
import { reactiveOmit } from
|
|
5
|
-
import { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip'
|
|
6
|
-
import SidebarMenuButtonChild from
|
|
7
|
-
import { useSidebar } from
|
|
2
|
+
import type { Component } from 'vue';
|
|
3
|
+
import type { SidebarMenuButtonProps } from './SidebarMenuButtonChild.vue';
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core';
|
|
5
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from '../tooltip';
|
|
6
|
+
import SidebarMenuButtonChild from './SidebarMenuButtonChild.vue';
|
|
7
|
+
import { useSidebar } from './utils';
|
|
8
8
|
|
|
9
9
|
defineOptions({
|
|
10
|
-
|
|
11
|
-
})
|
|
10
|
+
inheritAttrs: false
|
|
11
|
+
});
|
|
12
12
|
|
|
13
|
+
// Props
|
|
13
14
|
const props = withDefaults(defineProps<SidebarMenuButtonProps & {
|
|
14
|
-
|
|
15
|
+
tooltip?: string | Component;
|
|
15
16
|
}>(), {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
17
|
+
as: 'button',
|
|
18
|
+
variant: 'default',
|
|
19
|
+
size: 'default'
|
|
20
|
+
});
|
|
20
21
|
|
|
21
|
-
const { isMobile, state } = useSidebar()
|
|
22
|
+
const { isMobile, state } = useSidebar();
|
|
22
23
|
|
|
23
|
-
const delegatedProps = reactiveOmit(props,
|
|
24
|
+
const delegatedProps = reactiveOmit(props, 'tooltip');
|
|
24
25
|
</script>
|
|
25
26
|
|
|
26
27
|
<template>
|
|
27
|
-
|
|
28
|
-
<slot />
|
|
29
|
-
</SidebarMenuButtonChild>
|
|
30
|
-
|
|
31
|
-
<Tooltip v-else>
|
|
32
|
-
<TooltipTrigger as-child>
|
|
33
|
-
<SidebarMenuButtonChild v-bind="{ ...delegatedProps, ...$attrs }">
|
|
28
|
+
<SidebarMenuButtonChild v-if="!tooltip" v-bind="{ ...delegatedProps, ...$attrs }">
|
|
34
29
|
<slot />
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
</SidebarMenuButtonChild>
|
|
31
|
+
|
|
32
|
+
<Tooltip v-else>
|
|
33
|
+
<TooltipTrigger as-child>
|
|
34
|
+
<SidebarMenuButtonChild v-bind="{ ...delegatedProps, ...$attrs }">
|
|
35
|
+
<slot />
|
|
36
|
+
</SidebarMenuButtonChild>
|
|
37
|
+
</TooltipTrigger>
|
|
38
|
+
<TooltipContent side="right" align="center" :hidden="state !== 'collapsed' || isMobile">
|
|
39
|
+
<template v-if="typeof tooltip === 'string'">
|
|
40
|
+
{{ tooltip }}
|
|
41
|
+
</template>
|
|
42
|
+
<component :is="tooltip" v-else />
|
|
43
|
+
</TooltipContent>
|
|
44
|
+
</Tooltip>
|
|
45
|
+
</template>
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { PrimitiveProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import type { SidebarMenuButtonVariants } from
|
|
5
|
-
import { Primitive } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { sidebarMenuButtonVariants } from
|
|
2
|
+
import type { PrimitiveProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import type { SidebarMenuButtonVariants } from '.';
|
|
5
|
+
import { Primitive } from 'reka-ui';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { sidebarMenuButtonVariants } from '.';
|
|
8
8
|
|
|
9
9
|
export interface SidebarMenuButtonProps extends PrimitiveProps {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
variant?: SidebarMenuButtonVariants['variant'];
|
|
11
|
+
size?: SidebarMenuButtonVariants['size'];
|
|
12
|
+
isActive?: boolean;
|
|
13
|
+
class?: HTMLAttributes['class'];
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
+
// Props
|
|
16
17
|
const props = withDefaults(defineProps<SidebarMenuButtonProps>(), {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
})
|
|
18
|
+
as: 'button',
|
|
19
|
+
variant: 'default',
|
|
20
|
+
size: 'default'
|
|
21
|
+
});
|
|
21
22
|
</script>
|
|
22
23
|
|
|
23
24
|
<template>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</template>
|
|
25
|
+
<Primitive data-slot="sidebar-menu-button" data-sidebar="menu-button" :data-size="size" :data-active="isActive" :class="cn(sidebarMenuButtonVariants({ variant, size }), props.class)" :as="as" :as-child="asChild" v-bind="$attrs">
|
|
26
|
+
<slot />
|
|
27
|
+
</Primitive>
|
|
28
|
+
</template>
|
|
@@ -1,14 +1,15 @@
|
|
|
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
|
-
</template>
|
|
12
|
+
<li data-slot="sidebar-menu-item" data-sidebar="menu-item" :class="cn('group/menu-item relative', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</li>
|
|
15
|
+
</template>
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from
|
|
3
|
-
import { cn } from
|
|
4
|
-
import { Skeleton } from '../skeleton'
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '../../../lib/utils';
|
|
4
|
+
import { Skeleton } from '../skeleton';
|
|
5
5
|
|
|
6
|
+
// Props
|
|
6
7
|
const props = defineProps<{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}>()
|
|
8
|
+
showIcon?: boolean;
|
|
9
|
+
class?: HTMLAttributes['class'];
|
|
10
|
+
}>();
|
|
10
11
|
|
|
11
|
-
const width =
|
|
12
|
+
const width = '72%';
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
15
|
<template>
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
<div data-slot="sidebar-menu-skeleton" data-sidebar="menu-skeleton" :class="cn(
|
|
17
|
+
'flex h-8 items-center gap-2 rounded-md px-2 group-data-[compact=true]/sidebar-wrapper:h-7 group-data-[compact=true]/sidebar-wrapper:gap-1.5 group-data-[compact=true]/sidebar-wrapper:px-1.5',
|
|
18
|
+
props.class
|
|
19
|
+
)
|
|
20
|
+
">
|
|
21
|
+
<Skeleton v-if="showIcon" class="size-4 rounded-md group-data-[compact=true]/sidebar-wrapper:size-3.5" data-sidebar="menu-skeleton-icon" />
|
|
17
22
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
</template>
|
|
23
|
+
<Skeleton class="h-4 max-w-(--skeleton-width) flex-1" data-sidebar="menu-skeleton-text" :style="{ '--skeleton-width': width }" />
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|
|
@@ -1,18 +1,20 @@
|
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
</
|
|
12
|
+
<ul data-slot="sidebar-menu-sub" data-sidebar="menu-badge" :class="cn(
|
|
13
|
+
'border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5',
|
|
14
|
+
'group-data-[collapsible=icon]:hidden',
|
|
15
|
+
props.class
|
|
16
|
+
)
|
|
17
|
+
">
|
|
18
|
+
<slot />
|
|
19
|
+
</ul>
|
|
20
|
+
</template>
|
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { PrimitiveProps } from
|
|
3
|
-
import type { HTMLAttributes } from
|
|
4
|
-
import { Primitive } from
|
|
5
|
-
import { cn } from
|
|
2
|
+
import type { PrimitiveProps } from 'reka-ui';
|
|
3
|
+
import type { HTMLAttributes } from 'vue';
|
|
4
|
+
import { Primitive } from 'reka-ui';
|
|
5
|
+
import { cn } from '../../../lib/utils';
|
|
6
6
|
|
|
7
|
+
// Props
|
|
7
8
|
const props = withDefaults(defineProps<PrimitiveProps & {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
size?: 'sm' | 'md';
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
class?: HTMLAttributes['class'];
|
|
11
12
|
}>(), {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
})
|
|
13
|
+
as: 'a',
|
|
14
|
+
size: 'md'
|
|
15
|
+
});
|
|
15
16
|
</script>
|
|
16
17
|
|
|
17
18
|
<template>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
<Primitive data-slot="sidebar-menu-sub-button" data-sidebar="menu-sub-button" :as="as" :as-child="asChild" :data-size="size" :data-active="isActive" :class="cn(
|
|
20
|
+
'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex min-h-7 min-w-0 -translate-x-px items-center gap-2 rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 group-data-[compact=true]/sidebar-wrapper:min-h-6 group-data-[compact=true]/sidebar-wrapper:gap-1.5 group-data-[compact=true]/sidebar-wrapper:px-1.5 group-data-[compact=true]/sidebar-wrapper:[&>svg]:size-3.5 [&>svg]:size-4 [&>svg]:shrink-0',
|
|
21
|
+
'data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground',
|
|
22
|
+
size === 'sm' && 'text-xs',
|
|
23
|
+
size === 'md' &&
|
|
24
|
+
'text-sm group-data-[compact=true]/sidebar-wrapper:text-xs',
|
|
25
|
+
'group-data-[collapsible=icon]:hidden',
|
|
26
|
+
props.class
|
|
27
|
+
)
|
|
28
|
+
">
|
|
29
|
+
<slot />
|
|
30
|
+
</Primitive>
|
|
31
|
+
</template>
|
|
@@ -1,14 +1,15 @@
|
|
|
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
|
-
</template>
|
|
12
|
+
<li data-slot="sidebar-menu-sub-item" data-sidebar="menu-sub-item" :class="cn('group/menu-sub-item relative', props.class)">
|
|
13
|
+
<slot />
|
|
14
|
+
</li>
|
|
15
|
+
</template>
|
|
@@ -1,79 +1,89 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes, Ref } from
|
|
3
|
-
import { defaultDocument, useEventListener, useMediaQuery, useVModel } from
|
|
4
|
-
import { TooltipProvider } from
|
|
5
|
-
import { computed, ref } from
|
|
6
|
-
import { cn } from
|
|
7
|
-
import { provideSidebarContext, SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON } from
|
|
2
|
+
import type { HTMLAttributes, Ref } from 'vue';
|
|
3
|
+
import { defaultDocument, useEventListener, useMediaQuery, useVModel } from '@vueuse/core';
|
|
4
|
+
import { TooltipProvider } from 'reka-ui';
|
|
5
|
+
import { computed, ref } from 'vue';
|
|
6
|
+
import { cn } from '../../../lib/utils';
|
|
7
|
+
import { provideSidebarContext, SIDEBAR_COOKIE_MAX_AGE, SIDEBAR_COOKIE_NAME, SIDEBAR_KEYBOARD_SHORTCUT, SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON } from './utils';
|
|
8
8
|
|
|
9
|
+
// Props
|
|
9
10
|
const props = withDefaults(defineProps<{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
open?: boolean;
|
|
13
|
+
compact?: boolean;
|
|
14
|
+
class?: HTMLAttributes['class'];
|
|
14
15
|
}>(), {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
})
|
|
16
|
+
defaultOpen: !defaultDocument?.cookie.includes(`${SIDEBAR_COOKIE_NAME}=false`),
|
|
17
|
+
open: undefined,
|
|
18
|
+
compact: false
|
|
19
|
+
});
|
|
19
20
|
|
|
21
|
+
// Emits
|
|
20
22
|
const emits = defineEmits<{
|
|
21
|
-
|
|
22
|
-
}>()
|
|
23
|
+
'update:open': [open: boolean];
|
|
24
|
+
}>();
|
|
23
25
|
|
|
24
|
-
const isMobile = useMediaQuery(
|
|
25
|
-
const openMobile = ref(false)
|
|
26
|
+
const isMobile = useMediaQuery('(max-width: 768px)');
|
|
27
|
+
const openMobile = ref(false);
|
|
26
28
|
|
|
27
|
-
const open = useVModel(props,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}) as Ref<boolean
|
|
29
|
+
const open = useVModel(props, 'open', emits, {
|
|
30
|
+
defaultValue: props.defaultOpen ?? false,
|
|
31
|
+
passive: (props.open === undefined) as false
|
|
32
|
+
}) as Ref<boolean>;
|
|
31
33
|
|
|
32
34
|
function setOpen(value: boolean) {
|
|
33
|
-
|
|
35
|
+
open.value = value; // emits('update:open', value)
|
|
34
36
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
+
// This sets the cookie to keep the sidebar state.
|
|
38
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${open.value}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
function setOpenMobile(value: boolean) {
|
|
40
|
-
|
|
42
|
+
openMobile.value = value;
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
// Helper to toggle the sidebar.
|
|
44
46
|
function toggleSidebar() {
|
|
45
|
-
|
|
47
|
+
return isMobile.value
|
|
48
|
+
? setOpenMobile(!openMobile.value)
|
|
49
|
+
: setOpen(!open.value);
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
useEventListener(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
useEventListener('keydown', (event: KeyboardEvent) => {
|
|
53
|
+
if (
|
|
54
|
+
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
55
|
+
(event.metaKey || event.ctrlKey)
|
|
56
|
+
) {
|
|
57
|
+
event.preventDefault();
|
|
58
|
+
toggleSidebar();
|
|
59
|
+
}
|
|
60
|
+
});
|
|
54
61
|
|
|
55
|
-
// We add a state so that we can do data-state="expanded" or "collapsed"
|
|
56
|
-
|
|
57
|
-
const state = computed(() => open.value ? "expanded" : "collapsed")
|
|
62
|
+
// We add a state so that we can do data-state="expanded" or "collapsed"
|
|
63
|
+
const state = computed(() => (open.value ? 'expanded' : 'collapsed'));
|
|
58
64
|
|
|
59
65
|
provideSidebarContext({
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
})
|
|
66
|
+
state,
|
|
67
|
+
open,
|
|
68
|
+
setOpen,
|
|
69
|
+
isMobile,
|
|
70
|
+
openMobile,
|
|
71
|
+
setOpenMobile,
|
|
72
|
+
toggleSidebar
|
|
73
|
+
});
|
|
68
74
|
</script>
|
|
69
75
|
|
|
70
76
|
<template>
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
<TooltipProvider :delay-duration="0">
|
|
78
|
+
<div data-slot="sidebar-wrapper" :style="{
|
|
79
|
+
'--sidebar-width': SIDEBAR_WIDTH,
|
|
80
|
+
'--sidebar-width-icon': SIDEBAR_WIDTH_ICON
|
|
81
|
+
}" :data-compact="props.compact ? 'true' : 'false'" :class="cn(
|
|
82
|
+
'group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full',
|
|
83
|
+
props.class
|
|
84
|
+
)
|
|
85
|
+
" v-bind="$attrs">
|
|
86
|
+
<slot />
|
|
87
|
+
</div>
|
|
88
|
+
</TooltipProvider>
|
|
89
|
+
</template>
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from
|
|
3
|
-
import { cn } from
|
|
4
|
-
import { useSidebar } from
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '../../../lib/utils';
|
|
4
|
+
import { useSidebar } from './utils';
|
|
5
5
|
|
|
6
|
+
// Props
|
|
6
7
|
const props = defineProps<{
|
|
7
|
-
|
|
8
|
-
}>()
|
|
8
|
+
class?: HTMLAttributes['class'];
|
|
9
|
+
}>();
|
|
9
10
|
|
|
10
|
-
const { toggleSidebar } = useSidebar()
|
|
11
|
+
const { toggleSidebar } = useSidebar();
|
|
11
12
|
</script>
|
|
12
13
|
|
|
13
14
|
<template>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
</
|
|
15
|
+
<button data-sidebar="rail" data-slot="sidebar-rail" aria-label="Toggle Sidebar" :tabindex="-1" title="Toggle Sidebar" :class="cn(
|
|
16
|
+
'hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-0.5 sm:flex',
|
|
17
|
+
'in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize',
|
|
18
|
+
'[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize',
|
|
19
|
+
'hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full',
|
|
20
|
+
'[[data-side=left][data-collapsible=offcanvas]_&]:-right-2',
|
|
21
|
+
'[[data-side=right][data-collapsible=offcanvas]_&]:-left-2',
|
|
22
|
+
props.class
|
|
23
|
+
)
|
|
24
|
+
" @click="toggleSidebar">
|
|
25
|
+
<slot />
|
|
26
|
+
</button>
|
|
27
|
+
</template>
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from
|
|
3
|
-
import { cn } from
|
|
4
|
-
import { Separator } from '../separator'
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { cn } from '../../../lib/utils';
|
|
4
|
+
import { Separator } from '../separator';
|
|
5
5
|
|
|
6
|
+
// Props
|
|
6
7
|
const props = defineProps<{
|
|
7
|
-
|
|
8
|
-
}>()
|
|
8
|
+
class?: HTMLAttributes['class'];
|
|
9
|
+
}>();
|
|
9
10
|
</script>
|
|
10
11
|
|
|
11
12
|
<template>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</template>
|
|
13
|
+
<Separator data-slot="sidebar-separator" data-sidebar="separator" :class="cn('bg-sidebar-border mx-2 w-auto', props.class)">
|
|
14
|
+
<slot />
|
|
15
|
+
</Separator>
|
|
16
|
+
</template>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type { HTMLAttributes } from
|
|
3
|
-
import { PanelLeftIcon } from
|
|
4
|
-
import { HugeiconsIcon } from
|
|
5
|
-
import { cn } from
|
|
6
|
-
import { Button } from '../button'
|
|
7
|
-
import { useSidebar } from
|
|
2
|
+
import type { HTMLAttributes } from 'vue';
|
|
3
|
+
import { PanelLeftIcon } from '@hugeicons/core-free-icons';
|
|
4
|
+
import { HugeiconsIcon } from '@hugeicons/vue';
|
|
5
|
+
import { cn } from '../../../lib/utils';
|
|
6
|
+
import { Button } from '../button';
|
|
7
|
+
import { useSidebar } from './utils';
|
|
8
8
|
|
|
9
|
+
// Props
|
|
9
10
|
const props = defineProps<{
|
|
10
|
-
|
|
11
|
-
}>()
|
|
11
|
+
class?: HTMLAttributes['class'];
|
|
12
|
+
}>();
|
|
12
13
|
|
|
13
|
-
const { toggleSidebar } = useSidebar()
|
|
14
|
+
const { toggleSidebar } = useSidebar();
|
|
14
15
|
</script>
|
|
15
16
|
|
|
16
17
|
<template>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</template>
|
|
18
|
+
<Button data-sidebar="trigger" data-slot="sidebar-trigger" variant="secondary" size="icon" :class="cn(props.class)" @click="toggleSidebar">
|
|
19
|
+
<HugeiconsIcon :icon="PanelLeftIcon" />
|
|
20
|
+
<span class="sr-only">Toggle Sidebar</span>
|
|
21
|
+
</Button>
|
|
22
|
+
</template>
|