@vestow/vue 0.1.0
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 +233 -0
- package/index.ts +8 -0
- package/package.json +68 -0
- package/src/components/accordion/Accordion.vue +45 -0
- package/src/components/accordion/AccordionContent.vue +31 -0
- package/src/components/accordion/AccordionItem.vue +26 -0
- package/src/components/accordion/AccordionTrigger.vue +39 -0
- package/src/components/accordion/index.ts +18 -0
- package/src/components/alert/Alert.vue +17 -0
- package/src/components/alert/AlertDescription.vue +12 -0
- package/src/components/alert/AlertTitle.vue +12 -0
- package/src/components/alert/index.ts +5 -0
- package/src/components/avatar/Avatar.vue +32 -0
- package/src/components/avatar/AvatarFallback.vue +23 -0
- package/src/components/avatar/AvatarImage.vue +18 -0
- package/src/components/avatar/index.ts +3 -0
- package/src/components/badge/Badge.vue +25 -0
- package/src/components/badge/index.ts +3 -0
- package/src/components/breadcrumb/Breadcrumb.vue +14 -0
- package/src/components/breadcrumb/BreadcrumbItem.vue +12 -0
- package/src/components/breadcrumb/BreadcrumbLink.vue +19 -0
- package/src/components/breadcrumb/BreadcrumbPage.vue +12 -0
- package/src/components/breadcrumb/BreadcrumbSeparator.vue +15 -0
- package/src/components/breadcrumb/index.ts +5 -0
- package/src/components/button/Button.vue +55 -0
- package/src/components/button/index.ts +3 -0
- package/src/components/button-group/ButtonGroup.vue +29 -0
- package/src/components/button-group/ButtonGroupSeparator.vue +30 -0
- package/src/components/button-group/ButtonGroupText.vue +29 -0
- package/src/components/button-group/SplitButton.vue +103 -0
- package/src/components/button-group/SplitButtonItems.vue +50 -0
- package/src/components/button-group/index.ts +34 -0
- package/src/components/calendar/Calendar.vue +120 -0
- package/src/components/calendar/RangeCalendar.vue +127 -0
- package/src/components/calendar/index.ts +2 -0
- package/src/components/card/Card.vue +12 -0
- package/src/components/card/CardAction.vue +12 -0
- package/src/components/card/CardContent.vue +12 -0
- package/src/components/card/CardDescription.vue +12 -0
- package/src/components/card/CardFooter.vue +12 -0
- package/src/components/card/CardHeader.vue +15 -0
- package/src/components/card/CardTitle.vue +12 -0
- package/src/components/card/index.ts +7 -0
- package/src/components/carousel/Carousel.vue +164 -0
- package/src/components/carousel/CarouselContent.vue +43 -0
- package/src/components/carousel/CarouselDots.vue +42 -0
- package/src/components/carousel/CarouselItem.vue +58 -0
- package/src/components/carousel/CarouselNext.vue +45 -0
- package/src/components/carousel/CarouselPrevious.vue +45 -0
- package/src/components/carousel/index.ts +44 -0
- package/src/components/cascade-select/CascadeSelect.vue +314 -0
- package/src/components/cascade-select/index.ts +11 -0
- package/src/components/chart/AreaChart.vue +201 -0
- package/src/components/chart/BarChart.vue +389 -0
- package/src/components/chart/ChartContainer.vue +127 -0
- package/src/components/chart/ChartCrosshair.vue +92 -0
- package/src/components/chart/ChartLegend.vue +63 -0
- package/src/components/chart/ChartTooltipCard.vue +49 -0
- package/src/components/chart/LineChart.vue +214 -0
- package/src/components/chart/PieChart.vue +280 -0
- package/src/components/chart/RadarChart.vue +291 -0
- package/src/components/chart/RadialChart.vue +354 -0
- package/src/components/chart/index.ts +30 -0
- package/src/components/chart/polar.ts +5 -0
- package/src/components/chart/tooltip.ts +5 -0
- package/src/components/chart/types.ts +52 -0
- package/src/components/chart/useChartSeries.ts +138 -0
- package/src/components/chart/xy-label.ts +5 -0
- package/src/components/checkbox/Checkbox.vue +81 -0
- package/src/components/checkbox/CheckboxField.vue +129 -0
- package/src/components/checkbox/CheckboxGroup.vue +62 -0
- package/src/components/checkbox/index.ts +21 -0
- package/src/components/chip/Chip.vue +73 -0
- package/src/components/chip/index.ts +3 -0
- package/src/components/code-block/CodeBlock.vue +100 -0
- package/src/components/code-block/index.ts +4 -0
- package/src/components/collapsible/Collapsible.vue +15 -0
- package/src/components/collapsible/CollapsibleContent.vue +26 -0
- package/src/components/collapsible/CollapsibleTrigger.vue +12 -0
- package/src/components/collapsible/index.ts +3 -0
- package/src/components/combobox/Combobox.vue +23 -0
- package/src/components/combobox/ComboboxAnchor.vue +20 -0
- package/src/components/combobox/ComboboxEmpty.vue +21 -0
- package/src/components/combobox/ComboboxGroup.vue +23 -0
- package/src/components/combobox/ComboboxInput.vue +32 -0
- package/src/components/combobox/ComboboxItem.vue +38 -0
- package/src/components/combobox/ComboboxList.vue +43 -0
- package/src/components/combobox/ComboboxSeparator.vue +18 -0
- package/src/components/combobox/ComboboxTrigger.vue +12 -0
- package/src/components/combobox/index.ts +9 -0
- package/src/components/command/Command.vue +54 -0
- package/src/components/command/CommandDialog.vue +41 -0
- package/src/components/command/CommandEmpty.vue +19 -0
- package/src/components/command/CommandGroup.vue +28 -0
- package/src/components/command/CommandInput.vue +25 -0
- package/src/components/command/CommandItem.vue +40 -0
- package/src/components/command/CommandList.vue +13 -0
- package/src/components/command/CommandSeparator.vue +11 -0
- package/src/components/command/CommandShortcut.vue +13 -0
- package/src/components/command/index.ts +34 -0
- package/src/components/command-block/CommandBlock.vue +90 -0
- package/src/components/command-block/index.ts +2 -0
- package/src/components/confirm-dialog/ConfirmDialog.vue +37 -0
- package/src/components/confirm-dialog/index.ts +1 -0
- package/src/components/confirm-popup/ConfirmPopup.vue +123 -0
- package/src/components/confirm-popup/index.ts +1 -0
- package/src/components/context-menu/ContextMenu.vue +15 -0
- package/src/components/context-menu/ContextMenuCheckboxItem.vue +30 -0
- package/src/components/context-menu/ContextMenuContent.vue +36 -0
- package/src/components/context-menu/ContextMenuGroup.vue +12 -0
- package/src/components/context-menu/ContextMenuItem.vue +32 -0
- package/src/components/context-menu/ContextMenuLabel.vue +21 -0
- package/src/components/context-menu/ContextMenuRadioGroup.vue +15 -0
- package/src/components/context-menu/ContextMenuRadioItem.vue +30 -0
- package/src/components/context-menu/ContextMenuSeparator.vue +19 -0
- package/src/components/context-menu/ContextMenuShortcut.vue +13 -0
- package/src/components/context-menu/ContextMenuSub.vue +15 -0
- package/src/components/context-menu/ContextMenuSubContent.vue +26 -0
- package/src/components/context-menu/ContextMenuSubTrigger.vue +26 -0
- package/src/components/context-menu/ContextMenuTrigger.vue +12 -0
- package/src/components/context-menu/index.ts +14 -0
- package/src/components/data-table/DataTable.vue +458 -0
- package/src/components/data-table/DataTableFacetedFilter.vue +97 -0
- package/src/components/data-table/DataTablePagination.vue +103 -0
- package/src/components/data-table/DataTableViewOptions.vue +69 -0
- package/src/components/data-table/features.ts +87 -0
- package/src/components/data-table/index.ts +27 -0
- package/src/components/data-table/pagination-adapter.ts +67 -0
- package/src/components/data-table/selection-column.ts +48 -0
- package/src/components/data-table/types.ts +36 -0
- package/src/components/data-view/DataView.vue +136 -0
- package/src/components/data-view/index.ts +1 -0
- package/src/components/date-picker/DatePicker.vue +117 -0
- package/src/components/date-picker/DateRangePicker.vue +122 -0
- package/src/components/date-picker/index.ts +2 -0
- package/src/components/deferred/Deferred.vue +80 -0
- package/src/components/deferred/index.ts +1 -0
- package/src/components/dialog/Dialog.vue +15 -0
- package/src/components/dialog/DialogClose.vue +12 -0
- package/src/components/dialog/DialogContent.vue +46 -0
- package/src/components/dialog/DialogDescription.vue +19 -0
- package/src/components/dialog/DialogFooter.vue +12 -0
- package/src/components/dialog/DialogHeader.vue +12 -0
- package/src/components/dialog/DialogTitle.vue +19 -0
- package/src/components/dialog/DialogTrigger.vue +12 -0
- package/src/components/dialog/index.ts +10 -0
- package/src/components/doc-example/DocExample.vue +41 -0
- package/src/components/doc-example/index.ts +1 -0
- package/src/components/doc-text/DocText.vue +64 -0
- package/src/components/doc-text/index.ts +1 -0
- package/src/components/dropdown-menu/DropdownMenu.vue +15 -0
- package/src/components/dropdown-menu/DropdownMenuCheckboxItem.vue +33 -0
- package/src/components/dropdown-menu/DropdownMenuContent.vue +36 -0
- package/src/components/dropdown-menu/DropdownMenuGroup.vue +12 -0
- package/src/components/dropdown-menu/DropdownMenuItem.vue +32 -0
- package/src/components/dropdown-menu/DropdownMenuLabel.vue +24 -0
- package/src/components/dropdown-menu/DropdownMenuRadioGroup.vue +15 -0
- package/src/components/dropdown-menu/DropdownMenuRadioItem.vue +33 -0
- package/src/components/dropdown-menu/DropdownMenuSeparator.vue +19 -0
- package/src/components/dropdown-menu/DropdownMenuShortcut.vue +13 -0
- package/src/components/dropdown-menu/DropdownMenuSub.vue +15 -0
- package/src/components/dropdown-menu/DropdownMenuSubContent.vue +29 -0
- package/src/components/dropdown-menu/DropdownMenuSubTrigger.vue +26 -0
- package/src/components/dropdown-menu/DropdownMenuTrigger.vue +12 -0
- package/src/components/dropdown-menu/index.ts +14 -0
- package/src/components/editable/Editable.vue +41 -0
- package/src/components/editable/EditableArea.vue +22 -0
- package/src/components/editable/EditableCancelTrigger.vue +40 -0
- package/src/components/editable/EditableEditTrigger.vue +40 -0
- package/src/components/editable/EditableInput.vue +28 -0
- package/src/components/editable/EditablePreview.vue +34 -0
- package/src/components/editable/EditableSubmitTrigger.vue +40 -0
- package/src/components/editable/index.ts +17 -0
- package/src/components/empty/Empty.vue +17 -0
- package/src/components/empty/EmptyActions.vue +14 -0
- package/src/components/empty/EmptyDescription.vue +12 -0
- package/src/components/empty/EmptyMedia.vue +16 -0
- package/src/components/empty/EmptyTitle.vue +17 -0
- package/src/components/empty/index.ts +7 -0
- package/src/components/field/Field.vue +22 -0
- package/src/components/field/FieldDescription.vue +20 -0
- package/src/components/field/FieldGroup.vue +22 -0
- package/src/components/field/FieldLabel.vue +27 -0
- package/src/components/field/FieldSeparator.vue +28 -0
- package/src/components/field/index.ts +7 -0
- package/src/components/fieldset/Fieldset.vue +126 -0
- package/src/components/fieldset/index.ts +1 -0
- package/src/components/file-upload/FileUpload.vue +149 -0
- package/src/components/file-upload/index.ts +8 -0
- package/src/components/float-label/FloatLabel.vue +26 -0
- package/src/components/float-label/index.ts +3 -0
- package/src/components/form/Form.vue +126 -0
- package/src/components/form/FormDescription.vue +12 -0
- package/src/components/form/FormField.vue +127 -0
- package/src/components/form/FormItem.vue +12 -0
- package/src/components/form/FormLabel.vue +14 -0
- package/src/components/form/FormMessage.vue +31 -0
- package/src/components/form/context.ts +54 -0
- package/src/components/form/errors.ts +6 -0
- package/src/components/form/index.ts +7 -0
- package/src/components/form/types.ts +55 -0
- package/src/components/hover-card/HoverCard.vue +27 -0
- package/src/components/hover-card/HoverCardContent.vue +36 -0
- package/src/components/hover-card/HoverCardTrigger.vue +12 -0
- package/src/components/hover-card/index.ts +3 -0
- package/src/components/ifta-label/IftaLabel.vue +26 -0
- package/src/components/ifta-label/index.ts +1 -0
- package/src/components/index.ts +89 -0
- package/src/components/input/Input.vue +87 -0
- package/src/components/input/index.ts +1 -0
- package/src/components/input-color/ColorArea.vue +36 -0
- package/src/components/input-color/ColorField.vue +32 -0
- package/src/components/input-color/ColorSlider.vue +31 -0
- package/src/components/input-color/InputColor.vue +65 -0
- package/src/components/input-color/index.ts +16 -0
- package/src/components/input-group/InputGroup.vue +26 -0
- package/src/components/input-group/InputGroupAddon.vue +32 -0
- package/src/components/input-group/InputGroupInput.vue +33 -0
- package/src/components/input-group/index.ts +17 -0
- package/src/components/input-number/InputNumber.vue +82 -0
- package/src/components/input-number/index.ts +1 -0
- package/src/components/input-otp/InputOtp.vue +186 -0
- package/src/components/input-otp/index.ts +1 -0
- package/src/components/input-password/InputPassword.vue +116 -0
- package/src/components/input-password/index.ts +5 -0
- package/src/components/input-tags/InputTags.vue +38 -0
- package/src/components/input-tags/InputTagsClear.vue +39 -0
- package/src/components/input-tags/InputTagsInput.vue +27 -0
- package/src/components/input-tags/InputTagsItem.vue +40 -0
- package/src/components/input-tags/InputTagsItemDelete.vue +32 -0
- package/src/components/input-tags/InputTagsItemText.vue +18 -0
- package/src/components/input-tags/index.ts +16 -0
- package/src/components/kbd/Kbd.vue +17 -0
- package/src/components/kbd/KbdGroup.vue +15 -0
- package/src/components/kbd/index.ts +4 -0
- package/src/components/label/Label.vue +23 -0
- package/src/components/label/index.ts +1 -0
- package/src/components/listbox/Listbox.vue +42 -0
- package/src/components/listbox/ListboxContent.vue +22 -0
- package/src/components/listbox/ListboxFilter.vue +34 -0
- package/src/components/listbox/ListboxGroup.vue +31 -0
- package/src/components/listbox/ListboxItem.vue +46 -0
- package/src/components/listbox/index.ts +19 -0
- package/src/components/mask/Mask.vue +205 -0
- package/src/components/mask/index.ts +15 -0
- package/src/components/menubar/Menubar.vue +26 -0
- package/src/components/menubar/MenubarCheckboxItem.vue +30 -0
- package/src/components/menubar/MenubarContent.vue +52 -0
- package/src/components/menubar/MenubarGroup.vue +12 -0
- package/src/components/menubar/MenubarItem.vue +32 -0
- package/src/components/menubar/MenubarLabel.vue +21 -0
- package/src/components/menubar/MenubarMenu.vue +12 -0
- package/src/components/menubar/MenubarRadioGroup.vue +15 -0
- package/src/components/menubar/MenubarRadioItem.vue +30 -0
- package/src/components/menubar/MenubarSeparator.vue +12 -0
- package/src/components/menubar/MenubarShortcut.vue +13 -0
- package/src/components/menubar/MenubarSub.vue +15 -0
- package/src/components/menubar/MenubarSubContent.vue +26 -0
- package/src/components/menubar/MenubarSubTrigger.vue +26 -0
- package/src/components/menubar/MenubarTrigger.vue +30 -0
- package/src/components/menubar/index.ts +29 -0
- package/src/components/navigation-menu/NavigationMenu.vue +43 -0
- package/src/components/navigation-menu/NavigationMenuContent.vue +63 -0
- package/src/components/navigation-menu/NavigationMenuIndicator.vue +31 -0
- package/src/components/navigation-menu/NavigationMenuItem.vue +20 -0
- package/src/components/navigation-menu/NavigationMenuLink.vue +34 -0
- package/src/components/navigation-menu/NavigationMenuList.vue +23 -0
- package/src/components/navigation-menu/NavigationMenuTrigger.vue +38 -0
- package/src/components/navigation-menu/NavigationMenuViewport.vue +34 -0
- package/src/components/navigation-menu/index.ts +18 -0
- package/src/components/order-list/OrderList.vue +168 -0
- package/src/components/order-list/SelectableList.vue +200 -0
- package/src/components/order-list/index.ts +1 -0
- package/src/components/pagination/Pagination.vue +133 -0
- package/src/components/pagination/index.ts +1 -0
- package/src/components/panel/Panel.vue +69 -0
- package/src/components/panel/index.ts +1 -0
- package/src/components/pick-list/PickList.vue +211 -0
- package/src/components/pick-list/index.ts +1 -0
- package/src/components/popover/Popover.vue +15 -0
- package/src/components/popover/PopoverAnchor.vue +12 -0
- package/src/components/popover/PopoverContent.vue +39 -0
- package/src/components/popover/PopoverTrigger.vue +12 -0
- package/src/components/popover/index.ts +4 -0
- package/src/components/progress/Progress.vue +39 -0
- package/src/components/progress/index.ts +1 -0
- package/src/components/props-table/PropsTable.vue +62 -0
- package/src/components/props-table/index.ts +2 -0
- package/src/components/radio-group/RadioGroup.vue +52 -0
- package/src/components/radio-group/RadioGroupItem.vue +80 -0
- package/src/components/radio-group/RadioGroupItemField.vue +128 -0
- package/src/components/radio-group/index.ts +21 -0
- package/src/components/rating/Rating.vue +70 -0
- package/src/components/rating/RatingItem.vue +26 -0
- package/src/components/rating/RatingItemIndicator.vue +28 -0
- package/src/components/rating/RatingStar.vue +16 -0
- package/src/components/rating/index.ts +13 -0
- package/src/components/scroll-area/ScrollArea.vue +52 -0
- package/src/components/scroll-area/index.ts +1 -0
- package/src/components/search-input/SearchInput.vue +46 -0
- package/src/components/search-input/index.ts +1 -0
- package/src/components/select/Select.vue +15 -0
- package/src/components/select/SelectContent.vue +67 -0
- package/src/components/select/SelectGroup.vue +20 -0
- package/src/components/select/SelectItem.vue +59 -0
- package/src/components/select/SelectLabel.vue +20 -0
- package/src/components/select/SelectSeparator.vue +18 -0
- package/src/components/select/SelectTrigger.vue +101 -0
- package/src/components/select/SelectValue.vue +46 -0
- package/src/components/select/index.ts +8 -0
- package/src/components/separator/Separator.vue +25 -0
- package/src/components/separator/index.ts +1 -0
- package/src/components/sheet/Sheet.vue +15 -0
- package/src/components/sheet/SheetClose.vue +12 -0
- package/src/components/sheet/SheetContent.vue +45 -0
- package/src/components/sheet/SheetDescription.vue +19 -0
- package/src/components/sheet/SheetFooter.vue +12 -0
- package/src/components/sheet/SheetHeader.vue +12 -0
- package/src/components/sheet/SheetTitle.vue +19 -0
- package/src/components/sheet/SheetTrigger.vue +12 -0
- package/src/components/sheet/index.ts +10 -0
- package/src/components/sidebar/Sidebar.vue +108 -0
- package/src/components/sidebar/SidebarContent.vue +19 -0
- package/src/components/sidebar/SidebarFooter.vue +19 -0
- package/src/components/sidebar/SidebarGroup.vue +19 -0
- package/src/components/sidebar/SidebarGroupAction.vue +28 -0
- package/src/components/sidebar/SidebarGroupContent.vue +19 -0
- package/src/components/sidebar/SidebarGroupLabel.vue +25 -0
- package/src/components/sidebar/SidebarHeader.vue +19 -0
- package/src/components/sidebar/SidebarInput.vue +15 -0
- package/src/components/sidebar/SidebarInset.vue +22 -0
- package/src/components/sidebar/SidebarMenu.vue +19 -0
- package/src/components/sidebar/SidebarMenuAction.vue +41 -0
- package/src/components/sidebar/SidebarMenuBadge.vue +24 -0
- package/src/components/sidebar/SidebarMenuButton.vue +94 -0
- package/src/components/sidebar/SidebarMenuItem.vue +19 -0
- package/src/components/sidebar/SidebarMenuSkeleton.vue +36 -0
- package/src/components/sidebar/SidebarMenuSub.vue +22 -0
- package/src/components/sidebar/SidebarMenuSubButton.vue +39 -0
- package/src/components/sidebar/SidebarMenuSubItem.vue +19 -0
- package/src/components/sidebar/SidebarProvider.vue +114 -0
- package/src/components/sidebar/SidebarRail.vue +37 -0
- package/src/components/sidebar/SidebarSeparator.vue +15 -0
- package/src/components/sidebar/SidebarTrigger.vue +27 -0
- package/src/components/sidebar/context.ts +39 -0
- package/src/components/sidebar/index.ts +34 -0
- package/src/components/skeleton/Skeleton.vue +10 -0
- package/src/components/skeleton/index.ts +1 -0
- package/src/components/skip-link/SkipLink.vue +45 -0
- package/src/components/skip-link/index.ts +1 -0
- package/src/components/slider/Slider.vue +57 -0
- package/src/components/slider/index.ts +3 -0
- package/src/components/speed-dial/SpeedDial.vue +362 -0
- package/src/components/speed-dial/index.ts +28 -0
- package/src/components/spinner/Spinner.vue +20 -0
- package/src/components/spinner/index.ts +1 -0
- package/src/components/splitter/Splitter.vue +24 -0
- package/src/components/splitter/SplitterHandle.vue +51 -0
- package/src/components/splitter/SplitterPanel.vue +30 -0
- package/src/components/splitter/index.ts +14 -0
- package/src/components/stepper/Stepper.vue +34 -0
- package/src/components/stepper/StepperItem.vue +113 -0
- package/src/components/stepper/index.ts +2 -0
- package/src/components/switch/Switch.vue +35 -0
- package/src/components/switch/index.ts +1 -0
- package/src/components/table/Table.vue +24 -0
- package/src/components/table/TableBody.vue +12 -0
- package/src/components/table/TableCell.vue +12 -0
- package/src/components/table/TableEmpty.vue +20 -0
- package/src/components/table/TableHead.vue +17 -0
- package/src/components/table/TableHeader.vue +12 -0
- package/src/components/table/TableRow.vue +19 -0
- package/src/components/table/index.ts +7 -0
- package/src/components/tabs/Tabs.vue +23 -0
- package/src/components/tabs/TabsContent.vue +23 -0
- package/src/components/tabs/TabsList.vue +26 -0
- package/src/components/tabs/TabsTrigger.vue +30 -0
- package/src/components/tabs/index.ts +4 -0
- package/src/components/textarea/Textarea.vue +25 -0
- package/src/components/textarea/index.ts +1 -0
- package/src/components/theme-controls/LocaleMenu.vue +95 -0
- package/src/components/theme-controls/PaletteMenu.vue +155 -0
- package/src/components/theme-controls/ThemeToggle.vue +21 -0
- package/src/components/theme-controls/index.ts +15 -0
- package/src/components/timeline/Timeline.vue +20 -0
- package/src/components/timeline/TimelineItem.vue +68 -0
- package/src/components/timeline/index.ts +15 -0
- package/src/components/toast/Toaster.vue +62 -0
- package/src/components/toast/index.ts +4 -0
- package/src/components/toast/toast.ts +57 -0
- package/src/components/toggle/Toggle.vue +32 -0
- package/src/components/toggle/ToggleGroup.vue +56 -0
- package/src/components/toggle/ToggleGroupItem.vue +33 -0
- package/src/components/toggle/index.ts +18 -0
- package/src/components/token-table/TokenTable.vue +67 -0
- package/src/components/token-table/index.ts +2 -0
- package/src/components/toolbar/Toolbar.vue +34 -0
- package/src/components/toolbar/ToolbarButton.vue +33 -0
- package/src/components/toolbar/ToolbarSeparator.vue +21 -0
- package/src/components/toolbar/index.ts +3 -0
- package/src/components/tooltip/Tooltip.vue +15 -0
- package/src/components/tooltip/TooltipContent.vue +38 -0
- package/src/components/tooltip/TooltipProvider.vue +16 -0
- package/src/components/tooltip/TooltipTrigger.vue +12 -0
- package/src/components/tooltip/index.ts +4 -0
- package/src/components/tree/Tree.vue +53 -0
- package/src/components/tree/TreeItem.vue +59 -0
- package/src/components/tree/index.ts +21 -0
- package/src/components/tree-select/TreeSelect.vue +141 -0
- package/src/components/tree-select/index.ts +1 -0
- package/src/components/tree-table/TreeTable.vue +302 -0
- package/src/components/tree-table/features.ts +49 -0
- package/src/components/tree-table/index.ts +3 -0
- package/src/components/video-player/VideoPlayer.vue +472 -0
- package/src/components/video-player/index.ts +20 -0
- package/src/composables/index.ts +15 -0
- package/src/composables/useBase.ts +32 -0
- package/src/composables/useChartPalette.ts +33 -0
- package/src/composables/useColorMode.ts +29 -0
- package/src/composables/useConfirm.ts +81 -0
- package/src/composables/useDelayedFlag.ts +62 -0
- package/src/composables/useI18n.ts +107 -0
- package/src/composables/useIsMobile.ts +34 -0
- package/src/composables/useMenuAccent.ts +32 -0
- package/src/composables/useMenuAppearance.ts +31 -0
- package/src/composables/useMenuColor.ts +31 -0
- package/src/composables/usePalette.ts +30 -0
- package/src/composables/useStyle.ts +35 -0
- package/src/composables/useSurface.ts +30 -0
- package/src/composables/useTableQuery.ts +73 -0
- package/src/composables/useThemeController.ts +48 -0
- package/src/i18n/README.md +68 -0
- package/src/i18n/controller.ts +233 -0
- package/src/i18n/dictionary.ts +43 -0
- package/src/i18n/index.ts +34 -0
- package/src/i18n/registry.ts +64 -0
- package/src/i18n/ui/en/ui.json +114 -0
- package/src/i18n/ui/en/zod.json +16 -0
- package/src/i18n/ui/index.ts +48 -0
- package/src/i18n/ui/vi/ui.json +114 -0
- package/src/i18n/ui/vi/zod.json +16 -0
- package/src/lib/date.ts +24 -0
- package/src/lib/focus.ts +12 -0
- package/src/lib/icons.ts +345 -0
- package/src/lib/menu-styles.ts +16 -0
- package/src/lib/menu.ts +20 -0
- package/src/lib/platform.ts +5 -0
- package/src/lib/types.ts +6 -0
- package/src/lib/utils.ts +9 -0
- package/src/lib/zod-messages.ts +127 -0
- package/src/styles/chart.css +30 -0
- package/src/styles/index.css +18 -0
- package/src/variants/README.md +55 -0
- package/src/variants/components/accordion.ts +71 -0
- package/src/variants/components/alert.ts +20 -0
- package/src/variants/components/badge.ts +76 -0
- package/src/variants/components/button-group.ts +136 -0
- package/src/variants/components/button.ts +160 -0
- package/src/variants/components/checkbox.ts +67 -0
- package/src/variants/components/chip.ts +51 -0
- package/src/variants/components/code-block.ts +22 -0
- package/src/variants/components/dialog.ts +28 -0
- package/src/variants/components/empty.ts +60 -0
- package/src/variants/components/field.ts +35 -0
- package/src/variants/components/float-label.ts +95 -0
- package/src/variants/components/input-group.ts +73 -0
- package/src/variants/components/input-password.ts +68 -0
- package/src/variants/components/kbd.ts +47 -0
- package/src/variants/components/picker-trigger.ts +30 -0
- package/src/variants/components/radio-group.ts +63 -0
- package/src/variants/components/sheet.ts +23 -0
- package/src/variants/components/sidebar.ts +33 -0
- package/src/variants/components/slider.ts +49 -0
- package/src/variants/components/timeline.ts +45 -0
- package/src/variants/components/toggle.ts +58 -0
- package/src/variants/index.ts +35 -0
- package/src/variants/lib/chart/polar.ts +139 -0
- package/src/variants/lib/chart/tooltip.ts +101 -0
- package/src/variants/lib/chart/types.ts +172 -0
- package/src/variants/lib/chart/xy-label.ts +42 -0
- package/src/variants/lib/focus.ts +66 -0
- package/src/variants/lib/form-errors.ts +59 -0
- package/src/variants/lib/highlight.ts +548 -0
- package/src/variants/lib/list-move.ts +63 -0
- package/src/variants/lib/mask.ts +106 -0
- package/src/variants/lib/media.ts +56 -0
- package/src/variants/lib/menu-styles.ts +71 -0
- package/src/variants/lib/platform.ts +68 -0
- package/src/variants/lib/tree.ts +119 -0
- package/src/variants/lib/upload.ts +58 -0
- package/src/variants/lib/utils.ts +11 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarItemEmits, MenubarItemProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { MenubarItem, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { menuInsetClass, menuItemClass } from '../../lib/menu-styles'
|
|
7
|
+
import { cn } from '../../lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<MenubarItemProps & ClassProps & {
|
|
10
|
+
/** Item hành động nguy hiểm: xoá, thu hồi quyền... */
|
|
11
|
+
variant?: 'default' | 'destructive'
|
|
12
|
+
inset?: boolean
|
|
13
|
+
}>()
|
|
14
|
+
const emits = defineEmits<MenubarItemEmits>()
|
|
15
|
+
|
|
16
|
+
const delegated = computed(() => {
|
|
17
|
+
const { class: _class, variant: _variant, inset: _inset, ...rest } = props
|
|
18
|
+
return rest
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<MenubarItem
|
|
26
|
+
v-bind="forwarded"
|
|
27
|
+
:data-variant="props.variant"
|
|
28
|
+
:class="cn(menuItemClass, props.inset && menuInsetClass, props.class)"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</MenubarItem>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarLabelProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { MenubarLabel } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { menuInsetClass, menuLabelClass } from '../../lib/menu-styles'
|
|
7
|
+
import { cn } from '../../lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<MenubarLabelProps & ClassProps & { inset?: boolean }>()
|
|
10
|
+
|
|
11
|
+
const delegated = computed(() => {
|
|
12
|
+
const { class: _class, inset: _inset, ...rest } = props
|
|
13
|
+
return rest
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<MenubarLabel v-bind="delegated" :class="cn(menuLabelClass, props.inset && menuInsetClass, props.class)">
|
|
19
|
+
<slot />
|
|
20
|
+
</MenubarLabel>
|
|
21
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarMenuProps } from 'reka-ui'
|
|
3
|
+
import { MenubarMenu } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<MenubarMenuProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<MenubarMenu v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</MenubarMenu>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarRadioGroupEmits, MenubarRadioGroupProps } from 'reka-ui'
|
|
3
|
+
import { MenubarRadioGroup, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<MenubarRadioGroupProps>()
|
|
6
|
+
const emits = defineEmits<MenubarRadioGroupEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<MenubarRadioGroup v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</MenubarRadioGroup>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarRadioItemEmits, MenubarRadioItemProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { MenubarItemIndicator, MenubarRadioItem, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { Circle } from '../../lib/icons'
|
|
7
|
+
import { menuIndicatorItemClass, menuIndicatorSlotClass } from '../../lib/menu-styles'
|
|
8
|
+
import { cn } from '../../lib/utils'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<MenubarRadioItemProps & ClassProps>()
|
|
11
|
+
const emits = defineEmits<MenubarRadioItemEmits>()
|
|
12
|
+
|
|
13
|
+
const delegated = computed(() => {
|
|
14
|
+
const { class: _class, ...rest } = props
|
|
15
|
+
return rest
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<MenubarRadioItem v-bind="forwarded" :class="cn(menuIndicatorItemClass, props.class)">
|
|
23
|
+
<span :class="menuIndicatorSlotClass">
|
|
24
|
+
<MenubarItemIndicator>
|
|
25
|
+
<Circle class="size-2 fill-current" />
|
|
26
|
+
</MenubarItemIndicator>
|
|
27
|
+
</span>
|
|
28
|
+
<slot />
|
|
29
|
+
</MenubarRadioItem>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ClassProps } from '../../lib/types'
|
|
3
|
+
import { MenubarSeparator } from 'reka-ui'
|
|
4
|
+
import { menuSeparatorClass } from '../../lib/menu-styles'
|
|
5
|
+
import { cn } from '../../lib/utils'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<ClassProps>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<MenubarSeparator :class="cn(menuSeparatorClass, props.class)" />
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ClassProps } from '../../lib/types'
|
|
3
|
+
import { menuShortcutClass } from '../../lib/menu-styles'
|
|
4
|
+
import { cn } from '../../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<ClassProps>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<span :class="cn(menuShortcutClass, props.class)">
|
|
11
|
+
<slot />
|
|
12
|
+
</span>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarSubEmits, MenubarSubProps } from 'reka-ui'
|
|
3
|
+
import { MenubarSub, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<MenubarSubProps>()
|
|
6
|
+
const emits = defineEmits<MenubarSubEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<MenubarSub v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</MenubarSub>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarSubContentEmits, MenubarSubContentProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { MenubarPortal, MenubarSubContent, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { menuSubContentClass } from '../../lib/menu-styles'
|
|
7
|
+
import { cn } from '../../lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<MenubarSubContentProps & ClassProps>()
|
|
10
|
+
const emits = defineEmits<MenubarSubContentEmits>()
|
|
11
|
+
|
|
12
|
+
const delegated = computed(() => {
|
|
13
|
+
const { class: _class, ...rest } = props
|
|
14
|
+
return rest
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<MenubarPortal>
|
|
22
|
+
<MenubarSubContent v-bind="forwarded" :class="cn(menuSubContentClass, props.class)">
|
|
23
|
+
<slot />
|
|
24
|
+
</MenubarSubContent>
|
|
25
|
+
</MenubarPortal>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarSubTriggerProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { MenubarSubTrigger } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { ChevronRight } from '../../lib/icons'
|
|
7
|
+
import { menuInsetClass, menuSubTriggerClass } from '../../lib/menu-styles'
|
|
8
|
+
import { cn } from '../../lib/utils'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<MenubarSubTriggerProps & ClassProps & { inset?: boolean }>()
|
|
11
|
+
|
|
12
|
+
const delegated = computed(() => {
|
|
13
|
+
const { class: _class, inset: _inset, ...rest } = props
|
|
14
|
+
return rest
|
|
15
|
+
})
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<MenubarSubTrigger
|
|
20
|
+
v-bind="delegated"
|
|
21
|
+
:class="cn(menuSubTriggerClass, props.inset && menuInsetClass, props.class)"
|
|
22
|
+
>
|
|
23
|
+
<slot />
|
|
24
|
+
<ChevronRight class="ml-auto text-muted-foreground" />
|
|
25
|
+
</MenubarSubTrigger>
|
|
26
|
+
</template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenubarTriggerProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { MenubarTrigger } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<MenubarTriggerProps & ClassProps>()
|
|
9
|
+
|
|
10
|
+
const delegated = computed(() => {
|
|
11
|
+
const { class: _class, ...rest } = props
|
|
12
|
+
return rest
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<!-- Nút trên thanh, KHÔNG dùng `menuItemClass`: mục trong menu cao 28px và trải
|
|
18
|
+
hết bề ngang tấm menu, còn nút ở đây ôm sát chữ và nằm ngang hàng nhau. -->
|
|
19
|
+
<MenubarTrigger
|
|
20
|
+
v-bind="delegated"
|
|
21
|
+
:class="cn(
|
|
22
|
+
'flex select-none items-center rounded-sm px-2 py-1 text-sm font-medium outline-none',
|
|
23
|
+
'focus:bg-accent focus:text-accent-foreground',
|
|
24
|
+
'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
|
|
25
|
+
props.class,
|
|
26
|
+
)"
|
|
27
|
+
>
|
|
28
|
+
<slot />
|
|
29
|
+
</MenubarTrigger>
|
|
30
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thanh menu ngang kiểu ứng dụng desktop: File / Edit / View.
|
|
3
|
+
*
|
|
4
|
+
* Khác `DropdownMenu` ở **điều hướng bàn phím theo chiều ngang**, không phải ở
|
|
5
|
+
* diện mạo: mở một menu rồi bấm mũi tên trái/phải là nhảy thẳng sang menu kế
|
|
6
|
+
* bên, và khi một menu đang mở thì chỉ cần rê chuột qua nút khác là menu đó mở
|
|
7
|
+
* theo. Mấy `DropdownMenu` đặt cạnh nhau không làm được — mỗi cái là một cây
|
|
8
|
+
* roving focus riêng, không biết gì về hàng xóm.
|
|
9
|
+
*
|
|
10
|
+
* Phần *nội dung* thì dùng lại y nguyên `lib/menu-styles.ts` cùng với
|
|
11
|
+
* `DropdownMenu` và `ContextMenu`. Chỉ `Menubar` và `MenubarTrigger` có class
|
|
12
|
+
* riêng, vì chỉ hai cái đó thuộc về cái thanh chứ không thuộc về tấm menu.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export { default as Menubar } from './Menubar.vue'
|
|
16
|
+
export { default as MenubarCheckboxItem } from './MenubarCheckboxItem.vue'
|
|
17
|
+
export { default as MenubarContent } from './MenubarContent.vue'
|
|
18
|
+
export { default as MenubarGroup } from './MenubarGroup.vue'
|
|
19
|
+
export { default as MenubarItem } from './MenubarItem.vue'
|
|
20
|
+
export { default as MenubarLabel } from './MenubarLabel.vue'
|
|
21
|
+
export { default as MenubarMenu } from './MenubarMenu.vue'
|
|
22
|
+
export { default as MenubarRadioGroup } from './MenubarRadioGroup.vue'
|
|
23
|
+
export { default as MenubarRadioItem } from './MenubarRadioItem.vue'
|
|
24
|
+
export { default as MenubarSeparator } from './MenubarSeparator.vue'
|
|
25
|
+
export { default as MenubarShortcut } from './MenubarShortcut.vue'
|
|
26
|
+
export { default as MenubarSub } from './MenubarSub.vue'
|
|
27
|
+
export { default as MenubarSubContent } from './MenubarSubContent.vue'
|
|
28
|
+
export { default as MenubarSubTrigger } from './MenubarSubTrigger.vue'
|
|
29
|
+
export { default as MenubarTrigger } from './MenubarTrigger.vue'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuRootEmits, NavigationMenuRootProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuRoot, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
import NavigationMenuViewport from './NavigationMenuViewport.vue'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<NavigationMenuRootProps & ClassProps & {
|
|
11
|
+
/**
|
|
12
|
+
* Dựng chung MỘT khung cho mọi tấm nội dung.
|
|
13
|
+
*
|
|
14
|
+
* Bật (mặc định): khung nằm giữa thanh và trượt theo mục đang mở, cỡ đổi
|
|
15
|
+
* mượt — kiểu mega menu của trang giới thiệu.
|
|
16
|
+
*
|
|
17
|
+
* Tắt: mỗi tấm neo ngay dưới mục của nó. Hợp khi các tấm rộng bằng nhau
|
|
18
|
+
* hoặc khi thanh menu nằm trong một vùng đã cuộn được.
|
|
19
|
+
*/
|
|
20
|
+
viewport?: boolean
|
|
21
|
+
}>(),
|
|
22
|
+
{ viewport: true },
|
|
23
|
+
)
|
|
24
|
+
const emits = defineEmits<NavigationMenuRootEmits>()
|
|
25
|
+
|
|
26
|
+
const delegated = computed(() => {
|
|
27
|
+
const { class: _class, viewport: _viewport, ...rest } = props
|
|
28
|
+
return rest
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<NavigationMenuRoot
|
|
36
|
+
v-bind="forwarded"
|
|
37
|
+
:data-viewport="props.viewport"
|
|
38
|
+
:class="cn('group/navigation-menu relative flex max-w-max flex-1 items-center justify-center', props.class)"
|
|
39
|
+
>
|
|
40
|
+
<slot />
|
|
41
|
+
<NavigationMenuViewport v-if="props.viewport" />
|
|
42
|
+
</NavigationMenuRoot>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuContentEmits, NavigationMenuContentProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuContent, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<NavigationMenuContentProps & ClassProps>()
|
|
9
|
+
const emits = defineEmits<NavigationMenuContentEmits>()
|
|
10
|
+
|
|
11
|
+
const delegated = computed(() => {
|
|
12
|
+
const { class: _class, ...rest } = props
|
|
13
|
+
return rest
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
17
|
+
|
|
18
|
+
/*
|
|
19
|
+
* `data-motion` là thứ reka đặt để nói tấm này vào/ra từ phía nào — trái hay
|
|
20
|
+
* phải tuỳ mục vừa mở nằm bên nào so với mục cũ. Nhờ vậy chuyển giữa hai menu
|
|
21
|
+
* trông như trượt ngang một quãng, không phải hai lần hiện/ẩn rời rạc.
|
|
22
|
+
*/
|
|
23
|
+
const motion = [
|
|
24
|
+
'data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out',
|
|
25
|
+
'data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out',
|
|
26
|
+
'data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52',
|
|
27
|
+
'data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52',
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
/*
|
|
31
|
+
* Khi `viewport` tắt, tấm nội dung neo thẳng dưới mục của nó — lúc đó nó phải
|
|
32
|
+
* tự có nền, viền và bóng vì không còn khung chung nào lo hộ.
|
|
33
|
+
*
|
|
34
|
+
* Phải viết ĐỦ từng tên class ra đây, đừng ghép chuỗi lúc chạy: Tailwind v4
|
|
35
|
+
* quét **văn bản nguồn** tìm tên hoàn chỉnh, nên `prefix + name` không sinh ra
|
|
36
|
+
* class nào — không lỗi, chỉ là không có kiểu dáng.
|
|
37
|
+
*/
|
|
38
|
+
const detached = [
|
|
39
|
+
'group-data-[viewport=false]/navigation-menu:surface',
|
|
40
|
+
'group-data-[viewport=false]/navigation-menu:top-full',
|
|
41
|
+
'group-data-[viewport=false]/navigation-menu:mt-1.5',
|
|
42
|
+
'group-data-[viewport=false]/navigation-menu:overflow-hidden',
|
|
43
|
+
'group-data-[viewport=false]/navigation-menu:rounded-md',
|
|
44
|
+
'group-data-[viewport=false]/navigation-menu:border',
|
|
45
|
+
'group-data-[viewport=false]/navigation-menu:border-border',
|
|
46
|
+
'group-data-[viewport=false]/navigation-menu:bg-popover',
|
|
47
|
+
'group-data-[viewport=false]/navigation-menu:text-popover-foreground',
|
|
48
|
+
'group-data-[viewport=false]/navigation-menu:shadow-md',
|
|
49
|
+
'group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in',
|
|
50
|
+
'group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out',
|
|
51
|
+
'group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95',
|
|
52
|
+
'group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95',
|
|
53
|
+
]
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<template>
|
|
57
|
+
<NavigationMenuContent
|
|
58
|
+
v-bind="forwarded"
|
|
59
|
+
:class="cn('left-0 top-0 w-full p-2 md:absolute md:w-auto', motion, detached, props.class)"
|
|
60
|
+
>
|
|
61
|
+
<slot />
|
|
62
|
+
</NavigationMenuContent>
|
|
63
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuIndicatorProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuIndicator } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<NavigationMenuIndicatorProps & ClassProps>()
|
|
9
|
+
|
|
10
|
+
const delegated = computed(() => {
|
|
11
|
+
const { class: _class, ...rest } = props
|
|
12
|
+
return rest
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<!-- Mũi nhọn nối thanh với khung nội dung. Là một hình vuông xoay 45° rồi cắt
|
|
18
|
+
nửa dưới bằng `overflow-hidden` của vỏ — rẻ hơn vẽ tam giác bằng border. -->
|
|
19
|
+
<NavigationMenuIndicator
|
|
20
|
+
v-bind="delegated"
|
|
21
|
+
:class="cn(
|
|
22
|
+
'top-full z-(--z-base) flex h-1.5 items-end justify-center overflow-hidden',
|
|
23
|
+
'transition-[width,transform] duration-(--duration-base)',
|
|
24
|
+
'data-[state=visible]:animate-in data-[state=hidden]:animate-out',
|
|
25
|
+
'data-[state=visible]:fade-in data-[state=hidden]:fade-out',
|
|
26
|
+
props.class,
|
|
27
|
+
)"
|
|
28
|
+
>
|
|
29
|
+
<div class="relative top-[60%] size-2 rotate-45 rounded-tl-sm border-l border-t border-border bg-popover" />
|
|
30
|
+
</NavigationMenuIndicator>
|
|
31
|
+
</template>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuItemProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuItem } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<NavigationMenuItemProps & ClassProps>()
|
|
9
|
+
|
|
10
|
+
const delegated = computed(() => {
|
|
11
|
+
const { class: _class, ...rest } = props
|
|
12
|
+
return rest
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<NavigationMenuItem v-bind="delegated" :class="cn('relative', props.class)">
|
|
18
|
+
<slot />
|
|
19
|
+
</NavigationMenuItem>
|
|
20
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuLinkEmits, NavigationMenuLinkProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuLink, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<NavigationMenuLinkProps & ClassProps>()
|
|
9
|
+
const emits = defineEmits<NavigationMenuLinkEmits>()
|
|
10
|
+
|
|
11
|
+
const delegated = computed(() => {
|
|
12
|
+
const { class: _class, ...rest } = props
|
|
13
|
+
return rest
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<!-- `active` sinh ra `data-active` VÀ `aria-current="page"` — trang hiện tại
|
|
21
|
+
vì vậy được đọc lên chứ không chỉ được tô khác màu. -->
|
|
22
|
+
<NavigationMenuLink
|
|
23
|
+
v-bind="forwarded"
|
|
24
|
+
:class="cn(
|
|
25
|
+
'flex select-none flex-col gap-1 rounded-sm p-2 text-sm leading-snug no-underline outline-none transition-colors',
|
|
26
|
+
'hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground',
|
|
27
|
+
'data-[active]:bg-accent/50',
|
|
28
|
+
'[&_svg]:size-4 [&_svg]:shrink-0',
|
|
29
|
+
props.class,
|
|
30
|
+
)"
|
|
31
|
+
>
|
|
32
|
+
<slot />
|
|
33
|
+
</NavigationMenuLink>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuListProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuList } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<NavigationMenuListProps & ClassProps>()
|
|
9
|
+
|
|
10
|
+
const delegated = computed(() => {
|
|
11
|
+
const { class: _class, ...rest } = props
|
|
12
|
+
return rest
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<NavigationMenuList
|
|
18
|
+
v-bind="delegated"
|
|
19
|
+
:class="cn('group flex flex-1 list-none items-center justify-center gap-1', props.class)"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</NavigationMenuList>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuTriggerProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuTrigger } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { ChevronDown } from '../../lib/icons'
|
|
7
|
+
import { cn } from '../../lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = defineProps<NavigationMenuTriggerProps & ClassProps>()
|
|
10
|
+
|
|
11
|
+
const delegated = computed(() => {
|
|
12
|
+
const { class: _class, ...rest } = props
|
|
13
|
+
return rest
|
|
14
|
+
})
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<!-- Cùng khuôn với `MenubarTrigger`: nút trên một thanh, không phải mục trong
|
|
19
|
+
một tấm menu — nên nó ôm sát chữ chứ không trải hết bề ngang. -->
|
|
20
|
+
<NavigationMenuTrigger
|
|
21
|
+
v-bind="delegated"
|
|
22
|
+
:class="cn(
|
|
23
|
+
'group inline-flex h-9 w-max select-none items-center justify-center gap-1 rounded-md px-3 py-2 text-sm font-medium outline-none transition-colors',
|
|
24
|
+
'hover:bg-accent hover:text-accent-foreground',
|
|
25
|
+
'focus:bg-accent focus:text-accent-foreground',
|
|
26
|
+
'data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
|
|
27
|
+
'disabled:pointer-events-none disabled:opacity-50',
|
|
28
|
+
props.class,
|
|
29
|
+
)"
|
|
30
|
+
>
|
|
31
|
+
<slot />
|
|
32
|
+
<!-- `aria-hidden`: mũi tên chỉ nhắc lại `aria-expanded` mà nút đã báo. -->
|
|
33
|
+
<ChevronDown
|
|
34
|
+
class="relative top-px size-3.5 transition-transform duration-(--duration-base) group-data-[state=open]:rotate-180"
|
|
35
|
+
aria-hidden="true"
|
|
36
|
+
/>
|
|
37
|
+
</NavigationMenuTrigger>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NavigationMenuViewportProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { NavigationMenuViewport } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<NavigationMenuViewportProps & ClassProps>()
|
|
9
|
+
|
|
10
|
+
const delegated = computed(() => {
|
|
11
|
+
const { class: _class, ...rest } = props
|
|
12
|
+
return rest
|
|
13
|
+
})
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<!-- Vỏ ngoài `absolute` để tấm nội dung không đẩy trang xuống; `isolate` để
|
|
18
|
+
bóng đổ của nó không chui ra sau thanh menu. -->
|
|
19
|
+
<div class="absolute left-0 top-full isolate z-(--z-overlay) flex justify-center">
|
|
20
|
+
<NavigationMenuViewport
|
|
21
|
+
v-bind="delegated"
|
|
22
|
+
:class="cn(
|
|
23
|
+
'surface relative mt-1.5 origin-top overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md',
|
|
24
|
+
// Kích thước lấy từ tấm đang mở, nên khung co giãn theo nội dung thay vì
|
|
25
|
+
// giật một nhịp rồi mới đúng cỡ.
|
|
26
|
+
'h-[var(--reka-navigation-menu-viewport-height)] w-full md:w-[var(--reka-navigation-menu-viewport-width)]',
|
|
27
|
+
'transition-[width,height] duration-(--duration-base)',
|
|
28
|
+
'data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
29
|
+
'data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95',
|
|
30
|
+
props.class,
|
|
31
|
+
)"
|
|
32
|
+
/>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Thanh điều hướng ngang, mỗi mục xổ ra một tấm nội dung — thứ PrimeVue gọi là
|
|
3
|
+
* `MegaMenu`.
|
|
4
|
+
*
|
|
5
|
+
* Khác `Menubar` ở chỗ nó KHÔNG phải menu lệnh: nội dung là link có tiêu đề và
|
|
6
|
+
* mô tả, mở bằng cách rê chuột chứ không phải bấm, và ARIA của nó là điều hướng
|
|
7
|
+
* chứ không phải `menubar`. Chỗ của nó là đầu trang giới thiệu, không phải
|
|
8
|
+
* trong màn quản trị.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export { default as NavigationMenu } from './NavigationMenu.vue'
|
|
12
|
+
export { default as NavigationMenuContent } from './NavigationMenuContent.vue'
|
|
13
|
+
export { default as NavigationMenuIndicator } from './NavigationMenuIndicator.vue'
|
|
14
|
+
export { default as NavigationMenuItem } from './NavigationMenuItem.vue'
|
|
15
|
+
export { default as NavigationMenuLink } from './NavigationMenuLink.vue'
|
|
16
|
+
export { default as NavigationMenuList } from './NavigationMenuList.vue'
|
|
17
|
+
export { default as NavigationMenuTrigger } from './NavigationMenuTrigger.vue'
|
|
18
|
+
export { default as NavigationMenuViewport } from './NavigationMenuViewport.vue'
|