@una-ui/nuxt 0.53.0 → 0.54.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/dist/module.cjs +5 -0
- package/dist/module.d.ts +37 -0
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/alert-dialog/AlertDialog.vue +38 -43
- package/dist/runtime/components/alert-dialog/AlertDialogAction.vue +9 -35
- package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue +13 -39
- package/dist/runtime/components/alert-dialog/AlertDialogContent.vue +33 -39
- package/dist/runtime/components/alert-dialog/AlertDialogDescription.vue +13 -15
- package/dist/runtime/components/alert-dialog/AlertDialogFooter.vue +11 -12
- package/dist/runtime/components/alert-dialog/AlertDialogHeader.vue +9 -10
- package/dist/runtime/components/alert-dialog/AlertDialogOverlay.vue +11 -15
- package/dist/runtime/components/alert-dialog/AlertDialogTitle.vue +13 -15
- package/dist/runtime/components/alert-dialog/AlertDialogTrigger.vue +5 -6
- package/dist/runtime/components/aspect-ratio/AspectRatio.vue +16 -18
- package/dist/runtime/components/combobox/Combobox.vue +144 -144
- package/dist/runtime/components/combobox/ComboboxAnchor.vue +18 -20
- package/dist/runtime/components/combobox/ComboboxEmpty.vue +16 -18
- package/dist/runtime/components/combobox/ComboboxGroup.vue +19 -25
- package/dist/runtime/components/combobox/ComboboxInput.vue +24 -38
- package/dist/runtime/components/combobox/ComboboxItem.vue +22 -23
- package/dist/runtime/components/combobox/ComboboxItemIndicator.vue +23 -23
- package/dist/runtime/components/combobox/ComboboxLabel.vue +10 -16
- package/dist/runtime/components/combobox/ComboboxList.vue +25 -43
- package/dist/runtime/components/combobox/ComboboxSeparator.vue +16 -18
- package/dist/runtime/components/combobox/ComboboxTrigger.vue +52 -75
- package/dist/runtime/components/combobox/ComboboxViewport.vue +18 -20
- package/dist/runtime/components/data/table/Table.vue +186 -206
- package/dist/runtime/components/data/table/TableBody.vue +15 -15
- package/dist/runtime/components/data/table/TableCaption.vue +16 -16
- package/dist/runtime/components/data/table/TableCell.vue +19 -20
- package/dist/runtime/components/data/table/TableEmpty.vue +27 -27
- package/dist/runtime/components/data/table/TableFooter.vue +15 -15
- package/dist/runtime/components/data/table/TableHead.vue +17 -18
- package/dist/runtime/components/data/table/TableHeader.vue +15 -15
- package/dist/runtime/components/data/table/TableLoading.vue +28 -31
- package/dist/runtime/components/data/table/TableRow.vue +15 -15
- package/dist/runtime/components/elements/Accordion.vue +92 -99
- package/dist/runtime/components/elements/Alert.vue +50 -37
- package/dist/runtime/components/elements/AvatarGroup.vue +71 -64
- package/dist/runtime/components/elements/Badge.vue +20 -19
- package/dist/runtime/components/elements/Button.vue +62 -75
- package/dist/runtime/components/elements/Icon.vue +4 -4
- package/dist/runtime/components/elements/Indicator.vue +29 -25
- package/dist/runtime/components/elements/Kbd.vue +12 -13
- package/dist/runtime/components/elements/Label.vue +15 -17
- package/dist/runtime/components/elements/Link.vue +2 -2
- package/dist/runtime/components/elements/Link.vue.d.ts +109 -0
- package/dist/runtime/components/elements/Progress.vue +35 -36
- package/dist/runtime/components/elements/Separator.vue +26 -31
- package/dist/runtime/components/elements/Skeleton.vue +11 -15
- package/dist/runtime/components/elements/Toggle.vue +26 -48
- package/dist/runtime/components/elements/avatar/Avatar.vue +22 -31
- package/dist/runtime/components/elements/avatar/AvatarFallback.vue +17 -26
- package/dist/runtime/components/elements/avatar/AvatarImage.vue +11 -20
- package/dist/runtime/components/elements/card/Card.vue +24 -28
- package/dist/runtime/components/elements/card/CardContent.vue +9 -10
- package/dist/runtime/components/elements/card/CardDescription.vue +9 -10
- package/dist/runtime/components/elements/card/CardFooter.vue +9 -10
- package/dist/runtime/components/elements/card/CardHeader.vue +9 -10
- package/dist/runtime/components/elements/card/CardTitle.vue +11 -12
- package/dist/runtime/components/elements/collapsible/Collapsible.vue +11 -15
- package/dist/runtime/components/elements/collapsible/CollapsibleContent.vue +9 -12
- package/dist/runtime/components/elements/collapsible/CollapsibleTrigger.vue +5 -6
- package/dist/runtime/components/elements/dialog/Dialog.vue +35 -43
- package/dist/runtime/components/elements/dialog/DialogClose.vue +11 -34
- package/dist/runtime/components/elements/dialog/DialogContent.vue +35 -40
- package/dist/runtime/components/elements/dialog/DialogDescription.vue +15 -16
- package/dist/runtime/components/elements/dialog/DialogFooter.vue +9 -10
- package/dist/runtime/components/elements/dialog/DialogHeader.vue +9 -10
- package/dist/runtime/components/elements/dialog/DialogOverlay.vue +11 -13
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue +37 -39
- package/dist/runtime/components/elements/dialog/DialogTitle.vue +17 -19
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenu.vue +38 -85
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuContent.vue +26 -43
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuGroup.vue +10 -14
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuItem.vue +33 -58
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuLabel.vue +19 -21
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuRoot.vue +9 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSeparator.vue +18 -25
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuShortcut.vue +9 -12
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSub.vue +13 -9
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubContent.vue +21 -36
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubTrigger.vue +27 -52
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuTrigger.vue +17 -44
- package/dist/runtime/components/elements/pagination/Pagination.vue +31 -51
- package/dist/runtime/components/elements/pagination/PaginationEllipsis.vue +25 -27
- package/dist/runtime/components/elements/pagination/PaginationFirst.vue +25 -45
- package/dist/runtime/components/elements/pagination/PaginationLast.vue +25 -45
- package/dist/runtime/components/elements/pagination/PaginationListItem.vue +27 -50
- package/dist/runtime/components/elements/pagination/PaginationNext.vue +25 -45
- package/dist/runtime/components/elements/pagination/PaginationPrev.vue +25 -45
- package/dist/runtime/components/elements/popover/Popover.vue +16 -15
- package/dist/runtime/components/elements/popover/PopoverContent.vue +31 -39
- package/dist/runtime/components/elements/tabs/Tabs.vue +21 -32
- package/dist/runtime/components/elements/tabs/TabsContent.vue +18 -22
- package/dist/runtime/components/elements/tabs/TabsList.vue +14 -19
- package/dist/runtime/components/elements/tabs/TabsRoot.vue +13 -22
- package/dist/runtime/components/elements/tabs/TabsTrigger.vue +19 -47
- package/dist/runtime/components/elements/tooltip/Tooltip.vue +24 -36
- package/dist/runtime/components/elements/tooltip/TooltipContent.vue +27 -37
- package/dist/runtime/components/elements/tooltip/TooltipProvider.vue +7 -10
- package/dist/runtime/components/elements/tooltip/TooltipRoot.vue +9 -13
- package/dist/runtime/components/elements/tooltip/TooltipTrigger.vue +5 -34
- package/dist/runtime/components/forms/Checkbox.vue +42 -49
- package/dist/runtime/components/forms/FormGroup.vue +33 -40
- package/dist/runtime/components/forms/Input.vue +134 -118
- package/dist/runtime/components/forms/Slider.vue +33 -48
- package/dist/runtime/components/forms/Switch.vue +42 -43
- package/dist/runtime/components/forms/form/FormControl.vue +5 -4
- package/dist/runtime/components/forms/form/FormDescription.vue +12 -12
- package/dist/runtime/components/forms/form/FormField.vue +56 -65
- package/dist/runtime/components/forms/form/FormItem.vue +14 -14
- package/dist/runtime/components/forms/form/FormLabel.vue +13 -17
- package/dist/runtime/components/forms/form/FormMessage.vue +14 -14
- package/dist/runtime/components/forms/radio-group/RadioGroup.vue +62 -66
- package/dist/runtime/components/forms/radio-group/RadioGroupItem.vue +54 -60
- package/dist/runtime/components/forms/select/Select.vue +63 -81
- package/dist/runtime/components/forms/select/SelectContent.vue +38 -55
- package/dist/runtime/components/forms/select/SelectGroup.vue +16 -18
- package/dist/runtime/components/forms/select/SelectItem.vue +25 -31
- package/dist/runtime/components/forms/select/SelectItemIndicator.vue +15 -17
- package/dist/runtime/components/forms/select/SelectItemText.vue +5 -9
- package/dist/runtime/components/forms/select/SelectLabel.vue +10 -15
- package/dist/runtime/components/forms/select/SelectScrollDownButton.vue +19 -20
- package/dist/runtime/components/forms/select/SelectScrollUpButton.vue +19 -20
- package/dist/runtime/components/forms/select/SelectSeparator.vue +16 -18
- package/dist/runtime/components/forms/select/SelectTrigger.vue +53 -78
- package/dist/runtime/components/forms/select/SelectValue.vue +10 -15
- package/dist/runtime/components/misc/ThemeSwitcher.vue +69 -51
- package/dist/runtime/components/navigation/breadcrumb/Breadcrumb.vue +22 -35
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbEllipsis.vue +14 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbItem.vue +9 -10
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbLink.vue +26 -46
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbList.vue +9 -10
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbPage.vue +7 -5
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbRoot.vue +8 -9
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbSeparator.vue +13 -13
- package/dist/runtime/components/navigation-menu/NavigationMenu.vue +32 -52
- package/dist/runtime/components/navigation-menu/NavigationMenuContent.vue +19 -22
- package/dist/runtime/components/navigation-menu/NavigationMenuContentItem.vue +24 -53
- package/dist/runtime/components/navigation-menu/NavigationMenuIndicator.vue +15 -18
- package/dist/runtime/components/navigation-menu/NavigationMenuItem.vue +5 -40
- package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue +28 -51
- package/dist/runtime/components/navigation-menu/NavigationMenuList.vue +22 -24
- package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue +34 -54
- package/dist/runtime/components/navigation-menu/NavigationMenuViewport.vue +26 -29
- package/dist/runtime/components/overlays/Toaster.vue +16 -19
- package/dist/runtime/components/overlays/toast/Toast.vue +38 -58
- package/dist/runtime/components/overlays/toast/ToastAction.vue +19 -42
- package/dist/runtime/components/overlays/toast/ToastClose.vue +20 -21
- package/dist/runtime/components/overlays/toast/ToastDescription.vue +16 -17
- package/dist/runtime/components/overlays/toast/ToastInfo.vue +9 -10
- package/dist/runtime/components/overlays/toast/ToastProvider.vue +7 -8
- package/dist/runtime/components/overlays/toast/ToastTitle.vue +16 -17
- package/dist/runtime/components/overlays/toast/ToastViewport.vue +16 -19
- package/dist/runtime/components/resizable/ResizableHandle.vue +36 -36
- package/dist/runtime/components/resizable/ResizablePanel.vue +17 -24
- package/dist/runtime/components/resizable/ResizablePanelGroup.vue +17 -22
- package/dist/runtime/components/scroll-area/ScrollArea.vue +23 -31
- package/dist/runtime/components/scroll-area/ScrollBar.vue +25 -29
- package/dist/runtime/components/sheet/Sheet.vue +29 -40
- package/dist/runtime/components/sheet/SheetClose.vue +12 -34
- package/dist/runtime/components/sheet/SheetContent.vue +29 -35
- package/dist/runtime/components/sheet/SheetDescription.vue +13 -13
- package/dist/runtime/components/sheet/SheetFooter.vue +11 -12
- package/dist/runtime/components/sheet/SheetHeader.vue +7 -8
- package/dist/runtime/components/sheet/SheetTitle.vue +12 -13
- package/dist/runtime/components/sheet/SheetTrigger.vue +7 -6
- package/dist/runtime/components/sidebar/Sidebar.vue +52 -48
- package/dist/runtime/components/sidebar/SidebarContent.vue +10 -11
- package/dist/runtime/components/sidebar/SidebarFooter.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarGroup.vue +10 -12
- package/dist/runtime/components/sidebar/SidebarGroupAction.vue +13 -13
- package/dist/runtime/components/sidebar/SidebarGroupContent.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarGroupLabel.vue +13 -13
- package/dist/runtime/components/sidebar/SidebarHeader.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarInput.vue +10 -26
- package/dist/runtime/components/sidebar/SidebarInset.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenu.vue +14 -16
- package/dist/runtime/components/sidebar/SidebarMenuAction.vue +13 -15
- package/dist/runtime/components/sidebar/SidebarMenuBadge.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenuButton.vue +28 -27
- package/dist/runtime/components/sidebar/SidebarMenuButtonChild.vue +41 -29
- package/dist/runtime/components/sidebar/SidebarMenuItem.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenuSkeleton.vue +14 -15
- package/dist/runtime/components/sidebar/SidebarMenuSub.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarMenuSubButton.vue +17 -19
- package/dist/runtime/components/sidebar/SidebarMenuSubItem.vue +9 -10
- package/dist/runtime/components/sidebar/SidebarProvider.vue +55 -38
- package/dist/runtime/components/sidebar/SidebarRail.vue +12 -12
- package/dist/runtime/components/sidebar/SidebarSeparator.vue +10 -11
- package/dist/runtime/components/sidebar/SidebarTrigger.vue +18 -38
- package/dist/types.d.mts +5 -3
- package/dist/types.d.ts +7 -0
- package/dist/una.config.d.ts +8 -0
- package/dist/una.config.mjs +1 -1
- package/package.json +10 -8
- package/dist/runtime/components/alert-dialog/AlertDialog.vue.d.ts +0 -45
- package/dist/runtime/components/alert-dialog/AlertDialogAction.vue.d.ts +0 -16
- package/dist/runtime/components/alert-dialog/AlertDialogCancel.vue.d.ts +0 -16
- package/dist/runtime/components/alert-dialog/AlertDialogContent.vue.d.ts +0 -45
- package/dist/runtime/components/alert-dialog/AlertDialogDescription.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogFooter.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogHeader.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogOverlay.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogTitle.vue.d.ts +0 -13
- package/dist/runtime/components/alert-dialog/AlertDialogTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/aspect-ratio/AspectRatio.vue.d.ts +0 -18
- package/dist/runtime/components/combobox/Combobox.vue.d.ts +0 -89
- package/dist/runtime/components/combobox/ComboboxAnchor.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxEmpty.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxGroup.vue.d.ts +0 -17
- package/dist/runtime/components/combobox/ComboboxInput.vue.d.ts +0 -16
- package/dist/runtime/components/combobox/ComboboxItem.vue.d.ts +0 -18
- package/dist/runtime/components/combobox/ComboboxItemIndicator.vue.d.ts +0 -15
- package/dist/runtime/components/combobox/ComboboxLabel.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxList.vue.d.ts +0 -43
- package/dist/runtime/components/combobox/ComboboxSeparator.vue.d.ts +0 -13
- package/dist/runtime/components/combobox/ComboboxTrigger.vue.d.ts +0 -17
- package/dist/runtime/components/combobox/ComboboxViewport.vue.d.ts +0 -13
- package/dist/runtime/components/data/table/Table.vue.d.ts +0 -184
- package/dist/runtime/components/data/table/TableBody.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableCaption.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableCell.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableEmpty.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableFooter.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableHead.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableHeader.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableLoading.vue.d.ts +0 -15
- package/dist/runtime/components/data/table/TableRow.vue.d.ts +0 -15
- package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -28
- package/dist/runtime/components/elements/Alert.vue.d.ts +0 -22
- package/dist/runtime/components/elements/AvatarGroup.vue.d.ts +0 -11
- package/dist/runtime/components/elements/Badge.vue.d.ts +0 -26
- package/dist/runtime/components/elements/Button.vue.d.ts +0 -34
- package/dist/runtime/components/elements/Icon.vue.d.ts +0 -3
- package/dist/runtime/components/elements/Indicator.vue.d.ts +0 -19
- package/dist/runtime/components/elements/Kbd.vue.d.ts +0 -13
- package/dist/runtime/components/elements/Label.vue.d.ts +0 -13
- package/dist/runtime/components/elements/Progress.vue.d.ts +0 -18
- package/dist/runtime/components/elements/Separator.vue.d.ts +0 -15
- package/dist/runtime/components/elements/Skeleton.vue.d.ts +0 -13
- package/dist/runtime/components/elements/Toggle.vue.d.ts +0 -22
- package/dist/runtime/components/elements/avatar/Avatar.vue.d.ts +0 -21
- package/dist/runtime/components/elements/avatar/AvatarFallback.vue.d.ts +0 -13
- package/dist/runtime/components/elements/avatar/AvatarImage.vue.d.ts +0 -3
- package/dist/runtime/components/elements/card/Card.vue.d.ts +0 -25
- package/dist/runtime/components/elements/card/CardContent.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardDescription.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardFooter.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardHeader.vue.d.ts +0 -13
- package/dist/runtime/components/elements/card/CardTitle.vue.d.ts +0 -13
- package/dist/runtime/components/elements/collapsible/Collapsible.vue.d.ts +0 -25
- package/dist/runtime/components/elements/collapsible/CollapsibleContent.vue.d.ts +0 -13
- package/dist/runtime/components/elements/collapsible/CollapsibleTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/Dialog.vue.d.ts +0 -34
- package/dist/runtime/components/elements/dialog/DialogClose.vue.d.ts +0 -18
- package/dist/runtime/components/elements/dialog/DialogContent.vue.d.ts +0 -46
- package/dist/runtime/components/elements/dialog/DialogDescription.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogFooter.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogHeader.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogOverlay.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dialog/DialogScrollContent.vue.d.ts +0 -46
- package/dist/runtime/components/elements/dialog/DialogTitle.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenu.vue.d.ts +0 -61
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuContent.vue.d.ts +0 -43
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuGroup.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuItem.vue.d.ts +0 -14
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuLabel.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuRoot.vue.d.ts +0 -17
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSeparator.vue.d.ts +0 -3
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuShortcut.vue.d.ts +0 -13
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSub.vue.d.ts +0 -17
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubContent.vue.d.ts +0 -45
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuSubTrigger.vue.d.ts +0 -16
- package/dist/runtime/components/elements/dropdown-menu/DropdownMenuTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/elements/pagination/Pagination.vue.d.ts +0 -41
- package/dist/runtime/components/elements/pagination/PaginationEllipsis.vue.d.ts +0 -15
- package/dist/runtime/components/elements/pagination/PaginationFirst.vue.d.ts +0 -18
- package/dist/runtime/components/elements/pagination/PaginationLast.vue.d.ts +0 -18
- package/dist/runtime/components/elements/pagination/PaginationListItem.vue.d.ts +0 -17
- package/dist/runtime/components/elements/pagination/PaginationNext.vue.d.ts +0 -18
- package/dist/runtime/components/elements/pagination/PaginationPrev.vue.d.ts +0 -18
- package/dist/runtime/components/elements/popover/Popover.vue.d.ts +0 -21
- package/dist/runtime/components/elements/popover/PopoverContent.vue.d.ts +0 -46
- package/dist/runtime/components/elements/tabs/Tabs.vue.d.ts +0 -28
- package/dist/runtime/components/elements/tabs/TabsContent.vue.d.ts +0 -13
- package/dist/runtime/components/elements/tabs/TabsList.vue.d.ts +0 -13
- package/dist/runtime/components/elements/tabs/TabsRoot.vue.d.ts +0 -17
- package/dist/runtime/components/elements/tabs/TabsTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/elements/tooltip/Tooltip.vue.d.ts +0 -19
- package/dist/runtime/components/elements/tooltip/TooltipContent.vue.d.ts +0 -22
- package/dist/runtime/components/elements/tooltip/TooltipProvider.vue.d.ts +0 -15
- package/dist/runtime/components/elements/tooltip/TooltipRoot.vue.d.ts +0 -17
- package/dist/runtime/components/elements/tooltip/TooltipTrigger.vue.d.ts +0 -13
- package/dist/runtime/components/forms/Checkbox.vue.d.ts +0 -21
- package/dist/runtime/components/forms/FormGroup.vue.d.ts +0 -27
- package/dist/runtime/components/forms/Input.vue.d.ts +0 -31
- package/dist/runtime/components/forms/Slider.vue.d.ts +0 -25
- package/dist/runtime/components/forms/Switch.vue.d.ts +0 -27
- package/dist/runtime/components/forms/form/FormControl.vue.d.ts +0 -12
- package/dist/runtime/components/forms/form/FormDescription.vue.d.ts +0 -13
- package/dist/runtime/components/forms/form/FormField.vue.d.ts +0 -25
- package/dist/runtime/components/forms/form/FormItem.vue.d.ts +0 -13
- package/dist/runtime/components/forms/form/FormLabel.vue.d.ts +0 -13
- package/dist/runtime/components/forms/form/FormMessage.vue.d.ts +0 -3
- package/dist/runtime/components/forms/radio-group/RadioGroup.vue.d.ts +0 -29
- package/dist/runtime/components/forms/radio-group/RadioGroupItem.vue.d.ts +0 -22
- package/dist/runtime/components/forms/select/Select.vue.d.ts +0 -72
- package/dist/runtime/components/forms/select/SelectContent.vue.d.ts +0 -27
- package/dist/runtime/components/forms/select/SelectGroup.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectItem.vue.d.ts +0 -17
- package/dist/runtime/components/forms/select/SelectItemIndicator.vue.d.ts +0 -15
- package/dist/runtime/components/forms/select/SelectItemText.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectLabel.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectScrollDownButton.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectScrollUpButton.vue.d.ts +0 -13
- package/dist/runtime/components/forms/select/SelectSeparator.vue.d.ts +0 -3
- package/dist/runtime/components/forms/select/SelectTrigger.vue.d.ts +0 -15
- package/dist/runtime/components/forms/select/SelectValue.vue.d.ts +0 -13
- package/dist/runtime/components/misc/ThemeSwitcher.vue.d.ts +0 -16
- package/dist/runtime/components/navigation/breadcrumb/Breadcrumb.vue.d.ts +0 -45
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbEllipsis.vue.d.ts +0 -16
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbItem.vue.d.ts +0 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbLink.vue.d.ts +0 -18
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbList.vue.d.ts +0 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbPage.vue.d.ts +0 -16
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbRoot.vue.d.ts +0 -13
- package/dist/runtime/components/navigation/breadcrumb/BreadcrumbSeparator.vue.d.ts +0 -16
- package/dist/runtime/components/navigation-menu/NavigationMenu.vue.d.ts +0 -46
- package/dist/runtime/components/navigation-menu/NavigationMenuContent.vue.d.ts +0 -39
- package/dist/runtime/components/navigation-menu/NavigationMenuContentItem.vue.d.ts +0 -21
- package/dist/runtime/components/navigation-menu/NavigationMenuIndicator.vue.d.ts +0 -13
- package/dist/runtime/components/navigation-menu/NavigationMenuItem.vue.d.ts +0 -13
- package/dist/runtime/components/navigation-menu/NavigationMenuLink.vue.d.ts +0 -27
- package/dist/runtime/components/navigation-menu/NavigationMenuList.vue.d.ts +0 -13
- package/dist/runtime/components/navigation-menu/NavigationMenuTrigger.vue.d.ts +0 -18
- package/dist/runtime/components/navigation-menu/NavigationMenuViewport.vue.d.ts +0 -3
- package/dist/runtime/components/overlays/Toaster.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/Toast.vue.d.ts +0 -112
- package/dist/runtime/components/overlays/toast/ToastAction.vue.d.ts +0 -16
- package/dist/runtime/components/overlays/toast/ToastClose.vue.d.ts +0 -3
- package/dist/runtime/components/overlays/toast/ToastDescription.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/ToastInfo.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/ToastProvider.vue.d.ts +0 -15
- package/dist/runtime/components/overlays/toast/ToastTitle.vue.d.ts +0 -13
- package/dist/runtime/components/overlays/toast/ToastViewport.vue.d.ts +0 -3
- package/dist/runtime/components/resizable/ResizableHandle.vue.d.ts +0 -21
- package/dist/runtime/components/resizable/ResizablePanel.vue.d.ts +0 -24
- package/dist/runtime/components/resizable/ResizablePanelGroup.vue.d.ts +0 -19
- package/dist/runtime/components/scroll-area/ScrollArea.vue.d.ts +0 -17
- package/dist/runtime/components/scroll-area/ScrollBar.vue.d.ts +0 -6
- package/dist/runtime/components/sheet/Sheet.vue.d.ts +0 -36
- package/dist/runtime/components/sheet/SheetClose.vue.d.ts +0 -42
- package/dist/runtime/components/sheet/SheetContent.vue.d.ts +0 -68
- package/dist/runtime/components/sheet/SheetDescription.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetFooter.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetHeader.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetTitle.vue.d.ts +0 -12
- package/dist/runtime/components/sheet/SheetTrigger.vue.d.ts +0 -15
- package/dist/runtime/components/sidebar/Sidebar.vue.d.ts +0 -24
- package/dist/runtime/components/sidebar/SidebarContent.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarFooter.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarGroup.vue.d.ts +0 -16
- package/dist/runtime/components/sidebar/SidebarGroupAction.vue.d.ts +0 -36
- package/dist/runtime/components/sidebar/SidebarGroupContent.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarGroupLabel.vue.d.ts +0 -36
- package/dist/runtime/components/sidebar/SidebarHeader.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarInput.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarInset.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenu.vue.d.ts +0 -22
- package/dist/runtime/components/sidebar/SidebarMenuAction.vue.d.ts +0 -34
- package/dist/runtime/components/sidebar/SidebarMenuBadge.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuButton.vue.d.ts +0 -19
- package/dist/runtime/components/sidebar/SidebarMenuButtonChild.vue.d.ts +0 -31
- package/dist/runtime/components/sidebar/SidebarMenuItem.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuSkeleton.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuSub.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarMenuSubButton.vue.d.ts +0 -16
- package/dist/runtime/components/sidebar/SidebarMenuSubItem.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarProvider.vue.d.ts +0 -20
- package/dist/runtime/components/sidebar/SidebarRail.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarSeparator.vue.d.ts +0 -12
- package/dist/runtime/components/sidebar/SidebarTrigger.vue.d.ts +0 -30
|
@@ -1,133 +1,149 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { NInputProps } from '../../types'
|
|
3
|
+
import { computed, onMounted, ref } from 'vue'
|
|
4
|
+
import { cn, randomId } from '../../utils'
|
|
5
|
+
import NIcon from '../elements/Icon.vue'
|
|
6
|
+
|
|
5
7
|
defineOptions({
|
|
6
|
-
inheritAttrs: false
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const hasVariant = computed(() => inputVariants.some((inputVariants2) => props.input?.includes(inputVariants2)));
|
|
33
|
-
const isBaseVariant = computed(() => props.input?.includes("~"));
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
const props = withDefaults(defineProps<NInputProps>(), {
|
|
12
|
+
size: 'md',
|
|
13
|
+
type: 'text',
|
|
14
|
+
resize: 'none',
|
|
15
|
+
rows: 0,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const emit = defineEmits(['leading', 'trailing', 'update:modelValue'])
|
|
19
|
+
|
|
20
|
+
const slots = defineSlots<{
|
|
21
|
+
leading?: any
|
|
22
|
+
trailing?: any
|
|
23
|
+
}>()
|
|
24
|
+
|
|
25
|
+
const id = props.id ?? randomId('input')
|
|
26
|
+
|
|
27
|
+
const isLeading = computed(() => props.leading || slots.leading)
|
|
28
|
+
const isTrailing = computed(() => props.trailing || slots.trailing || props.status || props.loading)
|
|
29
|
+
|
|
30
|
+
const inputVariants = ['outline', 'solid'] as const
|
|
31
|
+
const hasVariant = computed(() => inputVariants.some(inputVariants => props.input?.includes(inputVariants)))
|
|
32
|
+
const isBaseVariant = computed(() => props.input?.includes('~'))
|
|
33
|
+
|
|
34
34
|
const statusClassVariants = computed(() => {
|
|
35
35
|
const input = {
|
|
36
|
-
info:
|
|
37
|
-
success:
|
|
38
|
-
warning:
|
|
39
|
-
error:
|
|
40
|
-
default: !hasVariant.value && !isBaseVariant.value ?
|
|
41
|
-
}
|
|
36
|
+
info: 'input-status-info input-solid-info input-status-ring',
|
|
37
|
+
success: 'input-status-success input-solid-success input-status-ring',
|
|
38
|
+
warning: 'input-status-warning input-solid-warning input-status-ring',
|
|
39
|
+
error: 'input-status-error input-solid-error input-status-ring',
|
|
40
|
+
default: !hasVariant.value && !isBaseVariant.value ? 'input-default-variant' : '',
|
|
41
|
+
}
|
|
42
|
+
|
|
42
43
|
const text = {
|
|
43
|
-
info:
|
|
44
|
-
success:
|
|
45
|
-
warning:
|
|
46
|
-
error:
|
|
47
|
-
default:
|
|
48
|
-
}
|
|
44
|
+
info: 'text-info',
|
|
45
|
+
success: 'text-success',
|
|
46
|
+
warning: 'text-warning',
|
|
47
|
+
error: 'text-error',
|
|
48
|
+
default: '',
|
|
49
|
+
}
|
|
50
|
+
|
|
49
51
|
const icon = {
|
|
50
|
-
info: props.una?.inputWarningIcon ??
|
|
51
|
-
success: props.una?.inputSuccessIcon ??
|
|
52
|
-
warning: props.una?.inputWarningIcon ??
|
|
53
|
-
error: props.una?.inputErrorIcon ??
|
|
54
|
-
default:
|
|
55
|
-
}
|
|
52
|
+
info: props.una?.inputWarningIcon ?? 'input-info-icon',
|
|
53
|
+
success: props.una?.inputSuccessIcon ?? 'input-success-icon',
|
|
54
|
+
warning: props.una?.inputWarningIcon ?? 'input-warning-icon',
|
|
55
|
+
error: props.una?.inputErrorIcon ?? 'input-error-icon',
|
|
56
|
+
default: '',
|
|
57
|
+
}
|
|
58
|
+
|
|
56
59
|
return {
|
|
57
|
-
input: input[props.status ??
|
|
58
|
-
text: text[props.status ??
|
|
59
|
-
icon: icon[props.status ??
|
|
60
|
-
}
|
|
61
|
-
})
|
|
60
|
+
input: input[props.status ?? 'default'],
|
|
61
|
+
text: text[props.status ?? 'default'],
|
|
62
|
+
icon: icon[props.status ?? 'default'],
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
|
|
62
66
|
const reverseClassVariants = computed(() => {
|
|
63
67
|
const input = {
|
|
64
|
-
false: [{
|
|
65
|
-
true: [{
|
|
66
|
-
}
|
|
68
|
+
false: [{ 'input-leading-padding': isLeading.value }, { 'input-trailing-padding': isTrailing.value }],
|
|
69
|
+
true: [{ 'input-trailing-padding': isLeading.value }, { 'input-leading-padding': isTrailing.value }],
|
|
70
|
+
}
|
|
71
|
+
|
|
67
72
|
return {
|
|
68
|
-
input: input[props.reverse ?
|
|
69
|
-
leadingWrapper: props.reverse ?
|
|
70
|
-
trailingWrapper: props.reverse ?
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const
|
|
73
|
+
input: input[props.reverse ? 'true' : 'false'],
|
|
74
|
+
leadingWrapper: props.reverse ? 'input-trailing-wrapper' : 'input-leading-wrapper',
|
|
75
|
+
trailingWrapper: props.reverse ? 'input-leading-wrapper' : 'input-trailing-wrapper',
|
|
76
|
+
}
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
// html refs
|
|
80
|
+
const inputRef = ref<HTMLTextAreaElement>()
|
|
81
|
+
|
|
82
|
+
function resizeTextarea(): void {
|
|
83
|
+
if (!(props.type === 'textarea' && props.autoresize) || !inputRef.value)
|
|
84
|
+
return
|
|
85
|
+
|
|
86
|
+
inputRef.value.rows = props.rows
|
|
87
|
+
|
|
88
|
+
const styles = window.getComputedStyle(inputRef.value)
|
|
89
|
+
const paddingTop = Number.parseInt(styles.paddingTop)
|
|
90
|
+
const paddingBottom = Number.parseInt(styles.paddingBottom)
|
|
91
|
+
const padding = paddingTop + paddingBottom
|
|
92
|
+
const lineHeight = Number.parseInt(styles.lineHeight)
|
|
93
|
+
const { scrollHeight } = inputRef.value
|
|
94
|
+
const newRows = (scrollHeight - padding) / lineHeight
|
|
95
|
+
|
|
85
96
|
if (newRows > props.rows)
|
|
86
|
-
inputRef.value.rows = newRows
|
|
87
|
-
|
|
97
|
+
inputRef.value.rows = newRows
|
|
98
|
+
|
|
99
|
+
const maxAutoresizeRows = typeof props.autoresize === 'number' ? props.autoresize : Number.POSITIVE_INFINITY
|
|
88
100
|
if (inputRef.value.rows > maxAutoresizeRows)
|
|
89
|
-
inputRef.value.rows = maxAutoresizeRows
|
|
101
|
+
inputRef.value.rows = maxAutoresizeRows
|
|
90
102
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
103
|
+
|
|
104
|
+
function onInput(event: Event): void {
|
|
105
|
+
emit('update:modelValue', (event.target as HTMLInputElement).value)
|
|
106
|
+
|
|
107
|
+
resizeTextarea()
|
|
94
108
|
}
|
|
109
|
+
|
|
95
110
|
onMounted(() => {
|
|
96
|
-
resizeTextarea()
|
|
97
|
-
})
|
|
111
|
+
resizeTextarea()
|
|
112
|
+
})
|
|
113
|
+
|
|
98
114
|
defineExpose({
|
|
99
115
|
focus: () => inputRef.value?.focus(),
|
|
100
116
|
blur: () => inputRef.value?.blur(),
|
|
101
117
|
select: () => inputRef.value?.select(),
|
|
102
|
-
inputRef
|
|
103
|
-
})
|
|
118
|
+
inputRef,
|
|
119
|
+
})
|
|
104
120
|
</script>
|
|
105
121
|
|
|
106
122
|
<template>
|
|
107
123
|
<div
|
|
108
124
|
:size
|
|
109
125
|
:class="cn(
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
)"
|
|
126
|
+
'input-wrapper',
|
|
127
|
+
una?.inputWrapper,
|
|
128
|
+
)"
|
|
113
129
|
v-bind="_inputWrapper"
|
|
114
130
|
>
|
|
115
131
|
<div
|
|
116
132
|
v-if="isLeading"
|
|
117
133
|
:class="cn(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
)"
|
|
134
|
+
una?.inputLeadingWrapper,
|
|
135
|
+
reverseClassVariants.leadingWrapper,
|
|
136
|
+
statusClassVariants.text,
|
|
137
|
+
)"
|
|
122
138
|
>
|
|
123
139
|
<slot name="leading">
|
|
124
140
|
<NIcon
|
|
125
141
|
v-if="leading"
|
|
126
142
|
:name="leading"
|
|
127
143
|
:class="cn(
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
)"
|
|
144
|
+
'input-leading',
|
|
145
|
+
una?.inputLeading,
|
|
146
|
+
)"
|
|
131
147
|
@click="emit('leading')"
|
|
132
148
|
/>
|
|
133
149
|
</slot>
|
|
@@ -138,18 +154,18 @@ defineExpose({
|
|
|
138
154
|
:id
|
|
139
155
|
ref="inputRef"
|
|
140
156
|
:value="modelValue"
|
|
141
|
-
:type="props.type !== 'textarea' ? props.type :
|
|
157
|
+
:type="props.type !== 'textarea' ? props.type : undefined"
|
|
142
158
|
:class="cn(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
)"
|
|
159
|
+
'input',
|
|
160
|
+
type === 'textarea' ? 'input-textarea' : 'input-input',
|
|
161
|
+
statusClassVariants.input,
|
|
162
|
+
reverseClassVariants.input,
|
|
163
|
+
una?.input,
|
|
164
|
+
)"
|
|
149
165
|
:input
|
|
150
|
-
:resize="type === 'textarea' ? resize :
|
|
151
|
-
:rows="type === 'textarea' ? rows :
|
|
152
|
-
:cols="type === 'textarea' ? cols :
|
|
166
|
+
:resize="type === 'textarea' ? resize : undefined"
|
|
167
|
+
:rows="type === 'textarea' ? rows : undefined"
|
|
168
|
+
:cols="type === 'textarea' ? cols : undefined"
|
|
153
169
|
v-bind="$attrs"
|
|
154
170
|
@input="onInput"
|
|
155
171
|
/>
|
|
@@ -157,36 +173,36 @@ defineExpose({
|
|
|
157
173
|
<div
|
|
158
174
|
v-if="isTrailing"
|
|
159
175
|
:class="cn(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
)"
|
|
176
|
+
una?.inputTrailingWrapper,
|
|
177
|
+
reverseClassVariants.trailingWrapper,
|
|
178
|
+
statusClassVariants.text,
|
|
179
|
+
)"
|
|
164
180
|
>
|
|
165
181
|
<NIcon
|
|
166
182
|
v-if="loading"
|
|
167
183
|
:name="una?.inputLoadingIcon ?? 'input-loading-icon'"
|
|
168
184
|
:class="cn(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
)"
|
|
185
|
+
'input-loading',
|
|
186
|
+
una?.inputLoading,
|
|
187
|
+
)"
|
|
172
188
|
/>
|
|
173
189
|
|
|
174
190
|
<NIcon
|
|
175
191
|
v-else-if="status"
|
|
176
192
|
:name="statusClassVariants.icon"
|
|
177
193
|
:class="cn(
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
)"
|
|
194
|
+
'input-status-icon-base',
|
|
195
|
+
una?.inputStatusIconBase,
|
|
196
|
+
)"
|
|
181
197
|
/>
|
|
182
198
|
|
|
183
199
|
<slot v-else name="trailing">
|
|
184
200
|
<NIcon
|
|
185
201
|
v-if="trailing"
|
|
186
202
|
:class="cn(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
)"
|
|
203
|
+
'input-trailing',
|
|
204
|
+
una?.inputTrailing,
|
|
205
|
+
)"
|
|
190
206
|
:name="trailing"
|
|
191
207
|
@click="emit('trailing')"
|
|
192
208
|
/>
|
|
@@ -1,63 +1,48 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
min: { type: Number, required: false },
|
|
17
|
-
max: { type: Number, required: false },
|
|
18
|
-
step: { type: Number, required: false },
|
|
19
|
-
minStepsBetweenThumbs: { type: Number, required: false },
|
|
20
|
-
thumbAlignment: { type: String, required: false },
|
|
21
|
-
asChild: { type: Boolean, required: false },
|
|
22
|
-
as: { type: null, required: false },
|
|
23
|
-
name: { type: String, required: false },
|
|
24
|
-
required: { type: Boolean, required: false },
|
|
25
|
-
class: { type: null, required: false }
|
|
26
|
-
});
|
|
27
|
-
const emits = defineEmits(["update:modelValue", "valueCommit"]);
|
|
28
|
-
const rootProps = reactiveOmit(props, ["class", "una", "slider", "una"]);
|
|
29
|
-
const forwarded = useForwardPropsEmits(rootProps, emits);
|
|
30
|
-
const isVertical = computed(() => props.orientation === "vertical");
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SliderRootEmits } from 'reka-ui'
|
|
3
|
+
import type { NSliderProps } from '../../types'
|
|
4
|
+
import { reactiveOmit } from '@vueuse/core'
|
|
5
|
+
import { SliderRange, SliderRoot, SliderThumb, SliderTrack, useForwardPropsEmits } from 'reka-ui'
|
|
6
|
+
import { computed } from 'vue'
|
|
7
|
+
import { cn } from '../../utils'
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<NSliderProps>(), {
|
|
10
|
+
slider: 'primary',
|
|
11
|
+
})
|
|
12
|
+
const emits = defineEmits<SliderRootEmits>()
|
|
13
|
+
const rootProps = reactiveOmit(props, ['class', 'una', 'slider', 'una'])
|
|
14
|
+
const forwarded = useForwardPropsEmits(rootProps, emits)
|
|
15
|
+
const isVertical = computed(() => props.orientation === 'vertical')
|
|
31
16
|
</script>
|
|
32
17
|
|
|
33
18
|
<template>
|
|
34
19
|
<SliderRoot
|
|
35
20
|
v-slot="{ modelValue }"
|
|
36
21
|
:class="cn(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
)"
|
|
22
|
+
'slider-root',
|
|
23
|
+
isVertical && 'slider-root-vertical',
|
|
24
|
+
props.class,
|
|
25
|
+
props.una?.sliderRoot,
|
|
26
|
+
disabled && 'slider-disabled',
|
|
27
|
+
)"
|
|
43
28
|
v-bind="forwarded"
|
|
44
29
|
:slider="slider"
|
|
45
30
|
>
|
|
46
31
|
<slot name="slider-track">
|
|
47
32
|
<SliderTrack
|
|
48
33
|
:class="cn(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
)"
|
|
34
|
+
'slider-track',
|
|
35
|
+
isVertical && 'slider-track-vertical',
|
|
36
|
+
props.una?.sliderTrack,
|
|
37
|
+
)"
|
|
53
38
|
>
|
|
54
39
|
<slot name="slider-range">
|
|
55
40
|
<SliderRange
|
|
56
41
|
:class="cn(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)"
|
|
42
|
+
'slider-range',
|
|
43
|
+
isVertical && 'slider-range-vertical',
|
|
44
|
+
props.una?.sliderRange,
|
|
45
|
+
)"
|
|
61
46
|
/>
|
|
62
47
|
</slot>
|
|
63
48
|
</SliderTrack>
|
|
@@ -68,10 +53,10 @@ const isVertical = computed(() => props.orientation === "vertical");
|
|
|
68
53
|
v-for="(_, key) in modelValue"
|
|
69
54
|
:key="key"
|
|
70
55
|
:class="cn(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
)"
|
|
56
|
+
'slider-thumb',
|
|
57
|
+
isVertical && 'slider-thumb-vertical',
|
|
58
|
+
props.una?.sliderThumb,
|
|
59
|
+
)"
|
|
75
60
|
/>
|
|
76
61
|
</slot>
|
|
77
62
|
</SliderRoot>
|
|
@@ -1,33 +1,24 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { SwitchRootEmits } from 'reka-ui'
|
|
3
|
+
import type { NSwitchProps } from '../../types'
|
|
4
|
+
import { reactivePick } from '@vueuse/core'
|
|
3
5
|
import {
|
|
4
6
|
SwitchRoot,
|
|
5
7
|
SwitchThumb,
|
|
6
|
-
useForwardPropsEmits
|
|
7
|
-
} from
|
|
8
|
-
import { cn } from
|
|
9
|
-
import NIcon from
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
modelValue: { type: [Boolean, null], required: false },
|
|
21
|
-
disabled: { type: Boolean, required: false },
|
|
22
|
-
id: { type: String, required: false },
|
|
23
|
-
value: { type: String, required: false },
|
|
24
|
-
asChild: { type: Boolean, required: false },
|
|
25
|
-
as: { type: null, required: false },
|
|
26
|
-
name: { type: String, required: false },
|
|
27
|
-
required: { type: Boolean, required: false }
|
|
28
|
-
});
|
|
29
|
-
const emit = defineEmits(["update:modelValue"]);
|
|
30
|
-
const rootPropsEmits = useForwardPropsEmits(reactivePick(props, "as", "asChild", "modelValue", "defaultValue", "disabled", "id", "name", "required", "value"), emit);
|
|
8
|
+
useForwardPropsEmits,
|
|
9
|
+
} from 'reka-ui'
|
|
10
|
+
import { cn } from '../../utils'
|
|
11
|
+
import NIcon from '../elements/Icon.vue'
|
|
12
|
+
|
|
13
|
+
const props = withDefaults(defineProps<NSwitchProps>(), {
|
|
14
|
+
size: 'md',
|
|
15
|
+
switchChecked: '~',
|
|
16
|
+
switchUnchecked: '~',
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
const emit = defineEmits<SwitchRootEmits>()
|
|
20
|
+
|
|
21
|
+
const rootPropsEmits = useForwardPropsEmits(reactivePick(props, 'as', 'asChild', 'modelValue', 'defaultValue', 'disabled', 'id', 'name', 'required', 'value'), emit)
|
|
31
22
|
</script>
|
|
32
23
|
|
|
33
24
|
<template>
|
|
@@ -35,10 +26,12 @@ const rootPropsEmits = useForwardPropsEmits(reactivePick(props, "as", "asChild",
|
|
|
35
26
|
v-slot="{ modelValue }"
|
|
36
27
|
v-bind="rootPropsEmits"
|
|
37
28
|
:class="cn(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
'peer switch',
|
|
30
|
+
una?.switch,
|
|
31
|
+
modelValue
|
|
32
|
+
? una?.switchChecked
|
|
33
|
+
: una?.switchUnchecked,
|
|
34
|
+
)"
|
|
42
35
|
:disabled="disabled || loading"
|
|
43
36
|
:switch-checked
|
|
44
37
|
:switch-unchecked
|
|
@@ -46,28 +39,34 @@ const rootPropsEmits = useForwardPropsEmits(reactivePick(props, "as", "asChild",
|
|
|
46
39
|
>
|
|
47
40
|
<SwitchThumb
|
|
48
41
|
:class="cn(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
'switch-thumb',
|
|
43
|
+
una?.switchThumb,
|
|
44
|
+
modelValue
|
|
45
|
+
? 'switch-thumb-checked'
|
|
46
|
+
: 'switch-thumb-unchecked',
|
|
47
|
+
modelValue
|
|
48
|
+
? una?.switchThumbChecked
|
|
49
|
+
: una?.switchThumbUnchecked,
|
|
50
|
+
)"
|
|
54
51
|
>
|
|
55
52
|
<slot v-if="!loading" name="icon" :model-value>
|
|
56
53
|
<NIcon
|
|
57
54
|
:name="(modelValue ? checkedIcon : uncheckedIcon) || icon"
|
|
58
55
|
:class="cn(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
'switch-icon',
|
|
57
|
+
una?.switchIcon,
|
|
58
|
+
modelValue
|
|
59
|
+
? ['switch-icon-checked', una?.switchIconChecked]
|
|
60
|
+
: ['switch-icon-unchecked', una?.switchIconUnchecked],
|
|
61
|
+
)"
|
|
63
62
|
/>
|
|
64
63
|
</slot>
|
|
65
64
|
<slot v-else name="loading-icon" :model-value>
|
|
66
65
|
<NIcon
|
|
67
66
|
:class="cn(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
)"
|
|
67
|
+
'switch-icon switch-loading-icon',
|
|
68
|
+
una?.switchLoading,
|
|
69
|
+
)"
|
|
71
70
|
:name="una?.switchLoadingIconName || 'switch-loading-icon-name'"
|
|
72
71
|
/>
|
|
73
72
|
</slot>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { Slot } from
|
|
3
|
-
import { useFormField } from
|
|
4
|
-
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { Slot } from 'reka-ui'
|
|
3
|
+
import { useFormField } from '../../../composables/useFormField'
|
|
4
|
+
|
|
5
|
+
const { error, formItemId, formDescriptionId, formMessageId } = useFormField()
|
|
5
6
|
</script>
|
|
6
7
|
|
|
7
8
|
<template>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const { formDescriptionId } = useFormField()
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import type { NFormDescriptionProps } from '../../../types'
|
|
3
|
+
import { useFormField } from '../../../composables/useFormField'
|
|
4
|
+
import { cn } from '../../../utils'
|
|
5
|
+
|
|
6
|
+
const props = defineProps<NFormDescriptionProps>()
|
|
7
|
+
|
|
8
|
+
const { formDescriptionId } = useFormField()
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<template>
|
|
12
12
|
<p
|
|
13
13
|
:id="formDescriptionId"
|
|
14
14
|
:class="cn(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)"
|
|
15
|
+
'form-description',
|
|
16
|
+
props.una?.formDescription,
|
|
17
|
+
props.class,
|
|
18
|
+
)"
|
|
19
19
|
>
|
|
20
20
|
<slot />
|
|
21
21
|
</p>
|