@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,122 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DateValue } from '@internationalized/date'
|
|
3
|
+
import type { DateRange } from 'reka-ui'
|
|
4
|
+
import type { ClassProps } from '../../lib/types'
|
|
5
|
+
import { DateFormatter, getLocalTimeZone } from '@internationalized/date'
|
|
6
|
+
import { computed, ref } from 'vue'
|
|
7
|
+
import { useI18n } from '../../composables/useI18n'
|
|
8
|
+
import { invalidRingStatic } from '../../lib/focus'
|
|
9
|
+
import { CalendarIcon } from '../../lib/icons'
|
|
10
|
+
import { cn } from '../../lib/utils'
|
|
11
|
+
import { Button } from '../button'
|
|
12
|
+
import { RangeCalendar } from '../calendar'
|
|
13
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../popover'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Gốc của component là một provider KHÔNG vẽ ra DOM, nên thuộc tính rơi tự do
|
|
17
|
+
* không có chỗ đáp và biến mất hẳn. Đo được: đặt `id` lên component thì nó
|
|
18
|
+
* không xuất hiện ở bất kỳ đâu trong DOM, và `<Label for>` trỏ vào hư không.
|
|
19
|
+
*
|
|
20
|
+
* Chuyển tay xuống chính cái trigger.
|
|
21
|
+
*/
|
|
22
|
+
defineOptions({ inheritAttrs: false })
|
|
23
|
+
|
|
24
|
+
const props = withDefaults(
|
|
25
|
+
defineProps<ClassProps & {
|
|
26
|
+
placeholder?: string
|
|
27
|
+
locale?: string
|
|
28
|
+
dateStyle?: 'short' | 'medium' | 'long'
|
|
29
|
+
size?: 'sm' | 'default'
|
|
30
|
+
invalid?: boolean
|
|
31
|
+
disabled?: boolean
|
|
32
|
+
numberOfMonths?: number
|
|
33
|
+
minValue?: DateValue
|
|
34
|
+
maxValue?: DateValue
|
|
35
|
+
}>(),
|
|
36
|
+
{
|
|
37
|
+
dateStyle: 'medium',
|
|
38
|
+
size: 'default',
|
|
39
|
+
invalid: false,
|
|
40
|
+
disabled: false,
|
|
41
|
+
numberOfMonths: 2,
|
|
42
|
+
},
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
const { t, tag } = useI18n()
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Cả hai mặc định phải đi qua i18n, không đặt được trong `withDefaults`.
|
|
49
|
+
*
|
|
50
|
+
* `locale` cũng vậy chứ không riêng `placeholder`: chốt cứng 'vi-VN' thì đổi
|
|
51
|
+
* sang tiếng Anh xong nút vẫn hiện "31 tháng 8, 2026". Prop vẫn thắng khi có —
|
|
52
|
+
* hai picker trên cùng một trang được phép khác locale.
|
|
53
|
+
*/
|
|
54
|
+
const placeholder = computed(() => props.placeholder ?? t('ui.dateRangePicker.placeholder'))
|
|
55
|
+
const locale = computed(() => props.locale ?? tag.value)
|
|
56
|
+
|
|
57
|
+
const model = defineModel<DateRange>({ default: () => ({ start: undefined, end: undefined }) })
|
|
58
|
+
|
|
59
|
+
const open = ref(false)
|
|
60
|
+
|
|
61
|
+
const formatter = computed(() => new DateFormatter(locale.value, { dateStyle: props.dateStyle }))
|
|
62
|
+
|
|
63
|
+
function fmt(value: DateValue | undefined): string {
|
|
64
|
+
return value ? formatter.value.format(value.toDate(getLocalTimeZone())) : ''
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Chỉ có đầu khoảng thì vẫn hiện nó ra, kèm dấu gạch bỏ ngỏ.
|
|
69
|
+
*
|
|
70
|
+
* Người dùng vừa bấm ngày đầu xong đang chờ bấm ngày thứ hai; để nút trở về chữ
|
|
71
|
+
* gợi ý là mất luôn phản hồi cho thao tác vừa rồi.
|
|
72
|
+
*/
|
|
73
|
+
const label = computed(() => {
|
|
74
|
+
if (!model.value.start)
|
|
75
|
+
return placeholder.value
|
|
76
|
+
if (!model.value.end)
|
|
77
|
+
return `${fmt(model.value.start)} – …`
|
|
78
|
+
return `${fmt(model.value.start)} – ${fmt(model.value.end)}`
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// Chỉ đóng khi đã đủ HAI đầu; đóng sau ngày đầu là cắt ngang thao tác.
|
|
82
|
+
function onUpdate(value: DateRange): void {
|
|
83
|
+
model.value = value
|
|
84
|
+
if (value.start && value.end)
|
|
85
|
+
open.value = false
|
|
86
|
+
}
|
|
87
|
+
</script>
|
|
88
|
+
|
|
89
|
+
<template>
|
|
90
|
+
<Popover v-model:open="open">
|
|
91
|
+
<PopoverTrigger as-child>
|
|
92
|
+
<Button
|
|
93
|
+
v-bind="$attrs"
|
|
94
|
+
variant="outline"
|
|
95
|
+
:size="props.size === 'sm' ? 'sm' : 'lg'"
|
|
96
|
+
:disabled="props.disabled"
|
|
97
|
+
:aria-invalid="props.invalid || undefined"
|
|
98
|
+
:class="cn(
|
|
99
|
+
'w-full justify-start gap-2 font-normal',
|
|
100
|
+
!model.start && 'text-muted-foreground',
|
|
101
|
+
props.invalid && invalidRingStatic,
|
|
102
|
+
props.class,
|
|
103
|
+
)"
|
|
104
|
+
>
|
|
105
|
+
<CalendarIcon class="text-muted-foreground" />
|
|
106
|
+
{{ label }}
|
|
107
|
+
</Button>
|
|
108
|
+
</PopoverTrigger>
|
|
109
|
+
|
|
110
|
+
<PopoverContent class="w-auto p-0" align="start">
|
|
111
|
+
<RangeCalendar
|
|
112
|
+
:model-value="model"
|
|
113
|
+
:locale="locale"
|
|
114
|
+
:number-of-months="props.numberOfMonths"
|
|
115
|
+
:min-value="props.minValue"
|
|
116
|
+
:max-value="props.maxValue"
|
|
117
|
+
class="p-3"
|
|
118
|
+
@update:model-value="onUpdate"
|
|
119
|
+
/>
|
|
120
|
+
</PopoverContent>
|
|
121
|
+
</Popover>
|
|
122
|
+
</template>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ClassProps } from '../../lib/types'
|
|
3
|
+
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
|
4
|
+
import { cn } from '../../lib/utils'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(
|
|
7
|
+
defineProps<ClassProps & {
|
|
8
|
+
/**
|
|
9
|
+
* Nạp sớm bao nhiêu trước khi khối chạm mép màn hình.
|
|
10
|
+
*
|
|
11
|
+
* Cú pháp giống `margin` của CSS. Để `0px` thì nội dung chỉ bắt đầu hiện ra
|
|
12
|
+
* đúng lúc người ta cuộn tới, tức họ nhìn thấy chỗ trống trước — nạp sớm
|
|
13
|
+
* một màn hình thì gần như không ai kịp thấy.
|
|
14
|
+
*/
|
|
15
|
+
rootMargin?: string
|
|
16
|
+
/** Bao nhiêu phần của khối phải lộ ra thì mới tính là đã tới. */
|
|
17
|
+
threshold?: number
|
|
18
|
+
/** Nạp một lần rồi thôi theo dõi. Tắt đi thì nó báo mỗi lần vào lại tầm nhìn. */
|
|
19
|
+
once?: boolean
|
|
20
|
+
}>(),
|
|
21
|
+
{ rootMargin: '200px', threshold: 0, once: true },
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
const emit = defineEmits<{ load: [] }>()
|
|
25
|
+
|
|
26
|
+
const loaded = ref(false)
|
|
27
|
+
const anchor = ref<HTMLElement>()
|
|
28
|
+
|
|
29
|
+
let observer: IntersectionObserver | undefined
|
|
30
|
+
|
|
31
|
+
onMounted(() => {
|
|
32
|
+
const el = anchor.value
|
|
33
|
+
if (el === undefined)
|
|
34
|
+
return
|
|
35
|
+
|
|
36
|
+
// Không có API thì nạp luôn. Một khối không bao giờ hiện ra vì trình duyệt
|
|
37
|
+
// thiếu một cách quan sát là hỏng nặng hơn hẳn việc nạp sớm.
|
|
38
|
+
if (typeof IntersectionObserver === 'undefined') {
|
|
39
|
+
loaded.value = true
|
|
40
|
+
emit('load')
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
observer = new IntersectionObserver((entries) => {
|
|
45
|
+
for (const entry of entries) {
|
|
46
|
+
if (!entry.isIntersecting)
|
|
47
|
+
continue
|
|
48
|
+
|
|
49
|
+
loaded.value = true
|
|
50
|
+
emit('load')
|
|
51
|
+
|
|
52
|
+
if (props.once) {
|
|
53
|
+
observer?.disconnect()
|
|
54
|
+
observer = undefined
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}, { rootMargin: props.rootMargin, threshold: props.threshold })
|
|
58
|
+
|
|
59
|
+
observer.observe(el)
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
onBeforeUnmount(() => observer?.disconnect())
|
|
63
|
+
|
|
64
|
+
defineExpose({ loaded })
|
|
65
|
+
</script>
|
|
66
|
+
|
|
67
|
+
<template>
|
|
68
|
+
<!--
|
|
69
|
+
`IntersectionObserver` là đúng công cụ ở ĐÂY, dù CLAUDE.md có một mục nói
|
|
70
|
+
đừng dùng nó cho mục lục đang đọc.
|
|
71
|
+
|
|
72
|
+
Hai câu hỏi khác nhau: "khối này đã lộ ra chưa" là câu hỏi về MỘT phần tử và
|
|
73
|
+
có một câu trả lời rõ ràng; "đang đọc mục nào" là câu hỏi so sánh giữa nhiều
|
|
74
|
+
phần tử, mà giữa hai tiêu đề thì không cái nào đang giao với viewport cả.
|
|
75
|
+
-->
|
|
76
|
+
<div ref="anchor" :class="cn(props.class)">
|
|
77
|
+
<slot v-if="loaded" />
|
|
78
|
+
<slot v-else name="placeholder" />
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Deferred } from './Deferred.vue'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogRootEmits, DialogRootProps } from 'reka-ui'
|
|
3
|
+
import { DialogRoot, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogRootProps>()
|
|
6
|
+
const emits = defineEmits<DialogRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DialogRoot v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</DialogRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogCloseProps } from 'reka-ui'
|
|
3
|
+
import { DialogClose } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogCloseProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogClose v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DialogClose>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogContentEmits, DialogContentProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import type { DialogContentVariants } from './index'
|
|
5
|
+
import { DialogClose, DialogContent, DialogOverlay, DialogPortal, useForwardPropsEmits } from 'reka-ui'
|
|
6
|
+
import { computed } from 'vue'
|
|
7
|
+
import { useI18n } from '../../composables/useI18n'
|
|
8
|
+
import { X } from '../../lib/icons'
|
|
9
|
+
import { cn } from '../../lib/utils'
|
|
10
|
+
import { dialogContentVariants } from './index'
|
|
11
|
+
|
|
12
|
+
const props = withDefaults(
|
|
13
|
+
defineProps<DialogContentProps & ClassProps & {
|
|
14
|
+
size?: DialogContentVariants['size']
|
|
15
|
+
/** Ẩn nút X góc phải — dùng khi dialog bắt buộc chọn 1 hành động. */
|
|
16
|
+
hideClose?: boolean
|
|
17
|
+
}>(),
|
|
18
|
+
{ hideClose: false },
|
|
19
|
+
)
|
|
20
|
+
const emits = defineEmits<DialogContentEmits>()
|
|
21
|
+
const { t } = useI18n()
|
|
22
|
+
const delegated = computed(() => {
|
|
23
|
+
const { class: _class, size: _size, hideClose: _hideClose, ...rest } = props
|
|
24
|
+
return rest
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<DialogPortal>
|
|
32
|
+
<DialogOverlay
|
|
33
|
+
class="fixed inset-0 z-(--z-overlay) bg-foreground/40 backdrop-blur-[2px] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0"
|
|
34
|
+
/>
|
|
35
|
+
<DialogContent v-bind="forwarded" :class="cn(dialogContentVariants({ size }), props.class)">
|
|
36
|
+
<slot />
|
|
37
|
+
<DialogClose
|
|
38
|
+
v-if="!hideClose"
|
|
39
|
+
class="absolute right-4 top-4 rounded-sm p-1 text-muted-foreground opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none"
|
|
40
|
+
>
|
|
41
|
+
<X class="size-4" />
|
|
42
|
+
<span class="sr-only">{{ t('ui.close') }}</span>
|
|
43
|
+
</DialogClose>
|
|
44
|
+
</DialogContent>
|
|
45
|
+
</DialogPortal>
|
|
46
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogDescriptionProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { DialogDescription } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DialogDescriptionProps & ClassProps>()
|
|
9
|
+
const delegated = computed(() => {
|
|
10
|
+
const { class: _class, ...rest } = props
|
|
11
|
+
return rest
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<DialogDescription v-bind="delegated" :class="cn('text-sm text-muted-foreground', props.class)">
|
|
17
|
+
<slot />
|
|
18
|
+
</DialogDescription>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ClassProps } from '../../lib/types'
|
|
3
|
+
import { cn } from '../../lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<ClassProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div :class="cn('flex shrink-0 flex-col-reverse gap-2 border-t border-border px-6 py-4 sm:flex-row sm:justify-end', props.class)">
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ClassProps } from '../../lib/types'
|
|
3
|
+
import { cn } from '../../lib/utils'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<ClassProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div :class="cn('flex shrink-0 flex-col gap-1.5 border-b border-border px-6 py-4 pr-12', props.class)">
|
|
10
|
+
<slot />
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTitleProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { DialogTitle } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { cn } from '../../lib/utils'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<DialogTitleProps & ClassProps>()
|
|
9
|
+
const delegated = computed(() => {
|
|
10
|
+
const { class: _class, ...rest } = props
|
|
11
|
+
return rest
|
|
12
|
+
})
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<DialogTitle v-bind="delegated" :class="cn('text-base font-semibold leading-none tracking-tight', props.class)">
|
|
17
|
+
<slot />
|
|
18
|
+
</DialogTitle>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DialogTriggerProps } from 'reka-ui'
|
|
3
|
+
import { DialogTrigger } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DialogTriggerProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DialogTrigger v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DialogTrigger>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { dialogContentVariants, type DialogContentVariants } from '../../variants/components/dialog'
|
|
2
|
+
export { default as Dialog } from './Dialog.vue'
|
|
3
|
+
export { default as DialogClose } from './DialogClose.vue'
|
|
4
|
+
export { default as DialogContent } from './DialogContent.vue'
|
|
5
|
+
export { default as DialogDescription } from './DialogDescription.vue'
|
|
6
|
+
export { default as DialogFooter } from './DialogFooter.vue'
|
|
7
|
+
export { default as DialogHeader } from './DialogHeader.vue'
|
|
8
|
+
export { default as DialogTitle } from './DialogTitle.vue'
|
|
9
|
+
|
|
10
|
+
export { default as DialogTrigger } from './DialogTrigger.vue'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ClassProps } from '../../lib/types'
|
|
3
|
+
import type { Language } from '../../variants/lib/highlight'
|
|
4
|
+
import { cn } from '../../lib/utils'
|
|
5
|
+
import { CodeBlock } from '../code-block'
|
|
6
|
+
|
|
7
|
+
const props = withDefaults(
|
|
8
|
+
defineProps<ClassProps & {
|
|
9
|
+
code: string
|
|
10
|
+
language?: Language
|
|
11
|
+
/**
|
|
12
|
+
* Căn giữa theo chiều dọc. Ví dụ cao (bảng, biểu đồ) đặt `false` để nội
|
|
13
|
+
* dung bám mép trên — nhưng vẫn căn giữa theo chiều ngang.
|
|
14
|
+
*
|
|
15
|
+
* Căn ngang là việc của KHUNG chứ không phải của ví dụ: nó chỉ đặt cả khối
|
|
16
|
+
* vào giữa, không nói gì về cách xếp bên trong khối. Ví dụ nào rộng hết
|
|
17
|
+
* khung (`w-full`) thì `justify-center` ở đây không đổi gì, nên hàng nút
|
|
18
|
+
* vẫn phải tự khai `justify-center` của nó.
|
|
19
|
+
*/
|
|
20
|
+
center?: boolean
|
|
21
|
+
}>(),
|
|
22
|
+
{ language: 'vue', center: true },
|
|
23
|
+
)
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<!--
|
|
28
|
+
`overflow-hidden` để cắt hai góc dưới của CodeBlock: ở nhánh
|
|
29
|
+
`bordered=false` khối code chỉ có đường kẻ trên và không tự bo góc.
|
|
30
|
+
-->
|
|
31
|
+
<div :class="cn('relative overflow-hidden rounded-xl border border-border bg-card', props.class)">
|
|
32
|
+
<div
|
|
33
|
+
class="flex min-h-[260px] justify-center px-[22px] py-11"
|
|
34
|
+
:class="props.center ? 'items-center' : 'items-start'"
|
|
35
|
+
>
|
|
36
|
+
<slot />
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<CodeBlock :code="props.code" :language="props.language" :bordered="false" />
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DocExample } from './DocExample.vue'
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Render một đoạn mô tả trong tài liệu. Nhận đúng **hai** cú pháp:
|
|
6
|
+
*
|
|
7
|
+
* - `` `code` `` -> thẻ code
|
|
8
|
+
* - `**đậm**` -> in đậm
|
|
9
|
+
*
|
|
10
|
+
* Chỉ hai thứ đó, không phải markdown đầy đủ: mô tả prop và mô tả ví dụ không
|
|
11
|
+
* cần link, danh sách hay tiêu đề, mà thêm cả bộ parse markdown vào chỉ để in
|
|
12
|
+
* ra `size` là không đáng.
|
|
13
|
+
*
|
|
14
|
+
* Bản đầu chỉ có backtick, và `**đậm**` viết ra hiện nguyên hai dấu sao trên
|
|
15
|
+
* trang — ba trang component đã dính trước khi nó bị phát hiện. Cách chữa
|
|
16
|
+
* không phải là cấm dùng dấu sao mà là nhận nốt nó, vì người viết tài liệu sẽ
|
|
17
|
+
* gõ theo thói quen markdown dù có được dặn hay không.
|
|
18
|
+
*/
|
|
19
|
+
const props = defineProps<{ text: string }>()
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Cắt theo cả hai mẫu trong MỘT lần quét thay vì tách backtick rồi tách sao.
|
|
23
|
+
* Tách hai lần sẽ hiểu nhầm dấu sao nằm bên trong khối code.
|
|
24
|
+
*/
|
|
25
|
+
const PATTERN = /(`[^`]+`|\*\*[^*]+\*\*)/g
|
|
26
|
+
|
|
27
|
+
interface Part {
|
|
28
|
+
kind: 'code' | 'strong' | 'text'
|
|
29
|
+
value: string
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const parts = computed<Part[]>(() =>
|
|
33
|
+
props.text
|
|
34
|
+
.split(PATTERN)
|
|
35
|
+
.filter(chunk => chunk !== '')
|
|
36
|
+
.map((chunk) => {
|
|
37
|
+
if (chunk.startsWith('`') && chunk.endsWith('`'))
|
|
38
|
+
return { kind: 'code' as const, value: chunk.slice(1, -1) }
|
|
39
|
+
|
|
40
|
+
if (chunk.startsWith('**') && chunk.endsWith('**'))
|
|
41
|
+
return { kind: 'strong' as const, value: chunk.slice(2, -2) }
|
|
42
|
+
|
|
43
|
+
return { kind: 'text' as const, value: chunk }
|
|
44
|
+
}),
|
|
45
|
+
)
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<template v-for="(part, index) in parts" :key="index">
|
|
50
|
+
<code
|
|
51
|
+
v-if="part.kind === 'code'"
|
|
52
|
+
class="rounded border border-border bg-muted px-1 py-0.5 font-mono text-[0.85em] text-foreground"
|
|
53
|
+
>{{ part.value }}</code>
|
|
54
|
+
<!-- `text-foreground` chứ không chỉ `font-medium`: đoạn mô tả là chữ mờ,
|
|
55
|
+
nên chỉ tăng cân chữ thôi thì gần như không thấy khác. -->
|
|
56
|
+
<strong
|
|
57
|
+
v-else-if="part.kind === 'strong'"
|
|
58
|
+
class="font-medium text-foreground"
|
|
59
|
+
>{{ part.value }}</strong>
|
|
60
|
+
<template v-else>
|
|
61
|
+
{{ part.value }}
|
|
62
|
+
</template>
|
|
63
|
+
</template>
|
|
64
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as DocText } from './DocText.vue'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRootEmits, DropdownMenuRootProps } from 'reka-ui'
|
|
3
|
+
import { DropdownMenuRoot, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuRootProps>()
|
|
6
|
+
const emits = defineEmits<DropdownMenuRootEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuRoot v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</DropdownMenuRoot>
|
|
15
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuCheckboxItemEmits, DropdownMenuCheckboxItemProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { DropdownMenuCheckboxItem, DropdownMenuItemIndicator, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { Check } from '../../lib/icons'
|
|
7
|
+
import { menuIndicatorItemClass, menuIndicatorSlotClass } from '../../lib/menu-styles'
|
|
8
|
+
import { cn } from '../../lib/utils'
|
|
9
|
+
|
|
10
|
+
const props = defineProps<DropdownMenuCheckboxItemProps & ClassProps>()
|
|
11
|
+
const emits = defineEmits<DropdownMenuCheckboxItemEmits>()
|
|
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
|
+
<DropdownMenuCheckboxItem
|
|
23
|
+
v-bind="forwarded"
|
|
24
|
+
:class="cn(menuIndicatorItemClass, props.class)"
|
|
25
|
+
>
|
|
26
|
+
<span :class="menuIndicatorSlotClass">
|
|
27
|
+
<DropdownMenuItemIndicator>
|
|
28
|
+
<Check class="size-4" />
|
|
29
|
+
</DropdownMenuItemIndicator>
|
|
30
|
+
</span>
|
|
31
|
+
<slot />
|
|
32
|
+
</DropdownMenuCheckboxItem>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuContentEmits, DropdownMenuContentProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { DropdownMenuContent, DropdownMenuPortal, useForwardPropsEmits } from 'reka-ui'
|
|
5
|
+
import { computed } from 'vue'
|
|
6
|
+
import { menuContentClass } from '../../lib/menu-styles'
|
|
7
|
+
import { cn } from '../../lib/utils'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(
|
|
10
|
+
defineProps<DropdownMenuContentProps & ClassProps>(),
|
|
11
|
+
{ sideOffset: 6, align: 'start', collisionPadding: 8 },
|
|
12
|
+
)
|
|
13
|
+
const emits = defineEmits<DropdownMenuContentEmits>()
|
|
14
|
+
|
|
15
|
+
const delegated = computed(() => {
|
|
16
|
+
const { class: _class, ...rest } = props
|
|
17
|
+
return rest
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
const forwarded = useForwardPropsEmits(delegated, emits)
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<DropdownMenuPortal>
|
|
25
|
+
<DropdownMenuContent
|
|
26
|
+
v-bind="forwarded"
|
|
27
|
+
:class="cn(
|
|
28
|
+
menuContentClass,
|
|
29
|
+
'max-h-[var(--reka-dropdown-menu-content-available-height)] overflow-y-auto',
|
|
30
|
+
props.class,
|
|
31
|
+
)"
|
|
32
|
+
>
|
|
33
|
+
<slot />
|
|
34
|
+
</DropdownMenuContent>
|
|
35
|
+
</DropdownMenuPortal>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuGroupProps } from 'reka-ui'
|
|
3
|
+
import { DropdownMenuGroup } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuGroupProps>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<DropdownMenuGroup v-bind="props">
|
|
10
|
+
<slot />
|
|
11
|
+
</DropdownMenuGroup>
|
|
12
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuItemEmits, DropdownMenuItemProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { DropdownMenuItem, 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<DropdownMenuItemProps & 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<DropdownMenuItemEmits>()
|
|
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
|
+
<DropdownMenuItem
|
|
26
|
+
v-bind="forwarded"
|
|
27
|
+
:data-variant="props.variant"
|
|
28
|
+
:class="cn(menuItemClass, props.inset && menuInsetClass, props.class)"
|
|
29
|
+
>
|
|
30
|
+
<slot />
|
|
31
|
+
</DropdownMenuItem>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuLabelProps } from 'reka-ui'
|
|
3
|
+
import type { ClassProps } from '../../lib/types'
|
|
4
|
+
import { DropdownMenuLabel } 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<DropdownMenuLabelProps & 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
|
+
<DropdownMenuLabel
|
|
19
|
+
v-bind="delegated"
|
|
20
|
+
:class="cn(menuLabelClass, props.inset && menuInsetClass, props.class)"
|
|
21
|
+
>
|
|
22
|
+
<slot />
|
|
23
|
+
</DropdownMenuLabel>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DropdownMenuRadioGroupEmits, DropdownMenuRadioGroupProps } from 'reka-ui'
|
|
3
|
+
import { DropdownMenuRadioGroup, useForwardPropsEmits } from 'reka-ui'
|
|
4
|
+
|
|
5
|
+
const props = defineProps<DropdownMenuRadioGroupProps>()
|
|
6
|
+
const emits = defineEmits<DropdownMenuRadioGroupEmits>()
|
|
7
|
+
|
|
8
|
+
const forwarded = useForwardPropsEmits(props, emits)
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<DropdownMenuRadioGroup v-bind="forwarded">
|
|
13
|
+
<slot />
|
|
14
|
+
</DropdownMenuRadioGroup>
|
|
15
|
+
</template>
|