@hanzo/ui 8.0.26 → 8.0.27
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 +1 -1
- package/dist/ThemeToggleNext-AEDLHX5X.js +1 -0
- package/dist/ThemeToggleNext-N6ASYJ6J.cjs +1 -0
- package/dist/backends/gui/aspect-ratio.d.ts +14 -0
- package/dist/backends/gui/avatar.d.ts +16 -0
- package/dist/backends/gui/badge.d.ts +19 -0
- package/dist/backends/gui/button.d.ts +50 -0
- package/dist/backends/gui/card.d.ts +44 -0
- package/dist/backends/gui/checkbox.d.ts +9 -0
- package/dist/backends/gui/collapsible.d.ts +10 -0
- package/dist/backends/gui/command.d.ts +86 -0
- package/dist/backends/gui/command.logic.d.ts +20 -0
- package/dist/backends/gui/dialog.d.ts +27 -0
- package/dist/backends/gui/dropdown-menu.d.ts +98 -0
- package/dist/backends/gui/index.d.ts +24 -2
- package/dist/backends/gui/ink.d.ts +7 -0
- package/dist/backends/gui/input.d.ts +19 -0
- package/dist/backends/gui/label.d.ts +6 -0
- package/dist/backends/gui/popover.d.ts +22 -0
- package/dist/backends/gui/progress.d.ts +6 -0
- package/dist/backends/gui/resizable.d.ts +52 -0
- package/dist/backends/gui/resizable.logic.d.ts +23 -0
- package/dist/backends/gui/scroll-area.d.ts +45 -0
- package/dist/backends/gui/select.d.ts +30 -0
- package/dist/backends/gui/separator.d.ts +10 -0
- package/dist/backends/gui/slider.d.ts +6 -0
- package/dist/backends/gui/slot.d.ts +6 -0
- package/dist/backends/gui/switch.d.ts +6 -0
- package/dist/backends/gui/tabs.d.ts +12 -0
- package/dist/backends/gui/textarea.d.ts +11 -0
- package/dist/backends/gui/toaster.d.ts +28 -0
- package/dist/backends/gui/tooltip.d.ts +12 -0
- package/dist/canvas.cjs +1 -0
- package/dist/canvas.js +1 -0
- package/dist/chunk-2U3MNE4I.js +4 -0
- package/dist/chunk-2U3MNE4I.js.map +1 -0
- package/dist/chunk-3NG33DV2.cjs +1 -0
- package/dist/chunk-6DDY6XZI.js +53 -0
- package/dist/chunk-6DDY6XZI.js.map +1 -0
- package/dist/chunk-6KZWRBK2.cjs +1498 -0
- package/dist/chunk-6KZWRBK2.cjs.map +1 -0
- package/dist/chunk-77AMCLN4.js +1 -0
- package/dist/chunk-7XDEUEWI.cjs +1 -0
- package/dist/chunk-7ZNK6JSS.js +1 -0
- package/dist/chunk-ARV3P4CE.cjs +1 -0
- package/dist/chunk-DC52DQ27.cjs +303 -0
- package/dist/chunk-DC52DQ27.cjs.map +1 -0
- package/dist/chunk-FVQXROBK.js +1 -0
- package/dist/chunk-GVCOAJLO.js +1 -0
- package/dist/chunk-MWBFAV3D.cjs +1 -0
- package/dist/chunk-NQUA5YRQ.cjs +55 -0
- package/dist/chunk-NQUA5YRQ.cjs.map +1 -0
- package/dist/chunk-ONVERVFG.cjs +1 -0
- package/dist/chunk-P2QU5MN5.js +1 -0
- package/dist/chunk-PI3GSHLU.js +263 -0
- package/dist/chunk-PI3GSHLU.js.map +1 -0
- package/dist/chunk-QHC2ZNAF.js +11 -0
- package/dist/chunk-QHC2ZNAF.js.map +1 -0
- package/dist/chunk-QV52JQHR.cjs +77 -0
- package/dist/chunk-QV52JQHR.cjs.map +1 -0
- package/dist/chunk-RBS5AYO4.cjs +13 -0
- package/dist/chunk-RBS5AYO4.cjs.map +1 -0
- package/dist/chunk-RCMDRI6V.js +1401 -0
- package/dist/chunk-RCMDRI6V.js.map +1 -0
- package/dist/chunk-WHJR5S4L.cjs +1 -0
- package/dist/chunk-ZGTJCJ55.js +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/core/cn.d.ts +3 -5
- package/dist/core/index.cjs +92 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.js +14 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/tokens.cjs +77 -0
- package/dist/core/tokens.cjs.map +1 -0
- package/dist/core/tokens.js +4 -0
- package/dist/core/tokens.js.map +1 -0
- package/dist/dashboard.cjs +1 -0
- package/dist/dashboard.js +1 -0
- package/dist/data.cjs +1 -0
- package/dist/data.js +1 -0
- package/dist/framework/core.cjs +1 -0
- package/dist/framework/core.js +1 -0
- package/dist/framework/index.cjs +5 -3
- package/dist/framework/index.cjs.map +1 -1
- package/dist/framework/index.js +3 -1
- package/dist/framework/index.js.map +1 -1
- package/dist/gitops.cjs +1 -0
- package/dist/gitops.js +1 -0
- package/dist/gui-config.cjs +1 -0
- package/dist/gui-config.js +1 -0
- package/dist/index.cjs +366 -1136
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -1017
- package/dist/index.js.map +1 -1
- package/dist/models/catalog.d.ts +1 -1
- package/dist/models/index.cjs +225 -0
- package/dist/models/index.cjs.map +1 -0
- package/dist/models/index.js +218 -0
- package/dist/models/index.js.map +1 -0
- package/dist/oss.cjs +1 -0
- package/dist/oss.js +1 -0
- package/dist/primitives/AspectRatio.cjs +14 -0
- package/dist/primitives/AspectRatio.cjs.map +1 -0
- package/dist/primitives/AspectRatio.d.ts +1 -1
- package/dist/primitives/AspectRatio.js +5 -0
- package/dist/primitives/AspectRatio.js.map +1 -0
- package/dist/primitives/Avatar.cjs +14 -0
- package/dist/primitives/Avatar.cjs.map +1 -0
- package/dist/primitives/Avatar.d.ts +1 -1
- package/dist/primitives/Avatar.js +5 -0
- package/dist/primitives/Avatar.js.map +1 -0
- package/dist/primitives/AvatarFallback.cjs +14 -0
- package/dist/primitives/AvatarFallback.cjs.map +1 -0
- package/dist/primitives/AvatarFallback.d.ts +1 -1
- package/dist/primitives/AvatarFallback.js +5 -0
- package/dist/primitives/AvatarFallback.js.map +1 -0
- package/dist/primitives/AvatarImage.cjs +14 -0
- package/dist/primitives/AvatarImage.cjs.map +1 -0
- package/dist/primitives/AvatarImage.d.ts +1 -1
- package/dist/primitives/AvatarImage.js +5 -0
- package/dist/primitives/AvatarImage.js.map +1 -0
- package/dist/primitives/Badge.cjs +14 -0
- package/dist/primitives/Badge.cjs.map +1 -0
- package/dist/primitives/Badge.d.ts +1 -1
- package/dist/primitives/Badge.js +5 -0
- package/dist/primitives/Badge.js.map +1 -0
- package/dist/primitives/Button.cjs +14 -0
- package/dist/primitives/Button.cjs.map +1 -0
- package/dist/primitives/Button.d.ts +1 -1
- package/dist/primitives/Button.js +5 -0
- package/dist/primitives/Button.js.map +1 -0
- package/dist/primitives/Card.cjs +14 -0
- package/dist/primitives/Card.cjs.map +1 -0
- package/dist/primitives/Card.d.ts +1 -1
- package/dist/primitives/Card.js +5 -0
- package/dist/primitives/Card.js.map +1 -0
- package/dist/primitives/CardAction.cjs +14 -0
- package/dist/primitives/CardAction.cjs.map +1 -0
- package/dist/primitives/CardAction.d.ts +1 -1
- package/dist/primitives/CardAction.js +5 -0
- package/dist/primitives/CardAction.js.map +1 -0
- package/dist/primitives/CardContent.cjs +14 -0
- package/dist/primitives/CardContent.cjs.map +1 -0
- package/dist/primitives/CardContent.d.ts +1 -1
- package/dist/primitives/CardContent.js +5 -0
- package/dist/primitives/CardContent.js.map +1 -0
- package/dist/primitives/CardDescription.cjs +14 -0
- package/dist/primitives/CardDescription.cjs.map +1 -0
- package/dist/primitives/CardDescription.d.ts +1 -1
- package/dist/primitives/CardDescription.js +5 -0
- package/dist/primitives/CardDescription.js.map +1 -0
- package/dist/primitives/CardFooter.cjs +14 -0
- package/dist/primitives/CardFooter.cjs.map +1 -0
- package/dist/primitives/CardFooter.d.ts +1 -1
- package/dist/primitives/CardFooter.js +5 -0
- package/dist/primitives/CardFooter.js.map +1 -0
- package/dist/primitives/CardHeader.cjs +14 -0
- package/dist/primitives/CardHeader.cjs.map +1 -0
- package/dist/primitives/CardHeader.d.ts +1 -1
- package/dist/primitives/CardHeader.js +5 -0
- package/dist/primitives/CardHeader.js.map +1 -0
- package/dist/primitives/CardTitle.cjs +14 -0
- package/dist/primitives/CardTitle.cjs.map +1 -0
- package/dist/primitives/CardTitle.d.ts +1 -1
- package/dist/primitives/CardTitle.js +5 -0
- package/dist/primitives/CardTitle.js.map +1 -0
- package/dist/primitives/Checkbox.cjs +14 -0
- package/dist/primitives/Checkbox.cjs.map +1 -0
- package/dist/primitives/Checkbox.d.ts +1 -1
- package/dist/primitives/Checkbox.js +5 -0
- package/dist/primitives/Checkbox.js.map +1 -0
- package/dist/primitives/Collapsible.cjs +14 -0
- package/dist/primitives/Collapsible.cjs.map +1 -0
- package/dist/primitives/Collapsible.d.ts +1 -1
- package/dist/primitives/Collapsible.js +5 -0
- package/dist/primitives/Collapsible.js.map +1 -0
- package/dist/primitives/CollapsibleContent.cjs +14 -0
- package/dist/primitives/CollapsibleContent.cjs.map +1 -0
- package/dist/primitives/CollapsibleContent.d.ts +1 -1
- package/dist/primitives/CollapsibleContent.js +5 -0
- package/dist/primitives/CollapsibleContent.js.map +1 -0
- package/dist/primitives/CollapsibleTrigger.cjs +14 -0
- package/dist/primitives/CollapsibleTrigger.cjs.map +1 -0
- package/dist/primitives/CollapsibleTrigger.d.ts +1 -1
- package/dist/primitives/CollapsibleTrigger.js +5 -0
- package/dist/primitives/CollapsibleTrigger.js.map +1 -0
- package/dist/primitives/Command.cjs +14 -0
- package/dist/primitives/Command.cjs.map +1 -0
- package/dist/primitives/Command.d.ts +1 -1
- package/dist/primitives/Command.js +5 -0
- package/dist/primitives/Command.js.map +1 -0
- package/dist/primitives/CommandDialog.cjs +14 -0
- package/dist/primitives/CommandDialog.cjs.map +1 -0
- package/dist/primitives/CommandDialog.d.ts +1 -1
- package/dist/primitives/CommandDialog.js +5 -0
- package/dist/primitives/CommandDialog.js.map +1 -0
- package/dist/primitives/CommandEmpty.cjs +14 -0
- package/dist/primitives/CommandEmpty.cjs.map +1 -0
- package/dist/primitives/CommandEmpty.d.ts +1 -1
- package/dist/primitives/CommandEmpty.js +5 -0
- package/dist/primitives/CommandEmpty.js.map +1 -0
- package/dist/primitives/CommandGroup.cjs +14 -0
- package/dist/primitives/CommandGroup.cjs.map +1 -0
- package/dist/primitives/CommandGroup.d.ts +1 -1
- package/dist/primitives/CommandGroup.js +5 -0
- package/dist/primitives/CommandGroup.js.map +1 -0
- package/dist/primitives/CommandInput.cjs +14 -0
- package/dist/primitives/CommandInput.cjs.map +1 -0
- package/dist/primitives/CommandInput.d.ts +1 -1
- package/dist/primitives/CommandInput.js +5 -0
- package/dist/primitives/CommandInput.js.map +1 -0
- package/dist/primitives/CommandItem.cjs +14 -0
- package/dist/primitives/CommandItem.cjs.map +1 -0
- package/dist/primitives/CommandItem.d.ts +1 -1
- package/dist/primitives/CommandItem.js +5 -0
- package/dist/primitives/CommandItem.js.map +1 -0
- package/dist/primitives/CommandList.cjs +14 -0
- package/dist/primitives/CommandList.cjs.map +1 -0
- package/dist/primitives/CommandList.d.ts +1 -1
- package/dist/primitives/CommandList.js +5 -0
- package/dist/primitives/CommandList.js.map +1 -0
- package/dist/primitives/CommandSeparator.cjs +14 -0
- package/dist/primitives/CommandSeparator.cjs.map +1 -0
- package/dist/primitives/CommandSeparator.d.ts +1 -1
- package/dist/primitives/CommandSeparator.js +5 -0
- package/dist/primitives/CommandSeparator.js.map +1 -0
- package/dist/primitives/CommandShortcut.cjs +14 -0
- package/dist/primitives/CommandShortcut.cjs.map +1 -0
- package/dist/primitives/CommandShortcut.d.ts +1 -1
- package/dist/primitives/CommandShortcut.js +5 -0
- package/dist/primitives/CommandShortcut.js.map +1 -0
- package/dist/primitives/Dialog.cjs +14 -0
- package/dist/primitives/Dialog.cjs.map +1 -0
- package/dist/primitives/Dialog.d.ts +1 -1
- package/dist/primitives/Dialog.js +5 -0
- package/dist/primitives/Dialog.js.map +1 -0
- package/dist/primitives/DialogClose.cjs +14 -0
- package/dist/primitives/DialogClose.cjs.map +1 -0
- package/dist/primitives/DialogClose.d.ts +1 -1
- package/dist/primitives/DialogClose.js +5 -0
- package/dist/primitives/DialogClose.js.map +1 -0
- package/dist/primitives/DialogContent.cjs +14 -0
- package/dist/primitives/DialogContent.cjs.map +1 -0
- package/dist/primitives/DialogContent.d.ts +1 -1
- package/dist/primitives/DialogContent.js +5 -0
- package/dist/primitives/DialogContent.js.map +1 -0
- package/dist/primitives/DialogDescription.cjs +14 -0
- package/dist/primitives/DialogDescription.cjs.map +1 -0
- package/dist/primitives/DialogDescription.d.ts +1 -1
- package/dist/primitives/DialogDescription.js +5 -0
- package/dist/primitives/DialogDescription.js.map +1 -0
- package/dist/primitives/DialogFooter.cjs +14 -0
- package/dist/primitives/DialogFooter.cjs.map +1 -0
- package/dist/primitives/DialogFooter.d.ts +1 -1
- package/dist/primitives/DialogFooter.js +5 -0
- package/dist/primitives/DialogFooter.js.map +1 -0
- package/dist/primitives/DialogHeader.cjs +14 -0
- package/dist/primitives/DialogHeader.cjs.map +1 -0
- package/dist/primitives/DialogHeader.d.ts +1 -1
- package/dist/primitives/DialogHeader.js +5 -0
- package/dist/primitives/DialogHeader.js.map +1 -0
- package/dist/primitives/DialogOverlay.cjs +14 -0
- package/dist/primitives/DialogOverlay.cjs.map +1 -0
- package/dist/primitives/DialogOverlay.d.ts +1 -1
- package/dist/primitives/DialogOverlay.js +5 -0
- package/dist/primitives/DialogOverlay.js.map +1 -0
- package/dist/primitives/DialogPortal.cjs +14 -0
- package/dist/primitives/DialogPortal.cjs.map +1 -0
- package/dist/primitives/DialogPortal.d.ts +1 -1
- package/dist/primitives/DialogPortal.js +5 -0
- package/dist/primitives/DialogPortal.js.map +1 -0
- package/dist/primitives/DialogTitle.cjs +14 -0
- package/dist/primitives/DialogTitle.cjs.map +1 -0
- package/dist/primitives/DialogTitle.d.ts +1 -1
- package/dist/primitives/DialogTitle.js +5 -0
- package/dist/primitives/DialogTitle.js.map +1 -0
- package/dist/primitives/DialogTrigger.cjs +14 -0
- package/dist/primitives/DialogTrigger.cjs.map +1 -0
- package/dist/primitives/DialogTrigger.d.ts +1 -1
- package/dist/primitives/DialogTrigger.js +5 -0
- package/dist/primitives/DialogTrigger.js.map +1 -0
- package/dist/primitives/DropdownMenu.cjs +14 -0
- package/dist/primitives/DropdownMenu.cjs.map +1 -0
- package/dist/primitives/DropdownMenu.d.ts +1 -1
- package/dist/primitives/DropdownMenu.js +5 -0
- package/dist/primitives/DropdownMenu.js.map +1 -0
- package/dist/primitives/DropdownMenuCheckboxItem.cjs +14 -0
- package/dist/primitives/DropdownMenuCheckboxItem.cjs.map +1 -0
- package/dist/primitives/DropdownMenuCheckboxItem.d.ts +1 -1
- package/dist/primitives/DropdownMenuCheckboxItem.js +5 -0
- package/dist/primitives/DropdownMenuCheckboxItem.js.map +1 -0
- package/dist/primitives/DropdownMenuContent.cjs +14 -0
- package/dist/primitives/DropdownMenuContent.cjs.map +1 -0
- package/dist/primitives/DropdownMenuContent.d.ts +1 -1
- package/dist/primitives/DropdownMenuContent.js +5 -0
- package/dist/primitives/DropdownMenuContent.js.map +1 -0
- package/dist/primitives/DropdownMenuGroup.cjs +14 -0
- package/dist/primitives/DropdownMenuGroup.cjs.map +1 -0
- package/dist/primitives/DropdownMenuGroup.d.ts +1 -1
- package/dist/primitives/DropdownMenuGroup.js +5 -0
- package/dist/primitives/DropdownMenuGroup.js.map +1 -0
- package/dist/primitives/DropdownMenuItem.cjs +14 -0
- package/dist/primitives/DropdownMenuItem.cjs.map +1 -0
- package/dist/primitives/DropdownMenuItem.d.ts +1 -1
- package/dist/primitives/DropdownMenuItem.js +5 -0
- package/dist/primitives/DropdownMenuItem.js.map +1 -0
- package/dist/primitives/DropdownMenuLabel.cjs +14 -0
- package/dist/primitives/DropdownMenuLabel.cjs.map +1 -0
- package/dist/primitives/DropdownMenuLabel.d.ts +1 -1
- package/dist/primitives/DropdownMenuLabel.js +5 -0
- package/dist/primitives/DropdownMenuLabel.js.map +1 -0
- package/dist/primitives/DropdownMenuPortal.cjs +14 -0
- package/dist/primitives/DropdownMenuPortal.cjs.map +1 -0
- package/dist/primitives/DropdownMenuPortal.d.ts +1 -1
- package/dist/primitives/DropdownMenuPortal.js +5 -0
- package/dist/primitives/DropdownMenuPortal.js.map +1 -0
- package/dist/primitives/DropdownMenuRadioGroup.cjs +14 -0
- package/dist/primitives/DropdownMenuRadioGroup.cjs.map +1 -0
- package/dist/primitives/DropdownMenuRadioGroup.d.ts +1 -1
- package/dist/primitives/DropdownMenuRadioGroup.js +5 -0
- package/dist/primitives/DropdownMenuRadioGroup.js.map +1 -0
- package/dist/primitives/DropdownMenuRadioItem.cjs +14 -0
- package/dist/primitives/DropdownMenuRadioItem.cjs.map +1 -0
- package/dist/primitives/DropdownMenuRadioItem.d.ts +1 -1
- package/dist/primitives/DropdownMenuRadioItem.js +5 -0
- package/dist/primitives/DropdownMenuRadioItem.js.map +1 -0
- package/dist/primitives/DropdownMenuSeparator.cjs +14 -0
- package/dist/primitives/DropdownMenuSeparator.cjs.map +1 -0
- package/dist/primitives/DropdownMenuSeparator.d.ts +1 -1
- package/dist/primitives/DropdownMenuSeparator.js +5 -0
- package/dist/primitives/DropdownMenuSeparator.js.map +1 -0
- package/dist/primitives/DropdownMenuShortcut.cjs +14 -0
- package/dist/primitives/DropdownMenuShortcut.cjs.map +1 -0
- package/dist/primitives/DropdownMenuShortcut.d.ts +1 -1
- package/dist/primitives/DropdownMenuShortcut.js +5 -0
- package/dist/primitives/DropdownMenuShortcut.js.map +1 -0
- package/dist/primitives/DropdownMenuSub.cjs +14 -0
- package/dist/primitives/DropdownMenuSub.cjs.map +1 -0
- package/dist/primitives/DropdownMenuSub.d.ts +1 -1
- package/dist/primitives/DropdownMenuSub.js +5 -0
- package/dist/primitives/DropdownMenuSub.js.map +1 -0
- package/dist/primitives/DropdownMenuSubContent.cjs +14 -0
- package/dist/primitives/DropdownMenuSubContent.cjs.map +1 -0
- package/dist/primitives/DropdownMenuSubContent.d.ts +1 -1
- package/dist/primitives/DropdownMenuSubContent.js +5 -0
- package/dist/primitives/DropdownMenuSubContent.js.map +1 -0
- package/dist/primitives/DropdownMenuSubTrigger.cjs +14 -0
- package/dist/primitives/DropdownMenuSubTrigger.cjs.map +1 -0
- package/dist/primitives/DropdownMenuSubTrigger.d.ts +1 -1
- package/dist/primitives/DropdownMenuSubTrigger.js +5 -0
- package/dist/primitives/DropdownMenuSubTrigger.js.map +1 -0
- package/dist/primitives/DropdownMenuTrigger.cjs +14 -0
- package/dist/primitives/DropdownMenuTrigger.cjs.map +1 -0
- package/dist/primitives/DropdownMenuTrigger.d.ts +1 -1
- package/dist/primitives/DropdownMenuTrigger.js +5 -0
- package/dist/primitives/DropdownMenuTrigger.js.map +1 -0
- package/dist/primitives/Input.cjs +14 -0
- package/dist/primitives/Input.cjs.map +1 -0
- package/dist/primitives/Input.d.ts +1 -1
- package/dist/primitives/Input.js +5 -0
- package/dist/primitives/Input.js.map +1 -0
- package/dist/primitives/Label.cjs +14 -0
- package/dist/primitives/Label.cjs.map +1 -0
- package/dist/primitives/Label.d.ts +1 -1
- package/dist/primitives/Label.js +5 -0
- package/dist/primitives/Label.js.map +1 -0
- package/dist/primitives/Popover.cjs +14 -0
- package/dist/primitives/Popover.cjs.map +1 -0
- package/dist/primitives/Popover.d.ts +1 -1
- package/dist/primitives/Popover.js +5 -0
- package/dist/primitives/Popover.js.map +1 -0
- package/dist/primitives/PopoverAnchor.cjs +14 -0
- package/dist/primitives/PopoverAnchor.cjs.map +1 -0
- package/dist/primitives/PopoverAnchor.d.ts +1 -1
- package/dist/primitives/PopoverAnchor.js +5 -0
- package/dist/primitives/PopoverAnchor.js.map +1 -0
- package/dist/primitives/PopoverClose.cjs +14 -0
- package/dist/primitives/PopoverClose.cjs.map +1 -0
- package/dist/primitives/PopoverClose.d.ts +1 -0
- package/dist/primitives/PopoverClose.js +5 -0
- package/dist/primitives/PopoverClose.js.map +1 -0
- package/dist/primitives/PopoverContent.cjs +14 -0
- package/dist/primitives/PopoverContent.cjs.map +1 -0
- package/dist/primitives/PopoverContent.d.ts +1 -1
- package/dist/primitives/PopoverContent.js +5 -0
- package/dist/primitives/PopoverContent.js.map +1 -0
- package/dist/primitives/PopoverTrigger.cjs +14 -0
- package/dist/primitives/PopoverTrigger.cjs.map +1 -0
- package/dist/primitives/PopoverTrigger.d.ts +1 -1
- package/dist/primitives/PopoverTrigger.js +5 -0
- package/dist/primitives/PopoverTrigger.js.map +1 -0
- package/dist/primitives/Progress.cjs +14 -0
- package/dist/primitives/Progress.cjs.map +1 -0
- package/dist/primitives/Progress.d.ts +1 -1
- package/dist/primitives/Progress.js +5 -0
- package/dist/primitives/Progress.js.map +1 -0
- package/dist/primitives/ResizableHandle.cjs +14 -0
- package/dist/primitives/ResizableHandle.cjs.map +1 -0
- package/dist/primitives/ResizableHandle.d.ts +1 -0
- package/dist/primitives/ResizableHandle.js +5 -0
- package/dist/primitives/ResizableHandle.js.map +1 -0
- package/dist/primitives/ResizablePanel.cjs +14 -0
- package/dist/primitives/ResizablePanel.cjs.map +1 -0
- package/dist/primitives/ResizablePanel.d.ts +1 -0
- package/dist/primitives/ResizablePanel.js +5 -0
- package/dist/primitives/ResizablePanel.js.map +1 -0
- package/dist/primitives/ResizablePanelGroup.cjs +14 -0
- package/dist/primitives/ResizablePanelGroup.cjs.map +1 -0
- package/dist/primitives/ResizablePanelGroup.d.ts +1 -0
- package/dist/primitives/ResizablePanelGroup.js +5 -0
- package/dist/primitives/ResizablePanelGroup.js.map +1 -0
- package/dist/primitives/ScrollArea.cjs +14 -0
- package/dist/primitives/ScrollArea.cjs.map +1 -0
- package/dist/primitives/ScrollArea.d.ts +1 -1
- package/dist/primitives/ScrollArea.js +5 -0
- package/dist/primitives/ScrollArea.js.map +1 -0
- package/dist/primitives/ScrollBar.cjs +14 -0
- package/dist/primitives/ScrollBar.cjs.map +1 -0
- package/dist/primitives/ScrollBar.d.ts +1 -1
- package/dist/primitives/ScrollBar.js +5 -0
- package/dist/primitives/ScrollBar.js.map +1 -0
- package/dist/primitives/Select.cjs +14 -0
- package/dist/primitives/Select.cjs.map +1 -0
- package/dist/primitives/Select.d.ts +1 -1
- package/dist/primitives/Select.js +5 -0
- package/dist/primitives/Select.js.map +1 -0
- package/dist/primitives/SelectContent.cjs +14 -0
- package/dist/primitives/SelectContent.cjs.map +1 -0
- package/dist/primitives/SelectContent.d.ts +1 -1
- package/dist/primitives/SelectContent.js +5 -0
- package/dist/primitives/SelectContent.js.map +1 -0
- package/dist/primitives/SelectGroup.cjs +14 -0
- package/dist/primitives/SelectGroup.cjs.map +1 -0
- package/dist/primitives/SelectGroup.d.ts +1 -1
- package/dist/primitives/SelectGroup.js +5 -0
- package/dist/primitives/SelectGroup.js.map +1 -0
- package/dist/primitives/SelectItem.cjs +14 -0
- package/dist/primitives/SelectItem.cjs.map +1 -0
- package/dist/primitives/SelectItem.d.ts +1 -1
- package/dist/primitives/SelectItem.js +5 -0
- package/dist/primitives/SelectItem.js.map +1 -0
- package/dist/primitives/SelectLabel.cjs +14 -0
- package/dist/primitives/SelectLabel.cjs.map +1 -0
- package/dist/primitives/SelectLabel.d.ts +1 -1
- package/dist/primitives/SelectLabel.js +5 -0
- package/dist/primitives/SelectLabel.js.map +1 -0
- package/dist/primitives/SelectScrollDownButton.cjs +14 -0
- package/dist/primitives/SelectScrollDownButton.cjs.map +1 -0
- package/dist/primitives/SelectScrollDownButton.d.ts +1 -1
- package/dist/primitives/SelectScrollDownButton.js +5 -0
- package/dist/primitives/SelectScrollDownButton.js.map +1 -0
- package/dist/primitives/SelectScrollUpButton.cjs +14 -0
- package/dist/primitives/SelectScrollUpButton.cjs.map +1 -0
- package/dist/primitives/SelectScrollUpButton.d.ts +1 -1
- package/dist/primitives/SelectScrollUpButton.js +5 -0
- package/dist/primitives/SelectScrollUpButton.js.map +1 -0
- package/dist/primitives/SelectSeparator.cjs +14 -0
- package/dist/primitives/SelectSeparator.cjs.map +1 -0
- package/dist/primitives/SelectSeparator.d.ts +1 -1
- package/dist/primitives/SelectSeparator.js +5 -0
- package/dist/primitives/SelectSeparator.js.map +1 -0
- package/dist/primitives/SelectTrigger.cjs +14 -0
- package/dist/primitives/SelectTrigger.cjs.map +1 -0
- package/dist/primitives/SelectTrigger.d.ts +1 -1
- package/dist/primitives/SelectTrigger.js +5 -0
- package/dist/primitives/SelectTrigger.js.map +1 -0
- package/dist/primitives/SelectValue.cjs +14 -0
- package/dist/primitives/SelectValue.cjs.map +1 -0
- package/dist/primitives/SelectValue.d.ts +1 -1
- package/dist/primitives/SelectValue.js +5 -0
- package/dist/primitives/SelectValue.js.map +1 -0
- package/dist/primitives/Separator.cjs +14 -0
- package/dist/primitives/Separator.cjs.map +1 -0
- package/dist/primitives/Separator.d.ts +1 -1
- package/dist/primitives/Separator.js +5 -0
- package/dist/primitives/Separator.js.map +1 -0
- package/dist/primitives/Slider.cjs +14 -0
- package/dist/primitives/Slider.cjs.map +1 -0
- package/dist/primitives/Slider.d.ts +1 -1
- package/dist/primitives/Slider.js +5 -0
- package/dist/primitives/Slider.js.map +1 -0
- package/dist/primitives/Switch.cjs +14 -0
- package/dist/primitives/Switch.cjs.map +1 -0
- package/dist/primitives/Switch.d.ts +1 -1
- package/dist/primitives/Switch.js +5 -0
- package/dist/primitives/Switch.js.map +1 -0
- package/dist/primitives/Tabs.cjs +14 -0
- package/dist/primitives/Tabs.cjs.map +1 -0
- package/dist/primitives/Tabs.d.ts +1 -1
- package/dist/primitives/Tabs.js +5 -0
- package/dist/primitives/Tabs.js.map +1 -0
- package/dist/primitives/TabsContent.cjs +14 -0
- package/dist/primitives/TabsContent.cjs.map +1 -0
- package/dist/primitives/TabsContent.d.ts +1 -1
- package/dist/primitives/TabsContent.js +5 -0
- package/dist/primitives/TabsContent.js.map +1 -0
- package/dist/primitives/TabsList.cjs +14 -0
- package/dist/primitives/TabsList.cjs.map +1 -0
- package/dist/primitives/TabsList.d.ts +1 -1
- package/dist/primitives/TabsList.js +5 -0
- package/dist/primitives/TabsList.js.map +1 -0
- package/dist/primitives/TabsTrigger.cjs +14 -0
- package/dist/primitives/TabsTrigger.cjs.map +1 -0
- package/dist/primitives/TabsTrigger.d.ts +1 -1
- package/dist/primitives/TabsTrigger.js +5 -0
- package/dist/primitives/TabsTrigger.js.map +1 -0
- package/dist/primitives/Textarea.cjs +14 -0
- package/dist/primitives/Textarea.cjs.map +1 -0
- package/dist/primitives/Textarea.d.ts +1 -1
- package/dist/primitives/Textarea.js +5 -0
- package/dist/primitives/Textarea.js.map +1 -0
- package/dist/primitives/Toaster.cjs +14 -0
- package/dist/primitives/Toaster.cjs.map +1 -0
- package/dist/primitives/Toaster.d.ts +1 -1
- package/dist/primitives/Toaster.js +5 -0
- package/dist/primitives/Toaster.js.map +1 -0
- package/dist/primitives/Tooltip.cjs +14 -0
- package/dist/primitives/Tooltip.cjs.map +1 -0
- package/dist/primitives/Tooltip.d.ts +1 -1
- package/dist/primitives/Tooltip.js +5 -0
- package/dist/primitives/Tooltip.js.map +1 -0
- package/dist/primitives/TooltipContent.cjs +14 -0
- package/dist/primitives/TooltipContent.cjs.map +1 -0
- package/dist/primitives/TooltipContent.d.ts +1 -1
- package/dist/primitives/TooltipContent.js +5 -0
- package/dist/primitives/TooltipContent.js.map +1 -0
- package/dist/primitives/TooltipProvider.cjs +14 -0
- package/dist/primitives/TooltipProvider.cjs.map +1 -0
- package/dist/primitives/TooltipProvider.d.ts +1 -1
- package/dist/primitives/TooltipProvider.js +5 -0
- package/dist/primitives/TooltipProvider.js.map +1 -0
- package/dist/primitives/TooltipTrigger.cjs +14 -0
- package/dist/primitives/TooltipTrigger.cjs.map +1 -0
- package/dist/primitives/TooltipTrigger.d.ts +1 -1
- package/dist/primitives/TooltipTrigger.js +5 -0
- package/dist/primitives/TooltipTrigger.js.map +1 -0
- package/dist/primitives/badgeVariants.cjs +14 -0
- package/dist/primitives/badgeVariants.cjs.map +1 -0
- package/dist/primitives/badgeVariants.d.ts +1 -1
- package/dist/primitives/badgeVariants.js +5 -0
- package/dist/primitives/badgeVariants.js.map +1 -0
- package/dist/primitives/bases/data/index.cjs +1 -0
- package/dist/primitives/bases/data/index.js +1 -0
- package/dist/primitives/buttonVariants.cjs +14 -0
- package/dist/primitives/buttonVariants.cjs.map +1 -0
- package/dist/primitives/buttonVariants.d.ts +1 -1
- package/dist/primitives/buttonVariants.js +5 -0
- package/dist/primitives/buttonVariants.js.map +1 -0
- package/dist/primitives/index.cjs +370 -0
- package/dist/primitives/index.cjs.map +1 -0
- package/dist/primitives/index.d.ts +1 -1
- package/dist/primitives/index.js +5 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/primitives/toast.cjs +14 -0
- package/dist/primitives/toast.cjs.map +1 -0
- package/dist/primitives/toast.d.ts +1 -1
- package/dist/primitives/toast.js +5 -0
- package/dist/primitives/toast.js.map +1 -0
- package/dist/product/index.cjs +285 -35
- package/dist/product/index.cjs.map +1 -1
- package/dist/product/index.d.ts +1 -0
- package/dist/product/index.js +265 -9
- package/dist/product/index.js.map +1 -1
- package/dist/product/menu/index.d.ts +1 -1
- package/dist/product/social/api.cjs +1 -0
- package/dist/product/social/api.js +1 -0
- package/dist/product/social/index.cjs +1 -0
- package/dist/product/social/index.js +1 -0
- package/dist/styles/hanzo-motion.css +188 -0
- package/dist/telemetry.cjs +1 -0
- package/dist/telemetry.js +1 -0
- package/dist/theme.css +160 -0
- package/dist/usage.cjs +1 -0
- package/dist/usage.js +1 -0
- package/package.json +31 -71
- package/dist/backends/shadcn/aspect-ratio.d.ts +0 -4
- package/dist/backends/shadcn/avatar.d.ts +0 -6
- package/dist/backends/shadcn/badge.d.ts +0 -9
- package/dist/backends/shadcn/button.d.ts +0 -19
- package/dist/backends/shadcn/card.d.ts +0 -9
- package/dist/backends/shadcn/checkbox.d.ts +0 -9
- package/dist/backends/shadcn/collapsible.d.ts +0 -5
- package/dist/backends/shadcn/command.d.ts +0 -80
- package/dist/backends/shadcn/dialog.d.ts +0 -15
- package/dist/backends/shadcn/dropdown-menu.d.ts +0 -34
- package/dist/backends/shadcn/index.d.ts +0 -23
- package/dist/backends/shadcn/input.d.ts +0 -11
- package/dist/backends/shadcn/label.d.ts +0 -4
- package/dist/backends/shadcn/popover.d.ts +0 -7
- package/dist/backends/shadcn/progress.d.ts +0 -4
- package/dist/backends/shadcn/scroll-area.d.ts +0 -5
- package/dist/backends/shadcn/select.d.ts +0 -13
- package/dist/backends/shadcn/separator.d.ts +0 -4
- package/dist/backends/shadcn/slider.d.ts +0 -4
- package/dist/backends/shadcn/switch.d.ts +0 -4
- package/dist/backends/shadcn/tabs.d.ts +0 -7
- package/dist/backends/shadcn/textarea.d.ts +0 -4
- package/dist/backends/shadcn/toaster.d.ts +0 -10
- package/dist/backends/shadcn/tooltip.d.ts +0 -7
- package/dist/backends/shadcn/utils.d.ts +0 -8
- package/dist/billing.cjs +0 -14
- package/dist/billing.cjs.map +0 -1
- package/dist/billing.d.ts +0 -1
- package/dist/billing.js +0 -3
- package/dist/billing.js.map +0 -1
- package/dist/chunk-5CZOYONP.js +0 -342
- package/dist/chunk-5CZOYONP.js.map +0 -1
- package/dist/chunk-GWNNLYX4.cjs +0 -352
- package/dist/chunk-GWNNLYX4.cjs.map +0 -1
- package/dist/network.cjs +0 -14
- package/dist/network.cjs.map +0 -1
- package/dist/network.d.ts +0 -1
- package/dist/network.js +0 -3
- package/dist/network.js.map +0 -1
- package/dist/product/menu/DropdownMenu.d.ts +0 -29
- package/dist/wallet.cjs +0 -14
- package/dist/wallet.cjs.map +0 -1
- package/dist/wallet.d.ts +0 -1
- package/dist/wallet.js +0 -3
- package/dist/wallet.js.map +0 -1
|
@@ -0,0 +1,1401 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useThemeName, PortalTheme } from './chunk-PI3GSHLU.js';
|
|
3
|
+
import { styled, XStack, SizableText, Button as Button$1, YStack, Dialog, Popover as Popover$1, Select as Select$1, Tooltip as Tooltip$1, createStyledContext, TooltipGroup, Avatar as Avatar$1, Spinner, Checkbox as Checkbox$1, Collapsible as Collapsible$1, isWeb, DialogPortal, DialogOverlay, DialogContent, VisuallyHidden, DialogTitle, DialogDescription, Input, ScrollView, Separator, ListItem, Label as Label$1, Progress as Progress$1, SelectSeparator as SelectSeparator$1, Slider as Slider$1, Switch as Switch$1, Tabs as Tabs$1, TextArea } from '@hanzo/gui';
|
|
4
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { forwardRef, useRef, useReducer, useState, useCallback, useMemo, useEffect, useId, useContext, Children, isValidElement, createElement, createContext, cloneElement } from 'react';
|
|
7
|
+
import { Check, Search, X, EyeOff, Eye, GripVertical, ChevronDown, ChevronUp } from '@hanzogui/lucide-icons-2';
|
|
8
|
+
import { Toaster as Toaster$1 } from '@hanzogui/toast/v2';
|
|
9
|
+
export { toast } from '@hanzogui/toast/v2';
|
|
10
|
+
|
|
11
|
+
var AspectRatio = ({ ratio = 1, ...props }) => /* @__PURE__ */ jsx(YStack, { "data-slot": "aspect-ratio", width: "100%", aspectRatio: ratio, ...props });
|
|
12
|
+
var SIZE = 32;
|
|
13
|
+
var Avatar = (props) => /* @__PURE__ */ jsx(Avatar$1, { "data-slot": "avatar", circular: true, size: SIZE, shrink: 0, overflow: "hidden", ...props });
|
|
14
|
+
var AvatarImage = (props) => /* @__PURE__ */ jsx(Avatar$1.Image, { "data-slot": "avatar-image", width: "100%", height: "100%", ...props });
|
|
15
|
+
var AvatarFallback = ({ children, ...props }) => /* @__PURE__ */ jsx(
|
|
16
|
+
Avatar$1.Fallback,
|
|
17
|
+
{
|
|
18
|
+
"data-slot": "avatar-fallback",
|
|
19
|
+
bg: "$color4",
|
|
20
|
+
items: "center",
|
|
21
|
+
justify: "center",
|
|
22
|
+
...props,
|
|
23
|
+
children: typeof children === "string" || typeof children === "number" ? /* @__PURE__ */ jsx(SizableText, { size: "$2", color: "$color11", children }) : children
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
var ink = (children, Wrap = SizableText, props = {}) => Children.map(
|
|
27
|
+
children,
|
|
28
|
+
(child) => typeof child === "string" || typeof child === "number" ? createElement(Wrap, props, child) : child
|
|
29
|
+
);
|
|
30
|
+
var MIN_TOUCH = 44;
|
|
31
|
+
var HEIGHT = 24;
|
|
32
|
+
var HIT_SLOP = (MIN_TOUCH - HEIGHT) / 2;
|
|
33
|
+
var BadgeContext = /* @__PURE__ */ createStyledContext({ variant: "default" });
|
|
34
|
+
var BadgeFrame = styled(XStack, {
|
|
35
|
+
name: "Badge",
|
|
36
|
+
context: BadgeContext,
|
|
37
|
+
self: "flex-start",
|
|
38
|
+
items: "center",
|
|
39
|
+
justify: "center",
|
|
40
|
+
shrink: 0,
|
|
41
|
+
minH: HEIGHT,
|
|
42
|
+
px: "$2.5",
|
|
43
|
+
py: "$1",
|
|
44
|
+
gap: "$1.5",
|
|
45
|
+
rounded: "$2",
|
|
46
|
+
borderWidth: 1,
|
|
47
|
+
borderColor: "transparent",
|
|
48
|
+
overflow: "hidden",
|
|
49
|
+
variants: {
|
|
50
|
+
variant: {
|
|
51
|
+
default: { bg: "$color12" },
|
|
52
|
+
secondary: { bg: "$color4" },
|
|
53
|
+
destructive: { bg: "$red9" },
|
|
54
|
+
outline: { bg: "$background", borderColor: "$borderColor" },
|
|
55
|
+
ghost: { bg: "transparent", hoverStyle: { bg: "$color3" } },
|
|
56
|
+
link: { bg: "transparent" },
|
|
57
|
+
inputAdornment: { bg: "$color3", px: "$2" },
|
|
58
|
+
tags: { bg: "$color3", borderColor: "$borderColor", rounded: "$3" }
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
defaultVariants: { variant: "default" }
|
|
62
|
+
});
|
|
63
|
+
var BadgeText = styled(SizableText, {
|
|
64
|
+
name: "BadgeText",
|
|
65
|
+
context: BadgeContext,
|
|
66
|
+
size: "$1",
|
|
67
|
+
fontWeight: "600",
|
|
68
|
+
variants: {
|
|
69
|
+
variant: {
|
|
70
|
+
default: { color: "$color1" },
|
|
71
|
+
secondary: { color: "$color12" },
|
|
72
|
+
destructive: { color: "$white1" },
|
|
73
|
+
outline: { color: "$color12" },
|
|
74
|
+
ghost: { color: "$color12" },
|
|
75
|
+
link: { color: "$color12", textDecorationLine: "underline" },
|
|
76
|
+
inputAdornment: { color: "$color12", fontWeight: "500" },
|
|
77
|
+
tags: { color: "$color11", fontWeight: "400", textTransform: "capitalize" }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
var badgeVariants = ({ variant } = {}) => `hanzo-badge hanzo-badge--${variant ?? "default"}`;
|
|
82
|
+
function Badge({
|
|
83
|
+
className,
|
|
84
|
+
variant = "default",
|
|
85
|
+
asChild = false,
|
|
86
|
+
children,
|
|
87
|
+
...props
|
|
88
|
+
}) {
|
|
89
|
+
return /* @__PURE__ */ jsx(
|
|
90
|
+
BadgeFrame,
|
|
91
|
+
{
|
|
92
|
+
"data-slot": "badge",
|
|
93
|
+
"data-variant": variant,
|
|
94
|
+
variant: variant ?? "default",
|
|
95
|
+
asChild,
|
|
96
|
+
render: asChild ? void 0 : "span",
|
|
97
|
+
hitSlop: HIT_SLOP,
|
|
98
|
+
className: [badgeVariants({ variant }), className].filter(Boolean).join(" "),
|
|
99
|
+
...props,
|
|
100
|
+
children: asChild ? children : ink(children, BadgeText)
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
var HEIGHT2 = {
|
|
105
|
+
default: 36,
|
|
106
|
+
sm: 32,
|
|
107
|
+
lg: 40,
|
|
108
|
+
icon: 36,
|
|
109
|
+
"icon-sm": 32,
|
|
110
|
+
"icon-lg": 40
|
|
111
|
+
};
|
|
112
|
+
var MIN_TOUCH2 = 44;
|
|
113
|
+
var slop = (size) => Math.max(0, (MIN_TOUCH2 - HEIGHT2[size]) / 2);
|
|
114
|
+
var Frame = styled(Button$1, {
|
|
115
|
+
name: "Button",
|
|
116
|
+
items: "center",
|
|
117
|
+
justify: "center",
|
|
118
|
+
gap: "$2",
|
|
119
|
+
shrink: 0,
|
|
120
|
+
rounded: "$3",
|
|
121
|
+
borderWidth: 1,
|
|
122
|
+
borderColor: "transparent",
|
|
123
|
+
cursor: "pointer",
|
|
124
|
+
variants: {
|
|
125
|
+
variant: {
|
|
126
|
+
default: { bg: "$color12", color: "$color1", hoverStyle: { opacity: 0.9 } },
|
|
127
|
+
primary: { bg: "$color12", color: "$color1", hoverStyle: { opacity: 0.9 } },
|
|
128
|
+
destructive: { bg: "$red9", color: "$white1", hoverStyle: { opacity: 0.9 } },
|
|
129
|
+
outline: {
|
|
130
|
+
bg: "$background",
|
|
131
|
+
color: "$color12",
|
|
132
|
+
borderColor: "$borderColor",
|
|
133
|
+
hoverStyle: { bg: "$color3" }
|
|
134
|
+
},
|
|
135
|
+
secondary: { bg: "$color4", color: "$color12", hoverStyle: { opacity: 0.8 } },
|
|
136
|
+
ghost: { bg: "transparent", color: "$color12", hoverStyle: { bg: "$color3" } },
|
|
137
|
+
link: { bg: "transparent", color: "$color12", hoverStyle: { textDecorationLine: "underline" } },
|
|
138
|
+
linkFG: { bg: "transparent", color: "$color12", hoverStyle: { textDecorationLine: "underline" } },
|
|
139
|
+
linkMuted: {
|
|
140
|
+
bg: "transparent",
|
|
141
|
+
color: "$color11",
|
|
142
|
+
hoverStyle: { color: "$color12", textDecorationLine: "underline" }
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
size: {
|
|
146
|
+
default: { height: HEIGHT2.default, px: "$4", fontSize: "$3" },
|
|
147
|
+
sm: { height: HEIGHT2.sm, px: "$3", gap: "$1.5", fontSize: "$2" },
|
|
148
|
+
lg: { height: HEIGHT2.lg, px: "$6", fontSize: "$3" },
|
|
149
|
+
icon: { height: HEIGHT2.icon, width: HEIGHT2.icon, px: 0 },
|
|
150
|
+
"icon-sm": { height: HEIGHT2["icon-sm"], width: HEIGHT2["icon-sm"], px: 0 },
|
|
151
|
+
"icon-lg": { height: HEIGHT2["icon-lg"], width: HEIGHT2["icon-lg"], px: 0 }
|
|
152
|
+
},
|
|
153
|
+
disabled: {
|
|
154
|
+
true: { opacity: 0.5, pointerEvents: "none", cursor: "default" }
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
defaultVariants: { variant: "default", size: "default" }
|
|
158
|
+
});
|
|
159
|
+
var buttonVariants = ({
|
|
160
|
+
variant,
|
|
161
|
+
size,
|
|
162
|
+
className
|
|
163
|
+
} = {}) => [`hanzo-button`, `hanzo-button--${variant ?? "default"}`, `hanzo-button--${size ?? "default"}`, className].filter(Boolean).join(" ");
|
|
164
|
+
function Button({
|
|
165
|
+
className,
|
|
166
|
+
variant = "default",
|
|
167
|
+
size = "default",
|
|
168
|
+
asChild = false,
|
|
169
|
+
isLoading = false,
|
|
170
|
+
disabled,
|
|
171
|
+
children,
|
|
172
|
+
...props
|
|
173
|
+
}) {
|
|
174
|
+
const resolved = size ?? "default";
|
|
175
|
+
return /* @__PURE__ */ jsx(
|
|
176
|
+
Frame,
|
|
177
|
+
{
|
|
178
|
+
"data-slot": "button",
|
|
179
|
+
"data-variant": variant ?? "default",
|
|
180
|
+
"data-size": resolved,
|
|
181
|
+
variant: variant ?? "default",
|
|
182
|
+
size: resolved,
|
|
183
|
+
asChild,
|
|
184
|
+
disabled: disabled || isLoading,
|
|
185
|
+
hitSlop: slop(resolved),
|
|
186
|
+
className: buttonVariants({ variant, size, className }),
|
|
187
|
+
icon: isLoading && !asChild ? /* @__PURE__ */ jsx(Spinner, { size: "small" }) : void 0,
|
|
188
|
+
...props,
|
|
189
|
+
children
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// src/backends/gui/slot.ts
|
|
195
|
+
var slot = (name) => ({ "data-slot": name });
|
|
196
|
+
var PAD = 24;
|
|
197
|
+
var CardFrame = styled(YStack, {
|
|
198
|
+
name: "Card",
|
|
199
|
+
bg: "$background",
|
|
200
|
+
borderWidth: 1,
|
|
201
|
+
borderColor: "$borderColor",
|
|
202
|
+
rounded: "$6",
|
|
203
|
+
py: PAD,
|
|
204
|
+
gap: PAD
|
|
205
|
+
});
|
|
206
|
+
var HeaderFrame = styled(XStack, {
|
|
207
|
+
name: "CardHeader",
|
|
208
|
+
px: PAD,
|
|
209
|
+
gap: "$2",
|
|
210
|
+
items: "flex-start",
|
|
211
|
+
justify: "space-between"
|
|
212
|
+
});
|
|
213
|
+
var TitleFrame = styled(SizableText, { name: "CardTitle", size: "$4", fontWeight: "600" });
|
|
214
|
+
var DescriptionFrame = styled(SizableText, { name: "CardDescription", size: "$2", color: "$color11" });
|
|
215
|
+
var ActionFrame = styled(XStack, { name: "CardAction", self: "flex-start", shrink: 0 });
|
|
216
|
+
var ContentFrame = styled(YStack, { name: "CardContent", px: PAD });
|
|
217
|
+
var FooterFrame = styled(XStack, { name: "CardFooter", px: PAD, items: "center" });
|
|
218
|
+
var Card = (p) => /* @__PURE__ */ jsx(CardFrame, { ...slot("card"), ...p });
|
|
219
|
+
var CardHeader = (p) => /* @__PURE__ */ jsx(HeaderFrame, { ...slot("card-header"), ...p });
|
|
220
|
+
var CardTitle = (p) => /* @__PURE__ */ jsx(TitleFrame, { ...slot("card-title"), ...p });
|
|
221
|
+
var CardDescription = (p) => /* @__PURE__ */ jsx(DescriptionFrame, { ...slot("card-description"), ...p });
|
|
222
|
+
var CardAction = (p) => /* @__PURE__ */ jsx(ActionFrame, { ...slot("card-action"), ...p });
|
|
223
|
+
var CardContent = (p) => /* @__PURE__ */ jsx(ContentFrame, { ...slot("card-content"), ...p });
|
|
224
|
+
var CardFooter = (p) => /* @__PURE__ */ jsx(FooterFrame, { ...slot("card-footer"), ...p });
|
|
225
|
+
var BOX = 16;
|
|
226
|
+
var HIT_SLOP2 = (44 - BOX) / 2;
|
|
227
|
+
var Checkbox = (props) => /* @__PURE__ */ jsx(
|
|
228
|
+
Checkbox$1,
|
|
229
|
+
{
|
|
230
|
+
...slot("checkbox"),
|
|
231
|
+
width: BOX,
|
|
232
|
+
height: BOX,
|
|
233
|
+
shrink: 0,
|
|
234
|
+
rounded: "$2",
|
|
235
|
+
borderWidth: 1,
|
|
236
|
+
borderColor: "$borderColor",
|
|
237
|
+
bg: "transparent",
|
|
238
|
+
hitSlop: HIT_SLOP2,
|
|
239
|
+
...props,
|
|
240
|
+
children: /* @__PURE__ */ jsx(Checkbox$1.Indicator, { ...slot("checkbox-indicator"), items: "center", justify: "center", children: /* @__PURE__ */ jsx(Check, { size: BOX - 3 }) })
|
|
241
|
+
}
|
|
242
|
+
);
|
|
243
|
+
var Collapsible = (p) => /* @__PURE__ */ jsx(Collapsible$1, { ...slot("collapsible"), ...p });
|
|
244
|
+
var CollapsibleTrigger = (p) => /* @__PURE__ */ jsx(Collapsible$1.Trigger, { ...slot("collapsible-trigger"), unstyled: true, hitSlop: 8, ...p });
|
|
245
|
+
var CollapsibleContent = (p) => /* @__PURE__ */ jsx(Collapsible$1.Content, { ...slot("collapsible-content"), ...p });
|
|
246
|
+
|
|
247
|
+
// src/backends/gui/command.logic.ts
|
|
248
|
+
var score = (value, search, keywords) => {
|
|
249
|
+
const needle = search.trim().toLowerCase();
|
|
250
|
+
if (!needle) return 1;
|
|
251
|
+
const hay = (keywords?.length ? `${value} ${keywords.join(" ")}` : value).toLowerCase();
|
|
252
|
+
if (hay === needle) return 1;
|
|
253
|
+
if (hay.startsWith(needle)) return 0.9;
|
|
254
|
+
const at = hay.indexOf(needle);
|
|
255
|
+
if (at > -1) return 0.8 - at / (hay.length * 100);
|
|
256
|
+
let i = 0;
|
|
257
|
+
for (let j = 0; j < hay.length && i < needle.length; j++) if (hay[j] === needle[i]) i++;
|
|
258
|
+
return i === needle.length ? 0.4 : 0;
|
|
259
|
+
};
|
|
260
|
+
var step = (count, from, delta, loop = false) => {
|
|
261
|
+
if (count <= 0) return -1;
|
|
262
|
+
const next = from + delta;
|
|
263
|
+
if (next < 0) return loop ? count - 1 : 0;
|
|
264
|
+
if (next >= count) return loop ? 0 : count - 1;
|
|
265
|
+
return next;
|
|
266
|
+
};
|
|
267
|
+
var TOUCH = 44;
|
|
268
|
+
var textOf = (node) => typeof node === "string" || typeof node === "number" ? String(node) : Array.isArray(node) ? node.map(textOf).filter(Boolean).join(" ") : isValidElement(node) ? textOf(node.props.children) : "";
|
|
269
|
+
var CommandContext = /* @__PURE__ */ createContext(null);
|
|
270
|
+
var GroupContext = /* @__PURE__ */ createContext(void 0);
|
|
271
|
+
var useCommand = () => {
|
|
272
|
+
const ctx = useContext(CommandContext);
|
|
273
|
+
if (!ctx) throw new Error("Command parts must be rendered inside <Command>");
|
|
274
|
+
return ctx;
|
|
275
|
+
};
|
|
276
|
+
var Command = /* @__PURE__ */ forwardRef(function Command2({
|
|
277
|
+
value,
|
|
278
|
+
defaultValue,
|
|
279
|
+
onValueChange,
|
|
280
|
+
filter = score,
|
|
281
|
+
shouldFilter = true,
|
|
282
|
+
loop = false,
|
|
283
|
+
label,
|
|
284
|
+
vimBindings = true,
|
|
285
|
+
disablePointerSelection = false,
|
|
286
|
+
children,
|
|
287
|
+
...rest
|
|
288
|
+
}, ref) {
|
|
289
|
+
const entries = useRef(/* @__PURE__ */ new Map()).current;
|
|
290
|
+
const order = useRef([]).current;
|
|
291
|
+
const [version, touch] = useReducer((n) => n + 1, 0);
|
|
292
|
+
const [search, setSearch] = useState("");
|
|
293
|
+
const [uncontrolled, setUncontrolled] = useState(defaultValue ?? "");
|
|
294
|
+
const selected = value ?? uncontrolled;
|
|
295
|
+
const register = useCallback(
|
|
296
|
+
(id, entry) => {
|
|
297
|
+
entries.set(id, entry);
|
|
298
|
+
if (!order.includes(id)) order.push(id);
|
|
299
|
+
touch();
|
|
300
|
+
return () => {
|
|
301
|
+
entries.delete(id);
|
|
302
|
+
const at = order.indexOf(id);
|
|
303
|
+
if (at > -1) order.splice(at, 1);
|
|
304
|
+
touch();
|
|
305
|
+
};
|
|
306
|
+
},
|
|
307
|
+
[entries, order]
|
|
308
|
+
);
|
|
309
|
+
const visible = useMemo(
|
|
310
|
+
() => order.filter((id) => {
|
|
311
|
+
const entry = entries.get(id)?.current;
|
|
312
|
+
return !!entry && (!shouldFilter || filter(entry.value, search, entry.keywords) > 0);
|
|
313
|
+
}),
|
|
314
|
+
// `version` is the registry's revision — the registry itself is a mutable ref.
|
|
315
|
+
[version, order, entries, shouldFilter, filter, search]
|
|
316
|
+
);
|
|
317
|
+
const shown = useMemo(() => new Set(visible), [visible]);
|
|
318
|
+
const shownGroups = useMemo(
|
|
319
|
+
() => new Set(visible.map((id) => entries.get(id)?.current.group).filter(Boolean)),
|
|
320
|
+
[visible, entries]
|
|
321
|
+
);
|
|
322
|
+
const select = useCallback(
|
|
323
|
+
(next) => {
|
|
324
|
+
if (value === void 0) setUncontrolled(next);
|
|
325
|
+
onValueChange?.(next);
|
|
326
|
+
},
|
|
327
|
+
[value, onValueChange]
|
|
328
|
+
);
|
|
329
|
+
useEffect(() => {
|
|
330
|
+
if (!visible.length) return;
|
|
331
|
+
if (selected && visible.some((id) => entries.get(id)?.current.value === selected)) return;
|
|
332
|
+
const first = entries.get(visible[0])?.current.value;
|
|
333
|
+
if (first) select(first);
|
|
334
|
+
}, [visible, selected, entries, select]);
|
|
335
|
+
const move = useCallback(
|
|
336
|
+
(delta) => {
|
|
337
|
+
const reachable = visible.filter((id) => !entries.get(id)?.current.disabled);
|
|
338
|
+
const at = reachable.findIndex((id) => entries.get(id)?.current.value === selected);
|
|
339
|
+
const next = step(reachable.length, at, delta, loop);
|
|
340
|
+
const target = next < 0 ? void 0 : entries.get(reachable[next])?.current.value;
|
|
341
|
+
if (target) select(target);
|
|
342
|
+
},
|
|
343
|
+
[visible, entries, selected, loop, select]
|
|
344
|
+
);
|
|
345
|
+
const run = useCallback(
|
|
346
|
+
(id) => {
|
|
347
|
+
const entry = entries.get(id)?.current;
|
|
348
|
+
if (!entry || entry.disabled) return;
|
|
349
|
+
select(entry.value);
|
|
350
|
+
entry.onSelect?.(entry.value);
|
|
351
|
+
},
|
|
352
|
+
[entries, select]
|
|
353
|
+
);
|
|
354
|
+
const onKey = useCallback(
|
|
355
|
+
(e) => {
|
|
356
|
+
const mod = vimBindings && (e.ctrlKey || e.metaKey);
|
|
357
|
+
const down = e.key === "ArrowDown" || mod && (e.key === "n" || e.key === "j");
|
|
358
|
+
const up = e.key === "ArrowUp" || mod && (e.key === "p" || e.key === "k");
|
|
359
|
+
if (down || up) {
|
|
360
|
+
e.preventDefault();
|
|
361
|
+
move(down ? 1 : -1);
|
|
362
|
+
} else if (e.key === "Enter") {
|
|
363
|
+
e.preventDefault();
|
|
364
|
+
const id = visible.find((it) => entries.get(it)?.current.value === selected);
|
|
365
|
+
if (id) run(id);
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
[vimBindings, move, visible, entries, selected, run]
|
|
369
|
+
);
|
|
370
|
+
const ctx = useMemo(
|
|
371
|
+
() => ({
|
|
372
|
+
search,
|
|
373
|
+
setSearch,
|
|
374
|
+
selected,
|
|
375
|
+
select,
|
|
376
|
+
register,
|
|
377
|
+
touch,
|
|
378
|
+
run,
|
|
379
|
+
onKey,
|
|
380
|
+
shows: (id) => shown.has(id),
|
|
381
|
+
showsGroup: (group) => shownGroups.has(group),
|
|
382
|
+
empty: visible.length === 0,
|
|
383
|
+
disablePointerSelection
|
|
384
|
+
}),
|
|
385
|
+
[search, selected, select, register, run, onKey, shown, shownGroups, visible.length, disablePointerSelection]
|
|
386
|
+
);
|
|
387
|
+
return /* @__PURE__ */ jsx(CommandContext.Provider, { value: ctx, children: /* @__PURE__ */ jsx(
|
|
388
|
+
YStack,
|
|
389
|
+
{
|
|
390
|
+
ref,
|
|
391
|
+
"data-slot": "command",
|
|
392
|
+
"aria-label": label,
|
|
393
|
+
width: "100%",
|
|
394
|
+
overflow: "hidden",
|
|
395
|
+
rounded: "$4",
|
|
396
|
+
bg: "$background",
|
|
397
|
+
...isWeb ? { onKeyDown: onKey } : null,
|
|
398
|
+
...rest,
|
|
399
|
+
children
|
|
400
|
+
}
|
|
401
|
+
) });
|
|
402
|
+
});
|
|
403
|
+
var CommandDialog = ({
|
|
404
|
+
title = "Command Palette",
|
|
405
|
+
description = "Search for a command to run...",
|
|
406
|
+
children,
|
|
407
|
+
...props
|
|
408
|
+
}) => /* @__PURE__ */ jsx(Dialog, { modal: true, ...props, children: /* @__PURE__ */ jsxs(DialogPortal, { children: [
|
|
409
|
+
/* @__PURE__ */ jsx(DialogOverlay, { bg: "rgba(0,0,0,0.5)" }, "overlay"),
|
|
410
|
+
/* @__PURE__ */ jsxs(DialogContent, { p: 0, width: "100%", maxW: 640, overflow: "hidden", children: [
|
|
411
|
+
/* @__PURE__ */ jsxs(VisuallyHidden, { children: [
|
|
412
|
+
/* @__PURE__ */ jsx(DialogTitle, { children: title }),
|
|
413
|
+
/* @__PURE__ */ jsx(DialogDescription, { children: description })
|
|
414
|
+
] }),
|
|
415
|
+
/* @__PURE__ */ jsx(Command, { children })
|
|
416
|
+
] }, "content")
|
|
417
|
+
] }) });
|
|
418
|
+
var CommandInput = /* @__PURE__ */ forwardRef(
|
|
419
|
+
function CommandInput2({ value, onValueChange, placeholder, ...rest }, ref) {
|
|
420
|
+
const { search, setSearch, onKey } = useCommand();
|
|
421
|
+
useEffect(() => {
|
|
422
|
+
if (value !== void 0 && value !== search) setSearch(value);
|
|
423
|
+
}, [value, search, setSearch]);
|
|
424
|
+
return /* @__PURE__ */ jsxs(
|
|
425
|
+
XStack,
|
|
426
|
+
{
|
|
427
|
+
"data-slot": "command-input-wrapper",
|
|
428
|
+
items: "center",
|
|
429
|
+
gap: "$2",
|
|
430
|
+
px: "$3",
|
|
431
|
+
minH: TOUCH,
|
|
432
|
+
borderBottomWidth: 1,
|
|
433
|
+
borderColor: "$borderColor",
|
|
434
|
+
children: [
|
|
435
|
+
/* @__PURE__ */ jsx(Search, { size: 16, opacity: 0.5 }),
|
|
436
|
+
/* @__PURE__ */ jsx(
|
|
437
|
+
Input,
|
|
438
|
+
{
|
|
439
|
+
ref,
|
|
440
|
+
"data-slot": "command-input",
|
|
441
|
+
unstyled: true,
|
|
442
|
+
flex: 1,
|
|
443
|
+
height: TOUCH,
|
|
444
|
+
borderWidth: 0,
|
|
445
|
+
bg: "transparent",
|
|
446
|
+
color: "$color",
|
|
447
|
+
placeholder,
|
|
448
|
+
value: value ?? search,
|
|
449
|
+
onChangeText: (next) => {
|
|
450
|
+
setSearch(next);
|
|
451
|
+
onValueChange?.(next);
|
|
452
|
+
},
|
|
453
|
+
...isWeb ? { onKeyDown: onKey } : null,
|
|
454
|
+
...rest
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
]
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
);
|
|
462
|
+
var CommandList = /* @__PURE__ */ forwardRef(
|
|
463
|
+
function CommandList2(props, ref) {
|
|
464
|
+
return /* @__PURE__ */ jsx(ScrollView, { ref, "data-slot": "command-list", maxH: 300, ...props });
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
var CommandEmpty = /* @__PURE__ */ forwardRef(
|
|
468
|
+
function CommandEmpty2({ children, ...rest }, ref) {
|
|
469
|
+
const { empty } = useCommand();
|
|
470
|
+
if (!empty) return null;
|
|
471
|
+
return /* @__PURE__ */ jsx(YStack, { ref, "data-slot": "command-empty", py: "$4", items: "center", ...rest, children: typeof children === "string" ? /* @__PURE__ */ jsx(SizableText, { size: "$3", color: "$color11", children }) : children });
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
var CommandGroup = /* @__PURE__ */ forwardRef(
|
|
475
|
+
function CommandGroup2({ heading, children, ...rest }, ref) {
|
|
476
|
+
const id = useId();
|
|
477
|
+
const { showsGroup } = useCommand();
|
|
478
|
+
return /* @__PURE__ */ jsx(GroupContext.Provider, { value: id, children: /* @__PURE__ */ jsxs(
|
|
479
|
+
YStack,
|
|
480
|
+
{
|
|
481
|
+
ref,
|
|
482
|
+
"data-slot": "command-group",
|
|
483
|
+
display: showsGroup(id) ? "flex" : "none",
|
|
484
|
+
p: "$1",
|
|
485
|
+
...rest,
|
|
486
|
+
children: [
|
|
487
|
+
heading != null ? /* @__PURE__ */ jsx(
|
|
488
|
+
SizableText,
|
|
489
|
+
{
|
|
490
|
+
size: "$1",
|
|
491
|
+
color: "$color11",
|
|
492
|
+
fontWeight: "500",
|
|
493
|
+
px: "$2",
|
|
494
|
+
py: "$1.5",
|
|
495
|
+
children: heading
|
|
496
|
+
}
|
|
497
|
+
) : null,
|
|
498
|
+
children
|
|
499
|
+
]
|
|
500
|
+
}
|
|
501
|
+
) });
|
|
502
|
+
}
|
|
503
|
+
);
|
|
504
|
+
var CommandSeparator = /* @__PURE__ */ forwardRef(
|
|
505
|
+
function CommandSeparator2({ alwaysRender, ...rest }, ref) {
|
|
506
|
+
const { search } = useCommand();
|
|
507
|
+
if (!alwaysRender && search) return null;
|
|
508
|
+
return /* @__PURE__ */ jsx(Separator, { ref, "data-slot": "command-separator", ...rest });
|
|
509
|
+
}
|
|
510
|
+
);
|
|
511
|
+
var CommandItem = /* @__PURE__ */ forwardRef(
|
|
512
|
+
function CommandItem2({ value, keywords, disabled, onSelect, children, ...rest }, ref) {
|
|
513
|
+
const id = useId();
|
|
514
|
+
const { register, touch, run, select, selected, shows, disablePointerSelection } = useCommand();
|
|
515
|
+
const group = useContext(GroupContext);
|
|
516
|
+
const self = value ?? textOf(children);
|
|
517
|
+
const entry = useRef({ value: self, keywords, disabled, group, onSelect });
|
|
518
|
+
entry.current = { value: self, keywords, disabled, group, onSelect };
|
|
519
|
+
useEffect(() => register(id, entry), [id, register]);
|
|
520
|
+
useEffect(touch, [touch, self, disabled, keywords?.join("\0")]);
|
|
521
|
+
const isSelected = !!self && selected === self;
|
|
522
|
+
return /* @__PURE__ */ jsx(
|
|
523
|
+
ListItem,
|
|
524
|
+
{
|
|
525
|
+
ref,
|
|
526
|
+
"data-slot": "command-item",
|
|
527
|
+
"data-selected": isSelected,
|
|
528
|
+
"data-disabled": !!disabled,
|
|
529
|
+
display: shows(id) ? "flex" : "none",
|
|
530
|
+
disabled,
|
|
531
|
+
minH: TOUCH,
|
|
532
|
+
gap: "$2",
|
|
533
|
+
rounded: "$2",
|
|
534
|
+
bg: isSelected ? "$backgroundFocus" : "transparent",
|
|
535
|
+
opacity: disabled ? 0.5 : 1,
|
|
536
|
+
onPress: () => run(id),
|
|
537
|
+
onPointerEnter: disabled || disablePointerSelection ? void 0 : () => select(self),
|
|
538
|
+
...rest,
|
|
539
|
+
children
|
|
540
|
+
}
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
);
|
|
544
|
+
var CommandShortcut = (props) => /* @__PURE__ */ jsx(
|
|
545
|
+
SizableText,
|
|
546
|
+
{
|
|
547
|
+
"data-slot": "command-shortcut",
|
|
548
|
+
ml: "auto",
|
|
549
|
+
size: "$1",
|
|
550
|
+
color: "$color11",
|
|
551
|
+
letterSpacing: 1.5,
|
|
552
|
+
...props
|
|
553
|
+
}
|
|
554
|
+
);
|
|
555
|
+
var PAD2 = 24;
|
|
556
|
+
var Dialog2 = (p) => /* @__PURE__ */ jsx(Dialog, { modal: true, ...p });
|
|
557
|
+
var DialogTrigger = Dialog.Trigger;
|
|
558
|
+
var DialogPortal2 = Dialog.Portal;
|
|
559
|
+
var DialogClose = Dialog.Close;
|
|
560
|
+
var DialogOverlay2 = (props) => /* @__PURE__ */ jsx(
|
|
561
|
+
Dialog.Overlay,
|
|
562
|
+
{
|
|
563
|
+
...slot("dialog-overlay"),
|
|
564
|
+
bg: "rgba(0,0,0,0.5)",
|
|
565
|
+
opacity: 0.5,
|
|
566
|
+
...props
|
|
567
|
+
}
|
|
568
|
+
);
|
|
569
|
+
var DialogContent2 = ({ showCloseButton = true, children, ...props }) => {
|
|
570
|
+
const themeName = useThemeName();
|
|
571
|
+
return /* @__PURE__ */ jsx(Dialog.Portal, { children: /* @__PURE__ */ jsxs(PortalTheme, { name: themeName, children: [
|
|
572
|
+
/* @__PURE__ */ jsx(DialogOverlay2, {}),
|
|
573
|
+
/* @__PURE__ */ jsxs(
|
|
574
|
+
Dialog.Content,
|
|
575
|
+
{
|
|
576
|
+
...slot("dialog-content"),
|
|
577
|
+
bg: "$background",
|
|
578
|
+
borderWidth: 1,
|
|
579
|
+
borderColor: "$borderColor",
|
|
580
|
+
rounded: "$5",
|
|
581
|
+
p: PAD2,
|
|
582
|
+
gap: "$4",
|
|
583
|
+
width: "100%",
|
|
584
|
+
maxW: 512,
|
|
585
|
+
...props,
|
|
586
|
+
children: [
|
|
587
|
+
children,
|
|
588
|
+
showCloseButton ? /* @__PURE__ */ jsx(Dialog.Close, { asChild: true, children: /* @__PURE__ */ jsx(
|
|
589
|
+
XStack,
|
|
590
|
+
{
|
|
591
|
+
...slot("dialog-close"),
|
|
592
|
+
position: "absolute",
|
|
593
|
+
t: 16,
|
|
594
|
+
r: 16,
|
|
595
|
+
cursor: "pointer",
|
|
596
|
+
opacity: 0.7,
|
|
597
|
+
hoverStyle: { opacity: 1 },
|
|
598
|
+
hitSlop: 14,
|
|
599
|
+
"aria-label": "Close",
|
|
600
|
+
children: /* @__PURE__ */ jsx(X, { size: 16 })
|
|
601
|
+
}
|
|
602
|
+
) }) : null
|
|
603
|
+
]
|
|
604
|
+
}
|
|
605
|
+
)
|
|
606
|
+
] }) });
|
|
607
|
+
};
|
|
608
|
+
var DialogHeader = (props) => /* @__PURE__ */ jsx(YStack, { ...slot("dialog-header"), gap: "$2", ...props });
|
|
609
|
+
var DialogFooter = (props) => /* @__PURE__ */ jsx(XStack, { ...slot("dialog-footer"), gap: "$2", justify: "flex-end", items: "center", ...props });
|
|
610
|
+
var DialogTitle2 = (props) => /* @__PURE__ */ jsx(Dialog.Title, { ...slot("dialog-title"), size: "$5", fontWeight: "600", ...props });
|
|
611
|
+
var DialogDescription2 = (props) => /* @__PURE__ */ jsx(Dialog.Description, { ...slot("dialog-description"), size: "$2", color: "$color11", ...props });
|
|
612
|
+
var HEIGHT3 = 36;
|
|
613
|
+
var GUTTER = 12;
|
|
614
|
+
var WELL = 36;
|
|
615
|
+
var well = (side) => ({
|
|
616
|
+
position: "absolute",
|
|
617
|
+
[side]: GUTTER,
|
|
618
|
+
t: 0,
|
|
619
|
+
b: 0,
|
|
620
|
+
items: "center",
|
|
621
|
+
justify: "center"
|
|
622
|
+
});
|
|
623
|
+
var Input2 = /* @__PURE__ */ forwardRef(function Input3({ startAdornment, endAdornment, hidePasswordToggle, type, secureTextEntry, ...props }, ref) {
|
|
624
|
+
const [revealed, setRevealed] = useState(false);
|
|
625
|
+
const isPassword = type === "password" || secureTextEntry === true;
|
|
626
|
+
const toggle = isPassword && !hidePasswordToggle;
|
|
627
|
+
const field = /* @__PURE__ */ jsx(
|
|
628
|
+
Input,
|
|
629
|
+
{
|
|
630
|
+
ref,
|
|
631
|
+
...slot("input"),
|
|
632
|
+
secureTextEntry: isPassword && !revealed,
|
|
633
|
+
height: HEIGHT3,
|
|
634
|
+
width: "100%",
|
|
635
|
+
minW: 0,
|
|
636
|
+
rounded: "$3",
|
|
637
|
+
bg: "transparent",
|
|
638
|
+
borderWidth: 1,
|
|
639
|
+
borderColor: "$borderColor",
|
|
640
|
+
placeholderTextColor: "$color10",
|
|
641
|
+
fontSize: "$3",
|
|
642
|
+
pl: startAdornment ? WELL : GUTTER,
|
|
643
|
+
pr: endAdornment || toggle ? WELL : GUTTER,
|
|
644
|
+
...props
|
|
645
|
+
}
|
|
646
|
+
);
|
|
647
|
+
if (!startAdornment && !endAdornment && !toggle) return field;
|
|
648
|
+
return /* @__PURE__ */ jsxs(XStack, { position: "relative", width: "100%", items: "center", children: [
|
|
649
|
+
startAdornment ? /* @__PURE__ */ jsx(XStack, { ...well("l"), pointerEvents: "none", opacity: 0.6, children: startAdornment }) : null,
|
|
650
|
+
field,
|
|
651
|
+
toggle ? /* @__PURE__ */ jsx(
|
|
652
|
+
XStack,
|
|
653
|
+
{
|
|
654
|
+
...well("r"),
|
|
655
|
+
cursor: "pointer",
|
|
656
|
+
hitSlop: 8,
|
|
657
|
+
onPress: () => setRevealed((v) => !v),
|
|
658
|
+
"aria-label": revealed ? "Hide password" : "Show password",
|
|
659
|
+
children: revealed ? /* @__PURE__ */ jsx(EyeOff, { size: 16 }) : /* @__PURE__ */ jsx(Eye, { size: 16 })
|
|
660
|
+
}
|
|
661
|
+
) : endAdornment ? /* @__PURE__ */ jsx(XStack, { ...well("r"), opacity: 0.6, children: endAdornment }) : null
|
|
662
|
+
] });
|
|
663
|
+
});
|
|
664
|
+
var Label = (props) => /* @__PURE__ */ jsx(
|
|
665
|
+
Label$1,
|
|
666
|
+
{
|
|
667
|
+
...slot("label"),
|
|
668
|
+
fontSize: "$2",
|
|
669
|
+
fontWeight: "500",
|
|
670
|
+
color: "$color12",
|
|
671
|
+
select: "none",
|
|
672
|
+
cursor: "pointer",
|
|
673
|
+
...props
|
|
674
|
+
}
|
|
675
|
+
);
|
|
676
|
+
var DEFAULT_OFFSET = 4;
|
|
677
|
+
var OffsetContext = /* @__PURE__ */ createContext(null);
|
|
678
|
+
function Popover({ offset = DEFAULT_OFFSET, ...props }) {
|
|
679
|
+
const [current, setOffset] = useState(offset);
|
|
680
|
+
useEffect(() => setOffset(offset), [offset]);
|
|
681
|
+
return /* @__PURE__ */ jsx(OffsetContext.Provider, { value: setOffset, children: /* @__PURE__ */ jsx(Popover$1, { offset: current, ...props }) });
|
|
682
|
+
}
|
|
683
|
+
var PopoverTrigger = Popover$1.Trigger;
|
|
684
|
+
var PopoverAnchor = Popover$1.Anchor;
|
|
685
|
+
var PopoverClose = Popover$1.Close;
|
|
686
|
+
var PopoverContent = ({ sideOffset = DEFAULT_OFFSET, align: _align, ...props }) => {
|
|
687
|
+
const themeName = useThemeName();
|
|
688
|
+
const setOffset = useContext(OffsetContext);
|
|
689
|
+
useEffect(() => setOffset?.(sideOffset), [setOffset, sideOffset]);
|
|
690
|
+
return /* @__PURE__ */ jsx(PortalTheme, { name: themeName, children: /* @__PURE__ */ jsx(
|
|
691
|
+
Popover$1.Content,
|
|
692
|
+
{
|
|
693
|
+
...slot("popover-content"),
|
|
694
|
+
bg: "$color2",
|
|
695
|
+
borderWidth: 1,
|
|
696
|
+
borderColor: "$borderColor",
|
|
697
|
+
rounded: "$4",
|
|
698
|
+
p: "$4",
|
|
699
|
+
width: 288,
|
|
700
|
+
...props
|
|
701
|
+
}
|
|
702
|
+
) });
|
|
703
|
+
};
|
|
704
|
+
var Progress = ({ value, ...props }) => /* @__PURE__ */ jsx(
|
|
705
|
+
Progress$1,
|
|
706
|
+
{
|
|
707
|
+
...slot("progress"),
|
|
708
|
+
value: value ?? 0,
|
|
709
|
+
height: 8,
|
|
710
|
+
width: "100%",
|
|
711
|
+
bg: "$color4",
|
|
712
|
+
rounded: "$10",
|
|
713
|
+
overflow: "hidden",
|
|
714
|
+
...props,
|
|
715
|
+
children: /* @__PURE__ */ jsx(Progress$1.Indicator, { ...slot("progress-indicator"), bg: "$color12" })
|
|
716
|
+
}
|
|
717
|
+
);
|
|
718
|
+
|
|
719
|
+
// src/backends/gui/resizable.logic.ts
|
|
720
|
+
var clamp = (n, lo, hi) => Math.max(lo, Math.min(n, hi));
|
|
721
|
+
var floorOf = (s) => s.collapsible ? s.collapsedSize ?? 0 : s.minSize ?? 0;
|
|
722
|
+
var ceilOf = (s) => s.maxSize ?? 100;
|
|
723
|
+
function defaultLayout(specs) {
|
|
724
|
+
if (specs.length === 0) return [];
|
|
725
|
+
const claimed = specs.reduce((n, s) => n + (s.defaultSize ?? 0), 0);
|
|
726
|
+
const free = specs.filter((s) => s.defaultSize == null).length;
|
|
727
|
+
const each = free > 0 ? Math.max(0, 100 - claimed) / free : 0;
|
|
728
|
+
const raw = specs.map((s) => s.defaultSize ?? each);
|
|
729
|
+
const sum = raw.reduce((a, b) => a + b, 0);
|
|
730
|
+
return sum > 0 ? raw.map((v) => v / sum * 100) : specs.map(() => 100 / specs.length);
|
|
731
|
+
}
|
|
732
|
+
function resizeAt(sizes, specs, i, delta) {
|
|
733
|
+
const a = sizes[i];
|
|
734
|
+
const b = sizes[i + 1];
|
|
735
|
+
const sa = specs[i];
|
|
736
|
+
const sb = specs[i + 1];
|
|
737
|
+
if (a == null || b == null || !sa || !sb) return sizes;
|
|
738
|
+
const pair = a + b;
|
|
739
|
+
const lo = Math.max(floorOf(sa), pair - ceilOf(sb));
|
|
740
|
+
const hi = Math.min(ceilOf(sa), pair - floorOf(sb));
|
|
741
|
+
if (lo > hi) return sizes;
|
|
742
|
+
const next = clamp(a + delta, lo, hi);
|
|
743
|
+
if (next === a) return sizes;
|
|
744
|
+
const out = sizes.slice();
|
|
745
|
+
out[i] = next;
|
|
746
|
+
out[i + 1] = pair - next;
|
|
747
|
+
return out;
|
|
748
|
+
}
|
|
749
|
+
var webStorage = () => globalThis.localStorage;
|
|
750
|
+
var storeKey = (id) => `hanzo.panels.${id}`;
|
|
751
|
+
function loadStore(id) {
|
|
752
|
+
if (!id) return {};
|
|
753
|
+
try {
|
|
754
|
+
return JSON.parse(webStorage()?.getItem(storeKey(id)) ?? "{}");
|
|
755
|
+
} catch {
|
|
756
|
+
return {};
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
function saveStore(id, store) {
|
|
760
|
+
if (!id) return;
|
|
761
|
+
try {
|
|
762
|
+
webStorage()?.setItem(storeKey(id), JSON.stringify(store));
|
|
763
|
+
} catch {
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
var GroupContext2 = /* @__PURE__ */ createContext(null);
|
|
767
|
+
var SlotContext = /* @__PURE__ */ createContext(-1);
|
|
768
|
+
function ResizablePanelGroup({
|
|
769
|
+
direction,
|
|
770
|
+
autoSaveId,
|
|
771
|
+
onLayout,
|
|
772
|
+
children,
|
|
773
|
+
...rest
|
|
774
|
+
}) {
|
|
775
|
+
const axis = direction === "horizontal";
|
|
776
|
+
const extent = useRef(0);
|
|
777
|
+
const [store, setStore] = useState({});
|
|
778
|
+
const slots = useMemo(
|
|
779
|
+
() => Children.toArray(children).filter(isValidElement),
|
|
780
|
+
[children]
|
|
781
|
+
);
|
|
782
|
+
const specs = useMemo(
|
|
783
|
+
() => slots.filter((el) => el.type === ResizablePanel).map((el, i) => {
|
|
784
|
+
const p = el.props;
|
|
785
|
+
return {
|
|
786
|
+
id: p.id ?? String(p.order ?? i),
|
|
787
|
+
defaultSize: p.defaultSize,
|
|
788
|
+
minSize: p.minSize,
|
|
789
|
+
maxSize: p.maxSize,
|
|
790
|
+
collapsible: p.collapsible,
|
|
791
|
+
collapsedSize: p.collapsedSize,
|
|
792
|
+
onResize: p.onResize
|
|
793
|
+
};
|
|
794
|
+
}),
|
|
795
|
+
[slots]
|
|
796
|
+
);
|
|
797
|
+
const key = specs.map((s) => s.id).join(",");
|
|
798
|
+
const sizes = store[key] ?? defaultLayout(specs);
|
|
799
|
+
useEffect(() => {
|
|
800
|
+
setStore(loadStore(autoSaveId));
|
|
801
|
+
}, [autoSaveId]);
|
|
802
|
+
const setLayout = useCallback(
|
|
803
|
+
(next) => {
|
|
804
|
+
const merged = { ...store, [key]: next };
|
|
805
|
+
setStore(merged);
|
|
806
|
+
saveStore(autoSaveId, merged);
|
|
807
|
+
onLayout?.(next);
|
|
808
|
+
},
|
|
809
|
+
[autoSaveId, key, onLayout, store]
|
|
810
|
+
);
|
|
811
|
+
const prev = useRef([]);
|
|
812
|
+
useEffect(() => {
|
|
813
|
+
specs.forEach((s, i) => {
|
|
814
|
+
if (sizes[i] != null && sizes[i] !== prev.current[i])
|
|
815
|
+
s.onResize?.(sizes[i]);
|
|
816
|
+
});
|
|
817
|
+
prev.current = sizes;
|
|
818
|
+
}, [specs, sizes]);
|
|
819
|
+
const value = useMemo(
|
|
820
|
+
() => ({ direction, specs, sizes, extent, setLayout }),
|
|
821
|
+
[direction, specs, sizes, setLayout]
|
|
822
|
+
);
|
|
823
|
+
let panel = -1;
|
|
824
|
+
return /* @__PURE__ */ jsx(GroupContext2.Provider, { value, children: /* @__PURE__ */ jsx(
|
|
825
|
+
XStack,
|
|
826
|
+
{
|
|
827
|
+
width: "100%",
|
|
828
|
+
height: "100%",
|
|
829
|
+
flexDirection: axis ? "row" : "column",
|
|
830
|
+
overflow: "hidden",
|
|
831
|
+
"data-panel-group-direction": direction,
|
|
832
|
+
onLayout: (e) => {
|
|
833
|
+
extent.current = axis ? e.nativeEvent.layout.width : e.nativeEvent.layout.height;
|
|
834
|
+
},
|
|
835
|
+
...rest,
|
|
836
|
+
children: slots.map((el, i) => {
|
|
837
|
+
if (el.type === ResizablePanel) panel++;
|
|
838
|
+
return /* @__PURE__ */ jsx(SlotContext.Provider, { value: panel, children: el }, el.key ?? i);
|
|
839
|
+
})
|
|
840
|
+
}
|
|
841
|
+
) });
|
|
842
|
+
}
|
|
843
|
+
function ResizablePanel({
|
|
844
|
+
id,
|
|
845
|
+
order,
|
|
846
|
+
defaultSize,
|
|
847
|
+
minSize,
|
|
848
|
+
maxSize,
|
|
849
|
+
collapsible,
|
|
850
|
+
collapsedSize,
|
|
851
|
+
onResize,
|
|
852
|
+
children,
|
|
853
|
+
...rest
|
|
854
|
+
}) {
|
|
855
|
+
const group = useContext(GroupContext2);
|
|
856
|
+
const index = useContext(SlotContext);
|
|
857
|
+
const size = group?.sizes[index];
|
|
858
|
+
return /* @__PURE__ */ jsx(
|
|
859
|
+
XStack,
|
|
860
|
+
{
|
|
861
|
+
flexDirection: "column",
|
|
862
|
+
overflow: "hidden",
|
|
863
|
+
flexBasis: 0,
|
|
864
|
+
grow: size ?? 1,
|
|
865
|
+
shrink: 1,
|
|
866
|
+
...rest,
|
|
867
|
+
children
|
|
868
|
+
}
|
|
869
|
+
);
|
|
870
|
+
}
|
|
871
|
+
var THICKNESS = 4;
|
|
872
|
+
var HIT_SLOP3 = 20;
|
|
873
|
+
var KEY_STEP = 5;
|
|
874
|
+
var KEY_STEP_FINE = 1;
|
|
875
|
+
function ResizableHandle({
|
|
876
|
+
withHandle,
|
|
877
|
+
disabled,
|
|
878
|
+
...rest
|
|
879
|
+
}) {
|
|
880
|
+
const group = useContext(GroupContext2);
|
|
881
|
+
const boundary = useContext(SlotContext);
|
|
882
|
+
const [state, setState] = useState("idle");
|
|
883
|
+
const start = useRef(null);
|
|
884
|
+
const axis = group?.direction !== "vertical";
|
|
885
|
+
const off = disabled || !group || boundary < 0 || boundary + 1 >= group.sizes.length;
|
|
886
|
+
const posOf = useCallback(
|
|
887
|
+
(e) => (axis ? e.clientX ?? e.nativeEvent?.pageX : e.clientY ?? e.nativeEvent?.pageY) ?? 0,
|
|
888
|
+
[axis]
|
|
889
|
+
);
|
|
890
|
+
const begin = useCallback(
|
|
891
|
+
(e) => {
|
|
892
|
+
if (off || !group) return;
|
|
893
|
+
start.current = { pos: posOf(e), sizes: group.sizes };
|
|
894
|
+
setState("drag");
|
|
895
|
+
const target = e.currentTarget;
|
|
896
|
+
if (target?.setPointerCapture && e.pointerId != null)
|
|
897
|
+
target.setPointerCapture(e.pointerId);
|
|
898
|
+
},
|
|
899
|
+
[group, off, posOf]
|
|
900
|
+
);
|
|
901
|
+
const move = useCallback(
|
|
902
|
+
(e) => {
|
|
903
|
+
const from = start.current;
|
|
904
|
+
if (!from || !group) return;
|
|
905
|
+
const px = group.extent.current;
|
|
906
|
+
if (px <= 0) return;
|
|
907
|
+
group.setLayout(
|
|
908
|
+
resizeAt(
|
|
909
|
+
from.sizes,
|
|
910
|
+
group.specs,
|
|
911
|
+
boundary,
|
|
912
|
+
(posOf(e) - from.pos) / px * 100
|
|
913
|
+
)
|
|
914
|
+
);
|
|
915
|
+
},
|
|
916
|
+
[boundary, group, posOf]
|
|
917
|
+
);
|
|
918
|
+
const end = useCallback(() => {
|
|
919
|
+
start.current = null;
|
|
920
|
+
setState("idle");
|
|
921
|
+
}, []);
|
|
922
|
+
const nudge = useCallback(
|
|
923
|
+
(e) => {
|
|
924
|
+
if (off || !group) return;
|
|
925
|
+
const dir = axis ? e.key === "ArrowLeft" ? -1 : e.key === "ArrowRight" ? 1 : 0 : e.key === "ArrowUp" ? -1 : e.key === "ArrowDown" ? 1 : 0;
|
|
926
|
+
if (dir === 0) return;
|
|
927
|
+
e.preventDefault();
|
|
928
|
+
group.setLayout(
|
|
929
|
+
resizeAt(
|
|
930
|
+
group.sizes,
|
|
931
|
+
group.specs,
|
|
932
|
+
boundary,
|
|
933
|
+
dir * (e.shiftKey ? KEY_STEP_FINE : KEY_STEP)
|
|
934
|
+
)
|
|
935
|
+
);
|
|
936
|
+
},
|
|
937
|
+
[axis, boundary, group, off]
|
|
938
|
+
);
|
|
939
|
+
const hover = useCallback(
|
|
940
|
+
(on) => setState((s) => s === "drag" ? s : on ? "hover" : "idle"),
|
|
941
|
+
[]
|
|
942
|
+
);
|
|
943
|
+
const gesture = isWeb ? {
|
|
944
|
+
onPointerDown: begin,
|
|
945
|
+
onPointerMove: move,
|
|
946
|
+
onPointerUp: end,
|
|
947
|
+
onPointerCancel: end,
|
|
948
|
+
onKeyDown: nudge,
|
|
949
|
+
onMouseEnter: () => hover(true),
|
|
950
|
+
onMouseLeave: () => hover(false)
|
|
951
|
+
} : {
|
|
952
|
+
onStartShouldSetResponder: () => !off,
|
|
953
|
+
onMoveShouldSetResponder: () => !off,
|
|
954
|
+
onResponderTerminationRequest: () => false,
|
|
955
|
+
onResponderGrant: begin,
|
|
956
|
+
onResponderMove: move,
|
|
957
|
+
onResponderRelease: end,
|
|
958
|
+
onResponderTerminate: end
|
|
959
|
+
};
|
|
960
|
+
return /* @__PURE__ */ jsxs(
|
|
961
|
+
XStack,
|
|
962
|
+
{
|
|
963
|
+
position: "relative",
|
|
964
|
+
flexDirection: axis ? "column" : "row",
|
|
965
|
+
items: "center",
|
|
966
|
+
justify: "center",
|
|
967
|
+
shrink: 0,
|
|
968
|
+
width: axis ? THICKNESS : "100%",
|
|
969
|
+
height: axis ? "100%" : THICKNESS,
|
|
970
|
+
hitSlop: HIT_SLOP3,
|
|
971
|
+
cursor: off ? "default" : axis ? "col-resize" : "row-resize",
|
|
972
|
+
tabIndex: off ? -1 : 0,
|
|
973
|
+
role: "separator",
|
|
974
|
+
"aria-orientation": axis ? "vertical" : "horizontal",
|
|
975
|
+
"data-panel-group-direction": group?.direction,
|
|
976
|
+
"data-resize-handle-state": state,
|
|
977
|
+
...gesture,
|
|
978
|
+
...rest,
|
|
979
|
+
children: [
|
|
980
|
+
/* @__PURE__ */ jsx(
|
|
981
|
+
Separator,
|
|
982
|
+
{
|
|
983
|
+
vertical: axis,
|
|
984
|
+
borderColor: state === "idle" ? "$borderColor" : "$color8"
|
|
985
|
+
}
|
|
986
|
+
),
|
|
987
|
+
withHandle && /* @__PURE__ */ jsx(
|
|
988
|
+
XStack,
|
|
989
|
+
{
|
|
990
|
+
position: "absolute",
|
|
991
|
+
items: "center",
|
|
992
|
+
justify: "center",
|
|
993
|
+
width: 12,
|
|
994
|
+
height: 20,
|
|
995
|
+
rounded: "$2",
|
|
996
|
+
bg: "$color5",
|
|
997
|
+
borderWidth: 1,
|
|
998
|
+
borderColor: "$borderColor",
|
|
999
|
+
rotate: axis ? "0deg" : "90deg",
|
|
1000
|
+
children: /* @__PURE__ */ jsx(GripVertical, { size: 10 })
|
|
1001
|
+
}
|
|
1002
|
+
)
|
|
1003
|
+
]
|
|
1004
|
+
}
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
1007
|
+
var BAR = 10;
|
|
1008
|
+
var TOUCH2 = 44;
|
|
1009
|
+
var SLOP = (TOUCH2 - BAR) / 2;
|
|
1010
|
+
var ZERO = { offset: 0, viewport: 0, content: 0 };
|
|
1011
|
+
var Ctx = /* @__PURE__ */ createContext(null);
|
|
1012
|
+
var clamp2 = (n, max) => n < 0 ? 0 : n > max ? max : n;
|
|
1013
|
+
var ScrollBar = /* @__PURE__ */ forwardRef(
|
|
1014
|
+
function ScrollBar2({ orientation = "vertical", ...props }, ref) {
|
|
1015
|
+
const ctx = useContext(Ctx);
|
|
1016
|
+
const [len, setLen] = useState(0);
|
|
1017
|
+
const from = useRef(null);
|
|
1018
|
+
if (!ctx || ctx.axis !== orientation) return null;
|
|
1019
|
+
const vertical = orientation === "vertical";
|
|
1020
|
+
const { content, viewport, offset } = ctx.track;
|
|
1021
|
+
const scrollable = content - viewport;
|
|
1022
|
+
const overflow = scrollable > 1;
|
|
1023
|
+
const shown = ctx.type === "always" ? true : !overflow ? false : ctx.type === "auto" ? true : ctx.active;
|
|
1024
|
+
const thumb = Math.max(TOUCH2, len * (viewport / Math.max(content, 1)));
|
|
1025
|
+
const range = Math.max(len - thumb, 0);
|
|
1026
|
+
const at = overflow ? range * clamp2(offset / scrollable, 1) : 0;
|
|
1027
|
+
const coord = (e) => vertical ? e.nativeEvent.pageY : e.nativeEvent.pageX;
|
|
1028
|
+
return /* @__PURE__ */ jsx(
|
|
1029
|
+
XStack,
|
|
1030
|
+
{
|
|
1031
|
+
ref,
|
|
1032
|
+
...slot("scroll-area-scrollbar"),
|
|
1033
|
+
position: "absolute",
|
|
1034
|
+
...vertical ? {
|
|
1035
|
+
t: 0,
|
|
1036
|
+
b: 0,
|
|
1037
|
+
...ctx.rtl ? { l: 0 } : { r: 0 },
|
|
1038
|
+
width: BAR,
|
|
1039
|
+
flexDirection: "column"
|
|
1040
|
+
} : { l: 0, r: 0, b: 0, height: BAR, flexDirection: "row" },
|
|
1041
|
+
p: 1,
|
|
1042
|
+
opacity: shown ? 1 : 0,
|
|
1043
|
+
pointerEvents: shown ? "auto" : "none",
|
|
1044
|
+
onLayout: (e) => setLen(
|
|
1045
|
+
vertical ? e.nativeEvent.layout.height : e.nativeEvent.layout.width
|
|
1046
|
+
),
|
|
1047
|
+
...props,
|
|
1048
|
+
children: /* @__PURE__ */ jsx(
|
|
1049
|
+
YStack,
|
|
1050
|
+
{
|
|
1051
|
+
...slot("scroll-area-thumb"),
|
|
1052
|
+
bg: "$borderColor",
|
|
1053
|
+
rounded: BAR,
|
|
1054
|
+
hitSlop: vertical ? { left: SLOP, right: SLOP } : { top: SLOP, bottom: SLOP },
|
|
1055
|
+
...vertical ? { width: "100%", height: thumb, y: at } : { height: "100%", width: thumb, x: at },
|
|
1056
|
+
onStartShouldSetResponder: () => true,
|
|
1057
|
+
onMoveShouldSetResponder: () => true,
|
|
1058
|
+
onResponderGrant: (e) => {
|
|
1059
|
+
from.current = coord(e);
|
|
1060
|
+
},
|
|
1061
|
+
onResponderMove: (e) => {
|
|
1062
|
+
const start = from.current;
|
|
1063
|
+
if (start === null || range === 0) return;
|
|
1064
|
+
const now = coord(e);
|
|
1065
|
+
from.current = now;
|
|
1066
|
+
ctx.scrollBy((now - start) * scrollable / range);
|
|
1067
|
+
},
|
|
1068
|
+
onResponderRelease: () => {
|
|
1069
|
+
from.current = null;
|
|
1070
|
+
},
|
|
1071
|
+
onResponderTerminate: () => {
|
|
1072
|
+
from.current = null;
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
)
|
|
1076
|
+
}
|
|
1077
|
+
);
|
|
1078
|
+
}
|
|
1079
|
+
);
|
|
1080
|
+
var ScrollArea = /* @__PURE__ */ forwardRef(
|
|
1081
|
+
function ScrollArea2({
|
|
1082
|
+
type = "hover",
|
|
1083
|
+
scrollHideDelay = 600,
|
|
1084
|
+
dir,
|
|
1085
|
+
horizontal = false,
|
|
1086
|
+
children,
|
|
1087
|
+
...props
|
|
1088
|
+
}, ref) {
|
|
1089
|
+
const viewport = useRef(null);
|
|
1090
|
+
const live = useRef(ZERO);
|
|
1091
|
+
const [track, setTrack] = useState(ZERO);
|
|
1092
|
+
const [active, setActive] = useState(false);
|
|
1093
|
+
const timer = useRef(null);
|
|
1094
|
+
const axis = horizontal ? "horizontal" : "vertical";
|
|
1095
|
+
const put = useCallback((patch) => {
|
|
1096
|
+
const next = { ...live.current, ...patch };
|
|
1097
|
+
live.current = next;
|
|
1098
|
+
setTrack(next);
|
|
1099
|
+
}, []);
|
|
1100
|
+
const clear = () => {
|
|
1101
|
+
if (timer.current) clearTimeout(timer.current);
|
|
1102
|
+
timer.current = null;
|
|
1103
|
+
};
|
|
1104
|
+
const hold = () => {
|
|
1105
|
+
clear();
|
|
1106
|
+
setActive(true);
|
|
1107
|
+
};
|
|
1108
|
+
const wake = useCallback(() => {
|
|
1109
|
+
setActive(true);
|
|
1110
|
+
clear();
|
|
1111
|
+
timer.current = setTimeout(() => setActive(false), scrollHideDelay);
|
|
1112
|
+
}, [scrollHideDelay]);
|
|
1113
|
+
useEffect(() => clear, []);
|
|
1114
|
+
const scrollBy = useCallback(
|
|
1115
|
+
(delta) => {
|
|
1116
|
+
const t = live.current;
|
|
1117
|
+
const next = clamp2(
|
|
1118
|
+
t.offset + delta,
|
|
1119
|
+
Math.max(t.content - t.viewport, 0)
|
|
1120
|
+
);
|
|
1121
|
+
put({ offset: next });
|
|
1122
|
+
viewport.current?.scrollTo(
|
|
1123
|
+
horizontal ? { x: next, y: 0, animated: false } : { x: 0, y: next, animated: false }
|
|
1124
|
+
);
|
|
1125
|
+
},
|
|
1126
|
+
[horizontal, put]
|
|
1127
|
+
);
|
|
1128
|
+
return /* @__PURE__ */ jsxs(
|
|
1129
|
+
YStack,
|
|
1130
|
+
{
|
|
1131
|
+
ref,
|
|
1132
|
+
...slot("scroll-area"),
|
|
1133
|
+
position: "relative",
|
|
1134
|
+
overflow: "hidden",
|
|
1135
|
+
onMouseEnter: type === "hover" ? hold : void 0,
|
|
1136
|
+
onMouseLeave: type === "hover" ? wake : void 0,
|
|
1137
|
+
...props,
|
|
1138
|
+
children: [
|
|
1139
|
+
/* @__PURE__ */ jsx(
|
|
1140
|
+
ScrollView,
|
|
1141
|
+
{
|
|
1142
|
+
ref: viewport,
|
|
1143
|
+
...slot("scroll-area-viewport"),
|
|
1144
|
+
flex: 1,
|
|
1145
|
+
width: "100%",
|
|
1146
|
+
height: "100%",
|
|
1147
|
+
horizontal,
|
|
1148
|
+
showsVerticalScrollIndicator: false,
|
|
1149
|
+
showsHorizontalScrollIndicator: false,
|
|
1150
|
+
scrollEventThrottle: 16,
|
|
1151
|
+
onLayout: (e) => put({
|
|
1152
|
+
viewport: horizontal ? e.nativeEvent.layout.width : e.nativeEvent.layout.height
|
|
1153
|
+
}),
|
|
1154
|
+
onContentSizeChange: (w, h) => put({ content: horizontal ? w : h }),
|
|
1155
|
+
onScroll: (e) => {
|
|
1156
|
+
const { contentOffset } = e.nativeEvent;
|
|
1157
|
+
put({ offset: horizontal ? contentOffset.x : contentOffset.y });
|
|
1158
|
+
wake();
|
|
1159
|
+
},
|
|
1160
|
+
children
|
|
1161
|
+
}
|
|
1162
|
+
),
|
|
1163
|
+
/* @__PURE__ */ jsx(
|
|
1164
|
+
Ctx.Provider,
|
|
1165
|
+
{
|
|
1166
|
+
value: { axis, track, type, active, rtl: dir === "rtl", scrollBy },
|
|
1167
|
+
children: /* @__PURE__ */ jsx(ScrollBar, { orientation: axis })
|
|
1168
|
+
}
|
|
1169
|
+
)
|
|
1170
|
+
]
|
|
1171
|
+
}
|
|
1172
|
+
);
|
|
1173
|
+
}
|
|
1174
|
+
);
|
|
1175
|
+
var ROW_H = 32;
|
|
1176
|
+
var HIT_SLOP4 = (44 - ROW_H) / 2;
|
|
1177
|
+
var Select = Select$1;
|
|
1178
|
+
var SelectGroup = Select$1.Group;
|
|
1179
|
+
var SelectValue = Select$1.Value;
|
|
1180
|
+
var SelectTrigger = ({ children, ...props }) => /* @__PURE__ */ jsxs(
|
|
1181
|
+
Select$1.Trigger,
|
|
1182
|
+
{
|
|
1183
|
+
...slot("select-trigger"),
|
|
1184
|
+
unstyled: true,
|
|
1185
|
+
items: "center",
|
|
1186
|
+
justify: "space-between",
|
|
1187
|
+
gap: "$2",
|
|
1188
|
+
height: 36,
|
|
1189
|
+
px: "$3",
|
|
1190
|
+
rounded: "$3",
|
|
1191
|
+
borderWidth: 1,
|
|
1192
|
+
borderColor: "$borderColor",
|
|
1193
|
+
bg: "transparent",
|
|
1194
|
+
cursor: "pointer",
|
|
1195
|
+
hitSlop: 4,
|
|
1196
|
+
...props,
|
|
1197
|
+
children: [
|
|
1198
|
+
ink(children, void 0, { size: "$2" }),
|
|
1199
|
+
/* @__PURE__ */ jsx(Select$1.Icon, { children: /* @__PURE__ */ jsx(ChevronDown, { size: 16, opacity: 0.5 }) })
|
|
1200
|
+
]
|
|
1201
|
+
}
|
|
1202
|
+
);
|
|
1203
|
+
var SelectItem = ({ children, ...props }) => /* @__PURE__ */ jsxs(
|
|
1204
|
+
Select$1.Item,
|
|
1205
|
+
{
|
|
1206
|
+
...slot("select-item"),
|
|
1207
|
+
unstyled: true,
|
|
1208
|
+
index: props.index ?? 0,
|
|
1209
|
+
items: "center",
|
|
1210
|
+
gap: "$2",
|
|
1211
|
+
minH: ROW_H,
|
|
1212
|
+
pl: "$2",
|
|
1213
|
+
pr: "$7",
|
|
1214
|
+
rounded: "$2",
|
|
1215
|
+
cursor: "pointer",
|
|
1216
|
+
hitSlop: HIT_SLOP4,
|
|
1217
|
+
hoverStyle: { bg: "$color5" },
|
|
1218
|
+
focusStyle: { bg: "$color5" },
|
|
1219
|
+
...props,
|
|
1220
|
+
children: [
|
|
1221
|
+
/* @__PURE__ */ jsx(Select$1.ItemText, { children }),
|
|
1222
|
+
/* @__PURE__ */ jsx(XStack, { position: "absolute", r: "$2", items: "center", justify: "center", pointerEvents: "none", children: /* @__PURE__ */ jsx(Select$1.ItemIndicator, { children: /* @__PURE__ */ jsx(Check, { size: 16 }) }) })
|
|
1223
|
+
]
|
|
1224
|
+
}
|
|
1225
|
+
);
|
|
1226
|
+
var stampIndices = (children, next) => Children.map(children, (child) => {
|
|
1227
|
+
if (!isValidElement(child)) return child;
|
|
1228
|
+
if (child.type === SelectItem) return cloneElement(child, { index: next() });
|
|
1229
|
+
const kids = child.props.children;
|
|
1230
|
+
return kids === void 0 ? child : cloneElement(child, void 0, stampIndices(kids, next));
|
|
1231
|
+
});
|
|
1232
|
+
var SelectScrollUpButton = (props) => /* @__PURE__ */ jsx(Select$1.ScrollUpButton, { ...slot("select-scroll-up-button"), items: "center", justify: "center", py: "$1", ...props, children: /* @__PURE__ */ jsx(ChevronUp, { size: 16 }) });
|
|
1233
|
+
var SelectScrollDownButton = (props) => /* @__PURE__ */ jsx(Select$1.ScrollDownButton, { ...slot("select-scroll-down-button"), items: "center", justify: "center", py: "$1", ...props, children: /* @__PURE__ */ jsx(ChevronDown, { size: 16 }) });
|
|
1234
|
+
var SelectContent = ({ children, ...props }) => {
|
|
1235
|
+
let n = 0;
|
|
1236
|
+
return /* @__PURE__ */ jsxs(Select$1.Content, { ...slot("select-content"), ...props, children: [
|
|
1237
|
+
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
1238
|
+
/* @__PURE__ */ jsx(
|
|
1239
|
+
Select$1.Viewport,
|
|
1240
|
+
{
|
|
1241
|
+
minW: 128,
|
|
1242
|
+
p: "$1",
|
|
1243
|
+
bg: "$color2",
|
|
1244
|
+
borderWidth: 1,
|
|
1245
|
+
borderColor: "$borderColor",
|
|
1246
|
+
rounded: "$4",
|
|
1247
|
+
children: stampIndices(children, () => n++)
|
|
1248
|
+
}
|
|
1249
|
+
),
|
|
1250
|
+
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
1251
|
+
] });
|
|
1252
|
+
};
|
|
1253
|
+
var SelectLabel = (props) => /* @__PURE__ */ jsx(Select$1.Label, { ...slot("select-label"), px: "$2", py: "$1.5", fontSize: "$1", color: "$color11", ...props });
|
|
1254
|
+
var SelectSeparator = (props) => /* @__PURE__ */ jsx(SelectSeparator$1, { ...slot("select-separator"), my: "$1", borderColor: "$borderColor", ...props });
|
|
1255
|
+
var Separator3 = ({ orientation = "horizontal", decorative: _decorative, ...props }) => /* @__PURE__ */ jsx(
|
|
1256
|
+
Separator,
|
|
1257
|
+
{
|
|
1258
|
+
...slot("separator"),
|
|
1259
|
+
"data-orientation": orientation,
|
|
1260
|
+
vertical: orientation === "vertical",
|
|
1261
|
+
borderColor: "$borderColor",
|
|
1262
|
+
...props
|
|
1263
|
+
}
|
|
1264
|
+
);
|
|
1265
|
+
var TRACK = 6;
|
|
1266
|
+
var THUMB = 16;
|
|
1267
|
+
var HIT_SLOP5 = (44 - THUMB) / 2;
|
|
1268
|
+
var Slider = (props) => /* @__PURE__ */ jsxs(Slider$1, { ...slot("slider"), width: "100%", ...props, children: [
|
|
1269
|
+
/* @__PURE__ */ jsx(Slider$1.Track, { ...slot("slider-track"), height: TRACK, bg: "$color4", rounded: "$10", children: /* @__PURE__ */ jsx(Slider$1.TrackActive, { ...slot("slider-range"), bg: "$color12" }) }),
|
|
1270
|
+
/* @__PURE__ */ jsx(
|
|
1271
|
+
Slider$1.Thumb,
|
|
1272
|
+
{
|
|
1273
|
+
...slot("slider-thumb"),
|
|
1274
|
+
index: 0,
|
|
1275
|
+
circular: true,
|
|
1276
|
+
size: THUMB,
|
|
1277
|
+
bg: "$background",
|
|
1278
|
+
borderWidth: 1,
|
|
1279
|
+
borderColor: "$color12",
|
|
1280
|
+
hitSlop: HIT_SLOP5
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
] });
|
|
1284
|
+
var TRACK_H = 20;
|
|
1285
|
+
var THUMB2 = 16;
|
|
1286
|
+
var HIT_SLOP6 = (44 - TRACK_H) / 2;
|
|
1287
|
+
var Switch = (props) => /* @__PURE__ */ jsx(
|
|
1288
|
+
Switch$1,
|
|
1289
|
+
{
|
|
1290
|
+
...slot("switch"),
|
|
1291
|
+
width: 36,
|
|
1292
|
+
height: TRACK_H,
|
|
1293
|
+
p: 2,
|
|
1294
|
+
shrink: 0,
|
|
1295
|
+
hitSlop: HIT_SLOP6,
|
|
1296
|
+
...props,
|
|
1297
|
+
children: /* @__PURE__ */ jsx(
|
|
1298
|
+
Switch$1.Thumb,
|
|
1299
|
+
{
|
|
1300
|
+
...slot("switch-thumb"),
|
|
1301
|
+
width: THUMB2,
|
|
1302
|
+
height: THUMB2
|
|
1303
|
+
}
|
|
1304
|
+
)
|
|
1305
|
+
}
|
|
1306
|
+
);
|
|
1307
|
+
var ROW_H2 = 36;
|
|
1308
|
+
var HIT_SLOP7 = (44 - ROW_H2) / 2;
|
|
1309
|
+
var Tabs = (p) => /* @__PURE__ */ jsx(Tabs$1, { ...slot("tabs"), flexDirection: "column", gap: "$2", ...p });
|
|
1310
|
+
var TabsList = (p) => /* @__PURE__ */ jsx(
|
|
1311
|
+
Tabs$1.List,
|
|
1312
|
+
{
|
|
1313
|
+
...slot("tabs-list"),
|
|
1314
|
+
items: "center",
|
|
1315
|
+
justify: "center",
|
|
1316
|
+
self: "flex-start",
|
|
1317
|
+
height: ROW_H2,
|
|
1318
|
+
p: 3,
|
|
1319
|
+
gap: 2,
|
|
1320
|
+
bg: "$color3",
|
|
1321
|
+
rounded: "$4",
|
|
1322
|
+
...p
|
|
1323
|
+
}
|
|
1324
|
+
);
|
|
1325
|
+
var TabsTrigger = ({ children, ...p }) => /* @__PURE__ */ jsx(
|
|
1326
|
+
Tabs$1.Tab,
|
|
1327
|
+
{
|
|
1328
|
+
...slot("tabs-trigger"),
|
|
1329
|
+
unstyled: true,
|
|
1330
|
+
items: "center",
|
|
1331
|
+
justify: "center",
|
|
1332
|
+
height: "100%",
|
|
1333
|
+
px: "$3",
|
|
1334
|
+
gap: "$1.5",
|
|
1335
|
+
rounded: "$3",
|
|
1336
|
+
cursor: "pointer",
|
|
1337
|
+
hitSlop: HIT_SLOP7,
|
|
1338
|
+
hoverStyle: { bg: "$color4" },
|
|
1339
|
+
focusStyle: { bg: "$color4" },
|
|
1340
|
+
...p,
|
|
1341
|
+
children: ink(children, void 0, { size: "$2", fontWeight: "500" })
|
|
1342
|
+
}
|
|
1343
|
+
);
|
|
1344
|
+
var TabsContent = (p) => /* @__PURE__ */ jsx(Tabs$1.Content, { ...slot("tabs-content"), flex: 1, ...p });
|
|
1345
|
+
var MIN_ROWS = 3;
|
|
1346
|
+
var rowsOf = (v) => typeof v === "string" ? v.split("\n").length : 0;
|
|
1347
|
+
var Textarea = /* @__PURE__ */ React.forwardRef(function Textarea2({ rows, value, defaultValue, ...props }, ref) {
|
|
1348
|
+
const [typed, setTyped] = React.useState(() => rowsOf(defaultValue));
|
|
1349
|
+
const uncontrolled = value === void 0;
|
|
1350
|
+
const invalid = props["aria-invalid"];
|
|
1351
|
+
return /* @__PURE__ */ jsx(
|
|
1352
|
+
TextArea,
|
|
1353
|
+
{
|
|
1354
|
+
ref,
|
|
1355
|
+
"data-slot": "textarea",
|
|
1356
|
+
rows: Math.max(rows ?? MIN_ROWS, uncontrolled ? typed : rowsOf(value)),
|
|
1357
|
+
value,
|
|
1358
|
+
defaultValue,
|
|
1359
|
+
onChangeText: uncontrolled ? (t) => setTyped(rowsOf(t)) : void 0,
|
|
1360
|
+
width: "100%",
|
|
1361
|
+
minH: 64,
|
|
1362
|
+
rounded: "$4",
|
|
1363
|
+
bg: "transparent",
|
|
1364
|
+
borderWidth: 1,
|
|
1365
|
+
borderColor: invalid && invalid !== "false" ? "$red7" : "$borderColor",
|
|
1366
|
+
placeholderTextColor: "$color10",
|
|
1367
|
+
fontSize: "$3",
|
|
1368
|
+
opacity: props.disabled ? 0.5 : 1,
|
|
1369
|
+
...props
|
|
1370
|
+
}
|
|
1371
|
+
);
|
|
1372
|
+
});
|
|
1373
|
+
var Toaster = /* @__PURE__ */ forwardRef(function Toaster2(props, ref) {
|
|
1374
|
+
const { theme = "system", toastOptions, ...rest } = props;
|
|
1375
|
+
return /* @__PURE__ */ jsx(Toaster$1, { ref, theme, toastOptions, ...rest });
|
|
1376
|
+
});
|
|
1377
|
+
var DEFAULT_OFFSET2 = 4;
|
|
1378
|
+
var Tooltip = (props) => /* @__PURE__ */ jsx(Tooltip$1, { offset: DEFAULT_OFFSET2, ...props });
|
|
1379
|
+
var TooltipTrigger = Tooltip$1.Trigger;
|
|
1380
|
+
var TooltipProvider = TooltipGroup;
|
|
1381
|
+
var TooltipContent = ({ sideOffset: _sideOffset, children, ...props }) => {
|
|
1382
|
+
const themeName = useThemeName();
|
|
1383
|
+
return /* @__PURE__ */ jsx(PortalTheme, { name: themeName, children: /* @__PURE__ */ jsx(
|
|
1384
|
+
Tooltip$1.Content,
|
|
1385
|
+
{
|
|
1386
|
+
...slot("tooltip-content"),
|
|
1387
|
+
bg: "$color2",
|
|
1388
|
+
borderWidth: 1,
|
|
1389
|
+
borderColor: "$borderColor",
|
|
1390
|
+
rounded: "$3",
|
|
1391
|
+
px: "$3",
|
|
1392
|
+
py: "$1.5",
|
|
1393
|
+
...props,
|
|
1394
|
+
children: ink(children, void 0, { size: "$1" })
|
|
1395
|
+
}
|
|
1396
|
+
) });
|
|
1397
|
+
};
|
|
1398
|
+
|
|
1399
|
+
export { AspectRatio, Avatar, AvatarFallback, AvatarImage, Badge, Button, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Checkbox, Collapsible, CollapsibleContent, CollapsibleTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Dialog2 as Dialog, DialogClose, DialogContent2 as DialogContent, DialogDescription2 as DialogDescription, DialogFooter, DialogHeader, DialogOverlay2 as DialogOverlay, DialogPortal2 as DialogPortal, DialogTitle2 as DialogTitle, DialogTrigger, Input2 as Input, Label, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverTrigger, Progress, ResizableHandle, ResizablePanel, ResizablePanelGroup, ScrollArea, ScrollBar, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, Slider, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Toaster, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, badgeVariants, buttonVariants };
|
|
1400
|
+
//# sourceMappingURL=chunk-RCMDRI6V.js.map
|
|
1401
|
+
//# sourceMappingURL=chunk-RCMDRI6V.js.map
|