@open-dy/vibecoding-sdk-taro 0.0.1-beta.5 → 0.0.1-beta.7
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/adapters/interest-card/eslint/eslint-plugin-custom-navigation.mjs +2 -290
- package/dist/adapters/interest-card/eslint/taro.mjs +8 -42
- package/dist/components/miniapp-open-card.d.ts +46 -1
- package/dist/components/miniapp-open-card.js +14 -1
- package/dist/components/miniapp-open-card.js.map +1 -1
- package/dist/eslint/eslint-plugin-custom-navigation.mjs +290 -0
- package/dist/eslint/taro.mjs +35 -1
- package/dist/reference/llms.txt +76 -34
- package/dist/reference/sdk-api/build/taro/BuildContext.md +7 -2
- package/dist/reference/sdk-api/build/taro/CreateMicroappTaroConfigOptions.md +1 -2
- package/dist/reference/sdk-api/build/taro/createMicroappTaroConfig.md +1 -2
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCard.md +109 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCardEnvVersion.md +38 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCardErrorDetail.md +52 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/MiniappOpenCardProps.md +76 -0
- package/dist/reference/sdk-api/components/miniapp-open-card/index.md +12 -0
- package/dist/reference/sdk-api/libraries/lucide-taro.md +151 -0
- package/dist/reference/sdk-api/runtime/CreateMicroappClientOptions.md +7 -2
- package/dist/reference/sdk-api/runtime/createMicroappClient.md +8 -3
- package/dist/reference/sdk-api/ui/accordion/Accordion.md +114 -0
- package/dist/reference/sdk-api/ui/accordion/AccordionContent.md +100 -0
- package/dist/reference/sdk-api/ui/accordion/AccordionItem.md +107 -0
- package/dist/reference/sdk-api/ui/accordion/AccordionTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/accordion/index.md +12 -0
- package/dist/reference/sdk-api/ui/alert/Alert.md +106 -0
- package/dist/reference/sdk-api/ui/alert/AlertAction.md +100 -0
- package/dist/reference/sdk-api/ui/alert/AlertDescription.md +100 -0
- package/dist/reference/sdk-api/ui/alert/AlertTitle.md +100 -0
- package/dist/reference/sdk-api/ui/alert/index.md +12 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialog.md +58 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogAction.md +107 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogCancel.md +107 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogContent.md +106 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogDescription.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogFooter.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogHeader.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogPortal.md +55 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTitle.md +100 -0
- package/dist/reference/sdk-api/ui/alert-dialog/AlertDialogTrigger.md +118 -0
- package/dist/reference/sdk-api/ui/alert-dialog/index.md +19 -0
- package/dist/reference/sdk-api/ui/aspect-ratio/AspectRatio.md +106 -0
- package/dist/reference/sdk-api/ui/aspect-ratio/index.md +9 -0
- package/dist/reference/sdk-api/ui/avatar/Avatar.md +106 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarBadge.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarFallback.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarGroup.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarGroupCount.md +100 -0
- package/dist/reference/sdk-api/ui/avatar/AvatarImage.md +108 -0
- package/dist/reference/sdk-api/ui/avatar/index.md +14 -0
- package/dist/reference/sdk-api/ui/badge/Badge.md +114 -0
- package/dist/reference/sdk-api/ui/badge/badgeVariants.md +70 -0
- package/dist/reference/sdk-api/ui/badge/index.md +10 -0
- package/dist/reference/sdk-api/ui/button/Button.md +210 -0
- package/dist/reference/sdk-api/ui/button/ButtonProps.md +188 -0
- package/dist/reference/sdk-api/ui/button/buttonVariants.md +84 -0
- package/dist/reference/sdk-api/ui/button/index.md +11 -0
- package/dist/reference/sdk-api/ui/button-group/ButtonGroup.md +106 -0
- package/dist/reference/sdk-api/ui/button-group/ButtonGroupSeparator.md +106 -0
- package/dist/reference/sdk-api/ui/button-group/ButtonGroupText.md +106 -0
- package/dist/reference/sdk-api/ui/button-group/buttonGroupVariants.md +70 -0
- package/dist/reference/sdk-api/ui/button-group/index.md +12 -0
- package/dist/reference/sdk-api/ui/calendar/Calendar.md +144 -0
- package/dist/reference/sdk-api/ui/calendar/CalendarProps.md +118 -0
- package/dist/reference/sdk-api/ui/calendar/index.md +10 -0
- package/dist/reference/sdk-api/ui/card/Card.md +106 -0
- package/dist/reference/sdk-api/ui/card/CardAction.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardContent.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardDescription.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardFooter.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardHeader.md +100 -0
- package/dist/reference/sdk-api/ui/card/CardTitle.md +100 -0
- package/dist/reference/sdk-api/ui/card/index.md +15 -0
- package/dist/reference/sdk-api/ui/carousel/Carousel.md +108 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselContent.md +100 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselItem.md +100 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselNext.md +219 -0
- package/dist/reference/sdk-api/ui/carousel/CarouselPrevious.md +219 -0
- package/dist/reference/sdk-api/ui/carousel/index.md +14 -0
- package/dist/reference/sdk-api/ui/carousel/useCarousel.md +46 -0
- package/dist/reference/sdk-api/ui/checkbox/Checkbox.md +109 -0
- package/dist/reference/sdk-api/ui/checkbox/index.md +9 -0
- package/dist/reference/sdk-api/ui/collapsible/Collapsible.md +108 -0
- package/dist/reference/sdk-api/ui/collapsible/CollapsibleContent.md +100 -0
- package/dist/reference/sdk-api/ui/collapsible/CollapsibleTrigger.md +119 -0
- package/dist/reference/sdk-api/ui/collapsible/index.md +11 -0
- package/dist/reference/sdk-api/ui/combobox/Combobox.md +124 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxChip.md +107 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxChips.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxChipsInput.md +107 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxCollection.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxContent.md +106 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxEmpty.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxGroup.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxInput.md +113 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxItem.md +106 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxLabel.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxList.md +105 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/combobox/ComboboxValue.md +105 -0
- package/dist/reference/sdk-api/ui/combobox/index.md +24 -0
- package/dist/reference/sdk-api/ui/combobox/useComboboxAnchor.md +43 -0
- package/dist/reference/sdk-api/ui/dialog/Dialog.md +58 -0
- package/dist/reference/sdk-api/ui/dialog/DialogClose.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogContent.md +107 -0
- package/dist/reference/sdk-api/ui/dialog/DialogDescription.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogFooter.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogHeader.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogPortal.md +55 -0
- package/dist/reference/sdk-api/ui/dialog/DialogTitle.md +100 -0
- package/dist/reference/sdk-api/ui/dialog/DialogTrigger.md +106 -0
- package/dist/reference/sdk-api/ui/dialog/index.md +18 -0
- package/dist/reference/sdk-api/ui/drawer/Drawer.md +59 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerClose.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerContent.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerDescription.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerFooter.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerHeader.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerPortal.md +55 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerTitle.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/DrawerTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/drawer/index.md +18 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenu.md +58 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuCheckboxItem.md +107 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuContent.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuGroup.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuItem.md +107 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuLabel.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuPortal.md +55 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioGroup.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuRadioItem.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuShortcut.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSub.md +58 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubContent.md +100 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuSubTrigger.md +106 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/DropdownMenuTrigger.md +119 -0
- package/dist/reference/sdk-api/ui/dropdown-menu/index.md +23 -0
- package/dist/reference/sdk-api/ui/empty/Empty.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyContent.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyDescription.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyHeader.md +100 -0
- package/dist/reference/sdk-api/ui/empty/EmptyMedia.md +106 -0
- package/dist/reference/sdk-api/ui/empty/EmptyTitle.md +100 -0
- package/dist/reference/sdk-api/ui/empty/index.md +14 -0
- package/dist/reference/sdk-api/ui/field/Field.md +106 -0
- package/dist/reference/sdk-api/ui/field/FieldContent.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldDescription.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldError.md +112 -0
- package/dist/reference/sdk-api/ui/field/FieldGroup.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldLabel.md +85 -0
- package/dist/reference/sdk-api/ui/field/FieldLegend.md +106 -0
- package/dist/reference/sdk-api/ui/field/FieldSeparator.md +105 -0
- package/dist/reference/sdk-api/ui/field/FieldSet.md +100 -0
- package/dist/reference/sdk-api/ui/field/FieldTitle.md +100 -0
- package/dist/reference/sdk-api/ui/field/index.md +18 -0
- package/dist/reference/sdk-api/ui/helpers/collectDataIconState.md +66 -0
- package/dist/reference/sdk-api/ui/helpers/index.md +9 -0
- package/dist/reference/sdk-api/ui/index.md +57 -0
- package/dist/reference/sdk-api/ui/input/Input.md +141 -0
- package/dist/reference/sdk-api/ui/input/index.md +9 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroup.md +100 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupAddon.md +109 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupButton.md +220 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupInput.md +135 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupText.md +100 -0
- package/dist/reference/sdk-api/ui/input-group/InputGroupTextarea.md +126 -0
- package/dist/reference/sdk-api/ui/input-group/index.md +14 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTP.md +111 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTPGroup.md +100 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTPSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/input-otp/InputOTPSlot.md +107 -0
- package/dist/reference/sdk-api/ui/input-otp/index.md +12 -0
- package/dist/reference/sdk-api/ui/item/Item.md +115 -0
- package/dist/reference/sdk-api/ui/item/ItemActions.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemContent.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemDescription.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemFooter.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemGroup.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemHeader.md +100 -0
- package/dist/reference/sdk-api/ui/item/ItemMedia.md +106 -0
- package/dist/reference/sdk-api/ui/item/ItemSeparator.md +106 -0
- package/dist/reference/sdk-api/ui/item/ItemTitle.md +100 -0
- package/dist/reference/sdk-api/ui/item/index.md +18 -0
- package/dist/reference/sdk-api/ui/label/Label.md +85 -0
- package/dist/reference/sdk-api/ui/label/index.md +9 -0
- package/dist/reference/sdk-api/ui/menubar/Menubar.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarCheckboxItem.md +111 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarContent.md +108 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarGroup.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarItem.md +109 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarLabel.md +106 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarMenu.md +55 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarPortal.md +55 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarRadioGroup.md +108 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarRadioItem.md +110 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarShortcut.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSub.md +58 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSubContent.md +108 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarSubTrigger.md +107 -0
- package/dist/reference/sdk-api/ui/menubar/MenubarTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/menubar/index.md +24 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenu.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuContent.md +106 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuIndicator.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuItem.md +106 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuLink.md +106 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuList.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuPositioner.md +100 -0
- package/dist/reference/sdk-api/ui/navigation-menu/NavigationMenuTrigger.md +120 -0
- package/dist/reference/sdk-api/ui/navigation-menu/index.md +17 -0
- package/dist/reference/sdk-api/ui/navigation-menu/navigationMenuTriggerStyle.md +64 -0
- package/dist/reference/sdk-api/ui/pagination/Pagination.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationContent.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationEllipsis.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationItem.md +100 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationLink.md +107 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationNext.md +121 -0
- package/dist/reference/sdk-api/ui/pagination/PaginationPrevious.md +121 -0
- package/dist/reference/sdk-api/ui/pagination/index.md +15 -0
- package/dist/reference/sdk-api/ui/popover/Popover.md +58 -0
- package/dist/reference/sdk-api/ui/popover/PopoverAnchor.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverContent.md +108 -0
- package/dist/reference/sdk-api/ui/popover/PopoverDescription.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverHeader.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverTitle.md +100 -0
- package/dist/reference/sdk-api/ui/popover/PopoverTrigger.md +119 -0
- package/dist/reference/sdk-api/ui/popover/index.md +15 -0
- package/dist/reference/sdk-api/ui/portal/Portal.md +55 -0
- package/dist/reference/sdk-api/ui/portal/index.md +9 -0
- package/dist/reference/sdk-api/ui/progress/Progress.md +109 -0
- package/dist/reference/sdk-api/ui/progress/ProgressIndicator.md +107 -0
- package/dist/reference/sdk-api/ui/progress/ProgressLabel.md +100 -0
- package/dist/reference/sdk-api/ui/progress/ProgressTrack.md +100 -0
- package/dist/reference/sdk-api/ui/progress/ProgressValue.md +105 -0
- package/dist/reference/sdk-api/ui/progress/index.md +13 -0
- package/dist/reference/sdk-api/ui/radio-group/RadioGroup.md +108 -0
- package/dist/reference/sdk-api/ui/radio-group/RadioGroupItem.md +107 -0
- package/dist/reference/sdk-api/ui/radio-group/index.md +10 -0
- package/dist/reference/sdk-api/ui/resizable/ResizableHandle.md +107 -0
- package/dist/reference/sdk-api/ui/resizable/ResizablePanel.md +108 -0
- package/dist/reference/sdk-api/ui/resizable/ResizablePanelGroup.md +107 -0
- package/dist/reference/sdk-api/ui/resizable/index.md +11 -0
- package/dist/reference/sdk-api/ui/scroll-area/ScrollArea.md +159 -0
- package/dist/reference/sdk-api/ui/scroll-area/ScrollBar.md +106 -0
- package/dist/reference/sdk-api/ui/scroll-area/index.md +10 -0
- package/dist/reference/sdk-api/ui/select/Select.md +80 -0
- package/dist/reference/sdk-api/ui/select/SelectContent.md +106 -0
- package/dist/reference/sdk-api/ui/select/SelectGroup.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectItem.md +106 -0
- package/dist/reference/sdk-api/ui/select/SelectLabel.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectScrollDownButton.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectScrollUpButton.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectSeparator.md +100 -0
- package/dist/reference/sdk-api/ui/select/SelectTrigger.md +106 -0
- package/dist/reference/sdk-api/ui/select/SelectValue.md +106 -0
- package/dist/reference/sdk-api/ui/select/index.md +18 -0
- package/dist/reference/sdk-api/ui/separator/Separator.md +106 -0
- package/dist/reference/sdk-api/ui/separator/index.md +9 -0
- package/dist/reference/sdk-api/ui/sheet/Sheet.md +58 -0
- package/dist/reference/sdk-api/ui/sheet/SheetClose.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetContent.md +113 -0
- package/dist/reference/sdk-api/ui/sheet/SheetDescription.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetFooter.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetHeader.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetOverlay.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetPortal.md +55 -0
- package/dist/reference/sdk-api/ui/sheet/SheetTitle.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/SheetTrigger.md +100 -0
- package/dist/reference/sdk-api/ui/sheet/index.md +18 -0
- package/dist/reference/sdk-api/ui/skeleton/Skeleton.md +100 -0
- package/dist/reference/sdk-api/ui/skeleton/index.md +9 -0
- package/dist/reference/sdk-api/ui/slider/Slider.md +116 -0
- package/dist/reference/sdk-api/ui/slider/index.md +9 -0
- package/dist/reference/sdk-api/ui/sonner/Toaster.md +43 -0
- package/dist/reference/sdk-api/ui/sonner/index.md +10 -0
- package/dist/reference/sdk-api/ui/sonner/toast.md +58 -0
- package/dist/reference/sdk-api/ui/spinner/Spinner.md +100 -0
- package/dist/reference/sdk-api/ui/spinner/index.md +9 -0
- package/dist/reference/sdk-api/ui/switch/Switch.md +110 -0
- package/dist/reference/sdk-api/ui/switch/index.md +9 -0
- package/dist/reference/sdk-api/ui/table/Table.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableBody.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableCaption.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableCell.md +106 -0
- package/dist/reference/sdk-api/ui/table/TableFooter.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableHead.md +106 -0
- package/dist/reference/sdk-api/ui/table/TableHeader.md +100 -0
- package/dist/reference/sdk-api/ui/table/TableRow.md +100 -0
- package/dist/reference/sdk-api/ui/table/index.md +16 -0
- package/dist/reference/sdk-api/ui/tabs/Tabs.md +109 -0
- package/dist/reference/sdk-api/ui/tabs/TabsContent.md +106 -0
- package/dist/reference/sdk-api/ui/tabs/TabsList.md +106 -0
- package/dist/reference/sdk-api/ui/tabs/TabsTrigger.md +107 -0
- package/dist/reference/sdk-api/ui/tabs/index.md +13 -0
- package/dist/reference/sdk-api/ui/tabs/tabsListVariants.md +70 -0
- package/dist/reference/sdk-api/ui/textarea/Textarea.md +126 -0
- package/dist/reference/sdk-api/ui/textarea/index.md +9 -0
- package/dist/reference/sdk-api/ui/toggle/Toggle.md +118 -0
- package/dist/reference/sdk-api/ui/toggle/index.md +10 -0
- package/dist/reference/sdk-api/ui/toggle/toggleVariants.md +71 -0
- package/dist/reference/sdk-api/ui/toggle-group/ToggleGroup.md +122 -0
- package/dist/reference/sdk-api/ui/toggle-group/ToggleGroupItem.md +116 -0
- package/dist/reference/sdk-api/ui/toggle-group/index.md +10 -0
- package/dist/reference/sdk-api.json +74470 -146
- package/dist/reference/sdk-api.md +62 -3
- package/dist/ui/accordion.d.ts +48 -0
- package/dist/ui/accordion.js +40 -0
- package/dist/ui/accordion.js.map +1 -1
- package/dist/ui/alert-dialog.d.ts +123 -0
- package/dist/ui/alert-dialog.js +114 -0
- package/dist/ui/alert-dialog.js.map +1 -1
- package/dist/ui/alert.d.ts +41 -0
- package/dist/ui/alert.js +41 -0
- package/dist/ui/alert.js.map +1 -1
- package/dist/ui/aspect-ratio.d.ts +11 -0
- package/dist/ui/aspect-ratio.js +10 -0
- package/dist/ui/aspect-ratio.js.map +1 -1
- package/dist/ui/avatar.d.ts +65 -0
- package/dist/ui/avatar.js +63 -0
- package/dist/ui/avatar.js.map +1 -1
- package/dist/ui/badge.d.ts +22 -0
- package/dist/ui/badge.js +22 -0
- package/dist/ui/badge.js.map +1 -1
- package/dist/ui/button-group.d.ts +45 -0
- package/dist/ui/button-group.js +43 -0
- package/dist/ui/button-group.js.map +1 -1
- package/dist/ui/button.d.ts +52 -0
- package/dist/ui/button.js +30 -0
- package/dist/ui/button.js.map +1 -1
- package/dist/ui/calendar.d.ts +44 -0
- package/dist/ui/calendar.js +19 -0
- package/dist/ui/calendar.js.map +1 -1
- package/dist/ui/card.d.ts +71 -0
- package/dist/ui/card.js +70 -0
- package/dist/ui/card.js.map +1 -1
- package/dist/ui/carousel.d.ts +71 -0
- package/dist/ui/carousel.js +66 -0
- package/dist/ui/carousel.js.map +1 -1
- package/dist/ui/checkbox.d.ts +14 -0
- package/dist/ui/checkbox.js +10 -0
- package/dist/ui/checkbox.js.map +1 -1
- package/dist/ui/collapsible.d.ts +37 -0
- package/dist/ui/collapsible.js +30 -0
- package/dist/ui/collapsible.js.map +1 -1
- package/dist/ui/combobox.d.ts +190 -0
- package/dist/ui/combobox.js +167 -0
- package/dist/ui/combobox.js.map +1 -1
- package/dist/ui/dialog.d.ts +109 -0
- package/dist/ui/dialog.js +100 -0
- package/dist/ui/dialog.js.map +1 -1
- package/dist/ui/drawer.d.ts +106 -0
- package/dist/ui/drawer.js +100 -0
- package/dist/ui/drawer.js.map +1 -1
- package/dist/ui/dropdown-menu.d.ts +171 -0
- package/dist/ui/dropdown-menu.js +150 -0
- package/dist/ui/dropdown-menu.js.map +1 -1
- package/dist/ui/empty.d.ts +61 -0
- package/dist/ui/empty.js +61 -0
- package/dist/ui/empty.js.map +1 -1
- package/dist/ui/field.d.ts +105 -0
- package/dist/ui/field.js +101 -0
- package/dist/ui/field.js.map +1 -1
- package/dist/ui/helpers.d.ts +11 -0
- package/dist/ui/helpers.js +11 -0
- package/dist/ui/helpers.js.map +1 -1
- package/dist/ui/input-group.d.ts +65 -0
- package/dist/ui/input-group.js +65 -0
- package/dist/ui/input-group.js.map +1 -1
- package/dist/ui/input-otp.d.ts +48 -0
- package/dist/ui/input-otp.js +40 -0
- package/dist/ui/input-otp.js.map +1 -1
- package/dist/ui/input.d.ts +24 -2
- package/dist/ui/input.js +20 -0
- package/dist/ui/input.js.map +1 -1
- package/dist/ui/item.d.ts +103 -0
- package/dist/ui/item.js +103 -0
- package/dist/ui/item.js.map +1 -1
- package/dist/ui/label.d.ts +10 -0
- package/dist/ui/label.js +10 -0
- package/dist/ui/label.js.map +1 -1
- package/dist/ui/menubar.d.ts +193 -0
- package/dist/ui/menubar.js +160 -0
- package/dist/ui/menubar.js.map +1 -1
- package/dist/ui/navigation-menu.d.ts +98 -0
- package/dist/ui/navigation-menu.js +90 -0
- package/dist/ui/navigation-menu.js.map +1 -1
- package/dist/ui/pagination.d.ts +76 -0
- package/dist/ui/pagination.js +73 -0
- package/dist/ui/pagination.js.map +1 -1
- package/dist/ui/popover.d.ts +81 -0
- package/dist/ui/popover.js +70 -0
- package/dist/ui/popover.js.map +1 -1
- package/dist/ui/portal.d.ts +11 -0
- package/dist/ui/portal.js +10 -0
- package/dist/ui/portal.js.map +1 -1
- package/dist/ui/progress.d.ts +53 -26
- package/dist/ui/progress.js +50 -26
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/radio-group.d.ts +25 -0
- package/dist/ui/radio-group.js +20 -0
- package/dist/ui/radio-group.js.map +1 -1
- package/dist/ui/resizable.d.ts +37 -0
- package/dist/ui/resizable.js +30 -0
- package/dist/ui/resizable.js.map +1 -1
- package/dist/ui/scroll-area.d.ts +22 -0
- package/dist/ui/scroll-area.js +21 -0
- package/dist/ui/scroll-area.js.map +1 -1
- package/dist/ui/select.d.ts +122 -0
- package/dist/ui/select.js +108 -0
- package/dist/ui/select.js.map +1 -1
- package/dist/ui/separator.d.ts +11 -0
- package/dist/ui/separator.js +10 -0
- package/dist/ui/separator.js.map +1 -1
- package/dist/ui/sheet.d.ts +107 -0
- package/dist/ui/sheet.js +101 -0
- package/dist/ui/sheet.js.map +1 -1
- package/dist/ui/skeleton.d.ts +10 -0
- package/dist/ui/skeleton.js +10 -0
- package/dist/ui/skeleton.js.map +1 -1
- package/dist/ui/slider.d.ts +21 -0
- package/dist/ui/slider.js +14 -0
- package/dist/ui/slider.js.map +1 -1
- package/dist/ui/sonner.d.ts +23 -0
- package/dist/ui/sonner.js +21 -0
- package/dist/ui/sonner.js.map +1 -1
- package/dist/ui/spinner.d.ts +10 -0
- package/dist/ui/spinner.js +10 -0
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/switch.d.ts +15 -0
- package/dist/ui/switch.js +10 -0
- package/dist/ui/switch.js.map +1 -1
- package/dist/ui/table.d.ts +81 -0
- package/dist/ui/table.js +80 -0
- package/dist/ui/table.js.map +1 -1
- package/dist/ui/tabs.d.ts +59 -0
- package/dist/ui/tabs.js +51 -0
- package/dist/ui/tabs.js.map +1 -1
- package/dist/ui/textarea.d.ts +13 -0
- package/dist/ui/textarea.js +13 -0
- package/dist/ui/textarea.js.map +1 -1
- package/dist/ui/toggle-group.d.ts +34 -0
- package/dist/ui/toggle-group.js +24 -0
- package/dist/ui/toggle-group.js.map +1 -1
- package/dist/ui/toggle.d.ts +28 -0
- package/dist/ui/toggle.js +24 -0
- package/dist/ui/toggle.js.map +1 -1
- package/package.json +4 -2
- package/release-provenance.json +15 -0
- package/src/adapters/interest-card/eslint/eslint-plugin-custom-navigation.mjs +2 -0
- package/src/adapters/interest-card/eslint/taro.mjs +21 -0
- package/src/adapters/interest-card/runtime/microapp.ts +11 -0
- package/src/adapters/interest-card/types/taro.d.ts +28 -0
- package/src/build/config-overrides.ts +39 -0
- package/src/build/index.ts +5 -0
- package/src/build/plugins/app-config.ts +47 -0
- package/src/build/plugins/depend-card/analyze.ts +122 -0
- package/src/build/plugins/depend-card/source.ts +97 -0
- package/src/build/plugins/vite-depend-card.ts +168 -0
- package/src/build/plugins/vite-image-asset-import.ts +178 -0
- package/src/build/plugins/vite-inline-json.ts +149 -0
- package/src/build/plugins/vite-taro-source-location.ts +224 -0
- package/src/build/plugins/vite-tt-components-entry.ts +33 -0
- package/src/build/taro.ts +830 -0
- package/src/components/miniapp-open-card.ts +94 -0
- package/src/components/native-miniapp-open-card.ts +7 -0
- package/src/eslint/eslint-plugin-custom-navigation.mjs +290 -0
- package/src/eslint/eslint-plugin-microapp-pages.mjs +659 -0
- package/src/eslint/server.mjs +69 -0
- package/src/eslint/taro.mjs +587 -0
- package/src/index.ts +2 -0
- package/src/internal/runtime/douyin-open-button.d.ts +29 -0
- package/src/internal/runtime/iframe-auth/identity.ts +236 -0
- package/src/internal/runtime/iframe-auth/index.ts +2 -0
- package/src/internal/runtime/iframe-auth/sync.ts +37 -0
- package/src/internal/vendor-modules.d.ts +8 -0
- package/src/lib/measure.ts +115 -0
- package/src/lib/platform.ts +11 -0
- package/src/lib/utils.ts +6 -0
- package/src/runtime/client.ts +246 -0
- package/src/runtime/default-client.ts +26 -0
- package/src/runtime/default-iframe-auth.ts +13 -0
- package/src/runtime/douyin-container-request.ts +367 -0
- package/src/runtime/douyin-login-request.ts +514 -0
- package/src/runtime/globals.d.ts +342 -0
- package/src/runtime/index.ts +4 -0
- package/src/runtime/network-url.ts +63 -0
- package/src/ui/accordion.tsx +226 -0
- package/src/ui/alert-dialog.tsx +407 -0
- package/src/ui/alert.tsx +149 -0
- package/src/ui/aspect-ratio.tsx +37 -0
- package/src/ui/avatar.tsx +238 -0
- package/src/ui/badge.tsx +77 -0
- package/src/ui/button-group.tsx +173 -0
- package/src/ui/button.tsx +215 -0
- package/src/ui/calendar.tsx +353 -0
- package/src/ui/card.tsx +217 -0
- package/src/ui/carousel.tsx +259 -0
- package/src/ui/checkbox.tsx +62 -0
- package/src/ui/collapsible.tsx +148 -0
- package/src/ui/combobox.tsx +650 -0
- package/src/ui/dialog.tsx +290 -0
- package/src/ui/drawer.tsx +272 -0
- package/src/ui/dropdown-menu.tsx +547 -0
- package/src/ui/empty.tsx +166 -0
- package/src/ui/field.tsx +427 -0
- package/src/ui/helpers.tsx +39 -0
- package/src/ui/index.ts +47 -0
- package/src/ui/input-group.tsx +320 -0
- package/src/ui/input-otp.tsx +189 -0
- package/src/ui/input.tsx +60 -0
- package/src/ui/item.tsx +338 -0
- package/src/ui/label.tsx +31 -0
- package/src/ui/menubar.tsx +835 -0
- package/src/ui/navigation-menu.tsx +341 -0
- package/src/ui/pagination.tsx +195 -0
- package/src/ui/popover.tsx +363 -0
- package/src/ui/portal.tsx +31 -0
- package/src/ui/progress.tsx +182 -0
- package/src/ui/radio-group.tsx +111 -0
- package/src/ui/resizable.tsx +410 -0
- package/src/ui/scroll-area.tsx +102 -0
- package/src/ui/select.tsx +471 -0
- package/src/ui/separator.tsx +37 -0
- package/src/ui/sheet.tsx +289 -0
- package/src/ui/skeleton.tsx +25 -0
- package/src/ui/slider.tsx +176 -0
- package/src/ui/sonner.tsx +40 -0
- package/src/ui/spinner.tsx +23 -0
- package/src/ui/switch.tsx +94 -0
- package/src/ui/table.tsx +240 -0
- package/src/ui/tabs.tsx +233 -0
- package/src/ui/tailwind.css +2 -0
- package/src/ui/textarea.tsx +49 -0
- package/src/ui/theme.css +234 -0
- package/src/ui/toggle-group.tsx +215 -0
- package/src/ui/toggle.tsx +113 -0
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { View, type ViewProps } from "@tarojs/components"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils"
|
|
5
|
+
import { X } from "@open-dy/lucide-taro"
|
|
6
|
+
|
|
7
|
+
const DialogContext = React.createContext<{
|
|
8
|
+
open: boolean
|
|
9
|
+
onOpenChange: (open: boolean) => void
|
|
10
|
+
}>({ open: false, onOpenChange: () => {} })
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @desc 对话框组件。
|
|
14
|
+
* @param {Parameters<typeof Dialog>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
15
|
+
* @return {ReturnType<typeof Dialog>} 组件渲染结果;类型见返回值契约。
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { Dialog } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
19
|
+
* <Dialog />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function Dialog({
|
|
23
|
+
open: openProp,
|
|
24
|
+
defaultOpen,
|
|
25
|
+
onOpenChange,
|
|
26
|
+
children,
|
|
27
|
+
}: {
|
|
28
|
+
/** @desc 受控展开状态;传入后以该值为准,需在 onOpenChange 中更新。省略时由组件内部管理。 */
|
|
29
|
+
open?: boolean
|
|
30
|
+
/** @desc 非受控模式的初始展开状态,默认 false;仅初始化时读取,传入 open 后不生效。 */
|
|
31
|
+
defaultOpen?: boolean
|
|
32
|
+
/** @desc 触发器或关闭操作请求改变展开状态时调用,参数为下一状态;受控模式需由调用方同步 open。 */
|
|
33
|
+
onOpenChange?: (open: boolean) => void
|
|
34
|
+
/** @desc 同一实例的触发器、内容区等组合子组件;省略时不显示内容,子组件通过上下文共享状态。 */
|
|
35
|
+
children?: React.ReactNode
|
|
36
|
+
}) {
|
|
37
|
+
const [internal, setInternal] = React.useState(defaultOpen ?? false)
|
|
38
|
+
const controlled = openProp !== undefined
|
|
39
|
+
const open = controlled ? openProp : internal
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<DialogContext.Provider
|
|
43
|
+
value={{
|
|
44
|
+
open,
|
|
45
|
+
onOpenChange: (v) => {
|
|
46
|
+
if (!controlled) setInternal(v)
|
|
47
|
+
onOpenChange?.(v)
|
|
48
|
+
},
|
|
49
|
+
}}
|
|
50
|
+
>
|
|
51
|
+
{children}
|
|
52
|
+
</DialogContext.Provider>
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @desc 对话框触发器。
|
|
58
|
+
* @param {Parameters<typeof DialogTrigger>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
59
|
+
* @return {ReturnType<typeof DialogTrigger>} 组件渲染结果;类型见返回值契约。
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* import { Dialog, DialogTrigger } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
63
|
+
* <Dialog><DialogTrigger /></Dialog>
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
function DialogTrigger({
|
|
67
|
+
children,
|
|
68
|
+
render,
|
|
69
|
+
...props
|
|
70
|
+
}: Omit<ViewProps, "children"> & {
|
|
71
|
+
/** @desc 默认触发器内容;render 非空时由 render 内容替代。 */
|
|
72
|
+
children?: React.ReactNode
|
|
73
|
+
/** @desc 触发器内要显示的 React 节点,优先于 children;仍由外层 View 处理打开操作,不是渲染函数。 */
|
|
74
|
+
render?: React.ReactNode
|
|
75
|
+
}) {
|
|
76
|
+
const { onOpenChange } = React.useContext(DialogContext)
|
|
77
|
+
return (
|
|
78
|
+
<View data-slot="dialog-trigger" onClick={() => onOpenChange(true)} {...props}>
|
|
79
|
+
{render ?? children}
|
|
80
|
+
</View>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @desc 对话框关闭按钮。
|
|
86
|
+
* @param {Parameters<typeof DialogClose>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
87
|
+
* @return {ReturnType<typeof DialogClose>} 组件渲染结果;类型见返回值契约。
|
|
88
|
+
* @example
|
|
89
|
+
* ```tsx
|
|
90
|
+
* import { Dialog, DialogClose } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
91
|
+
* <Dialog><DialogClose /></Dialog>
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
function DialogClose({ children, ...props }: ViewProps) {
|
|
95
|
+
const { onOpenChange } = React.useContext(DialogContext)
|
|
96
|
+
return (
|
|
97
|
+
<View data-slot="dialog-close" onClick={() => onOpenChange(false)} {...props}>
|
|
98
|
+
{children}
|
|
99
|
+
</View>
|
|
100
|
+
)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @desc 对话框跨层级渲染入口。
|
|
105
|
+
* @param {Parameters<typeof DialogPortal>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
106
|
+
* @return {ReturnType<typeof DialogPortal>} 组件渲染结果;类型见返回值契约。
|
|
107
|
+
* @example
|
|
108
|
+
* ```tsx
|
|
109
|
+
* import { Dialog, DialogPortal } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
110
|
+
* <Dialog><DialogPortal /></Dialog>
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
function DialogPortal({ children }: {
|
|
114
|
+
/** @desc 要渲染的子节点;该兼容包装只返回 Fragment,不额外创建原生容器或执行挂载迁移。 */
|
|
115
|
+
children?: React.ReactNode }) {
|
|
116
|
+
return <>{children}</>
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @desc 对话框遮罩。
|
|
121
|
+
* @param {Parameters<typeof DialogOverlay>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
122
|
+
* @return {ReturnType<typeof DialogOverlay>} 组件渲染结果;类型见返回值契约。
|
|
123
|
+
* @example
|
|
124
|
+
* ```tsx
|
|
125
|
+
* import { Dialog, DialogOverlay } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
126
|
+
* <Dialog><DialogOverlay /></Dialog>
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
function DialogOverlay({ className, ...props }: ViewProps) {
|
|
130
|
+
return (
|
|
131
|
+
<View
|
|
132
|
+
data-slot="dialog-overlay"
|
|
133
|
+
className={cn(
|
|
134
|
+
"fixed inset-0 z-50 bg-black/50",
|
|
135
|
+
className
|
|
136
|
+
)}
|
|
137
|
+
{...props}
|
|
138
|
+
/>
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* @desc 对话框内容容器。
|
|
144
|
+
* @param {Parameters<typeof DialogContent>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
145
|
+
* @return {ReturnType<typeof DialogContent>} 组件渲染结果;类型见返回值契约。
|
|
146
|
+
* @example
|
|
147
|
+
* ```tsx
|
|
148
|
+
* import { Dialog, DialogContent } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
149
|
+
* <Dialog><DialogContent /></Dialog>
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
function DialogContent({
|
|
153
|
+
className,
|
|
154
|
+
children,
|
|
155
|
+
showClose = true,
|
|
156
|
+
showCloseButton,
|
|
157
|
+
...props
|
|
158
|
+
}: ViewProps & {
|
|
159
|
+
/** @desc 是否显示内置关闭按钮,默认 true;showCloseButton 有值时以其为准。 */
|
|
160
|
+
showClose?: boolean;
|
|
161
|
+
/** @desc 内置关闭按钮开关,优先于 showClose;两者都省略时显示。不会关闭遮罩点击行为。 */
|
|
162
|
+
showCloseButton?: boolean }) {
|
|
163
|
+
const ctx = React.useContext(DialogContext)
|
|
164
|
+
const shouldShowClose = showCloseButton ?? showClose
|
|
165
|
+
if (!ctx.open) return null
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<View className="fixed inset-0 z-50 flex items-center justify-center">
|
|
169
|
+
<DialogOverlay onClick={() => ctx.onOpenChange(false)} />
|
|
170
|
+
<View
|
|
171
|
+
data-slot="dialog-content"
|
|
172
|
+
className={cn(
|
|
173
|
+
"relative z-50 grid w-full max-w-lg gap-4 rounded-xl border bg-background p-4 shadow-lg sm:max-w-md",
|
|
174
|
+
className
|
|
175
|
+
)}
|
|
176
|
+
{...props}
|
|
177
|
+
>
|
|
178
|
+
{children}
|
|
179
|
+
{shouldShowClose ? <View
|
|
180
|
+
className="absolute top-3 right-3 flex size-5 items-center justify-center rounded-sm opacity-70"
|
|
181
|
+
onClick={() => ctx.onOpenChange(false)}
|
|
182
|
+
>
|
|
183
|
+
<X className="size-4" />
|
|
184
|
+
</View> : null}
|
|
185
|
+
</View>
|
|
186
|
+
</View>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* @desc 对话框头部布局。
|
|
192
|
+
* @param {Parameters<typeof DialogHeader>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
193
|
+
* @return {ReturnType<typeof DialogHeader>} 组件渲染结果;类型见返回值契约。
|
|
194
|
+
* @example
|
|
195
|
+
* ```tsx
|
|
196
|
+
* import { Dialog, DialogHeader } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
197
|
+
* <Dialog><DialogHeader /></Dialog>
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
function DialogHeader({ className, ...props }: ViewProps) {
|
|
201
|
+
return (
|
|
202
|
+
<View
|
|
203
|
+
data-slot="dialog-header"
|
|
204
|
+
className={cn(
|
|
205
|
+
"flex flex-col gap-2 text-center sm:text-left",
|
|
206
|
+
className
|
|
207
|
+
)}
|
|
208
|
+
{...props}
|
|
209
|
+
/>
|
|
210
|
+
)
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* @desc 对话框底部布局。
|
|
215
|
+
* @param {Parameters<typeof DialogFooter>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
216
|
+
* @return {ReturnType<typeof DialogFooter>} 组件渲染结果;类型见返回值契约。
|
|
217
|
+
* @example
|
|
218
|
+
* ```tsx
|
|
219
|
+
* import { Dialog, DialogFooter } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
220
|
+
* <Dialog><DialogFooter /></Dialog>
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
function DialogFooter({ className, ...props }: ViewProps) {
|
|
224
|
+
return (
|
|
225
|
+
<View
|
|
226
|
+
data-slot="dialog-footer"
|
|
227
|
+
className={cn(
|
|
228
|
+
"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
|
|
229
|
+
className
|
|
230
|
+
)}
|
|
231
|
+
{...props}
|
|
232
|
+
/>
|
|
233
|
+
)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* @desc 对话框标题。
|
|
238
|
+
* @param {Parameters<typeof DialogTitle>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
239
|
+
* @return {ReturnType<typeof DialogTitle>} 组件渲染结果;类型见返回值契约。
|
|
240
|
+
* @example
|
|
241
|
+
* ```tsx
|
|
242
|
+
* import { Dialog, DialogTitle } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
243
|
+
* <Dialog><DialogTitle /></Dialog>
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
function DialogTitle({ className, ...props }: ViewProps) {
|
|
247
|
+
return (
|
|
248
|
+
<View
|
|
249
|
+
data-slot="dialog-title"
|
|
250
|
+
className={cn("text-lg leading-none font-semibold", className)}
|
|
251
|
+
{...props}
|
|
252
|
+
/>
|
|
253
|
+
)
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* @desc 对话框说明文本。
|
|
258
|
+
* @param {Parameters<typeof DialogDescription>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
259
|
+
* @return {ReturnType<typeof DialogDescription>} 组件渲染结果;类型见返回值契约。
|
|
260
|
+
* @example
|
|
261
|
+
* ```tsx
|
|
262
|
+
* import { Dialog, DialogDescription } from '@open-dy/vibecoding-sdk-taro/ui/dialog'
|
|
263
|
+
* <Dialog><DialogDescription /></Dialog>
|
|
264
|
+
* ```
|
|
265
|
+
*/
|
|
266
|
+
function DialogDescription({
|
|
267
|
+
className,
|
|
268
|
+
...props
|
|
269
|
+
}: ViewProps) {
|
|
270
|
+
return (
|
|
271
|
+
<View
|
|
272
|
+
data-slot="dialog-description"
|
|
273
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
274
|
+
{...props}
|
|
275
|
+
/>
|
|
276
|
+
)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
export {
|
|
280
|
+
Dialog,
|
|
281
|
+
DialogClose,
|
|
282
|
+
DialogContent,
|
|
283
|
+
DialogDescription,
|
|
284
|
+
DialogFooter,
|
|
285
|
+
DialogHeader,
|
|
286
|
+
DialogOverlay,
|
|
287
|
+
DialogPortal,
|
|
288
|
+
DialogTitle,
|
|
289
|
+
DialogTrigger,
|
|
290
|
+
}
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { View, type ViewProps } from "@tarojs/components"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils"
|
|
5
|
+
|
|
6
|
+
const DrawerContext = React.createContext<{
|
|
7
|
+
open: boolean
|
|
8
|
+
onOpenChange: (open: boolean) => void
|
|
9
|
+
direction?: "bottom" | "top" | "left" | "right"
|
|
10
|
+
}>({ open: false, onOpenChange: () => {}, direction: "bottom" })
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @desc 抽屉组件。
|
|
14
|
+
* @param {Parameters<typeof Drawer>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
15
|
+
* @return {ReturnType<typeof Drawer>} 组件渲染结果;类型见返回值契约。
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { Drawer } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
19
|
+
* <Drawer />
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function Drawer({
|
|
23
|
+
open: openProp,
|
|
24
|
+
defaultOpen,
|
|
25
|
+
onOpenChange,
|
|
26
|
+
direction = "bottom",
|
|
27
|
+
children,
|
|
28
|
+
}: {
|
|
29
|
+
/** @desc 受控展开状态;传入后以该值为准,需在 onOpenChange 中更新。省略时由组件内部管理。 */
|
|
30
|
+
open?: boolean
|
|
31
|
+
/** @desc 非受控模式的初始展开状态,默认 false;仅初始化时读取,传入 open 后不生效。 */
|
|
32
|
+
defaultOpen?: boolean
|
|
33
|
+
/** @desc 触发器或关闭操作请求改变展开状态时调用,参数为下一状态;受控模式需由调用方同步 open。 */
|
|
34
|
+
onOpenChange?: (open: boolean) => void
|
|
35
|
+
/** @desc 抽屉出现的位置:bottom 底部、top 顶部、left 左侧、right 右侧,默认 bottom;同时决定宽高、边框及圆角。 */
|
|
36
|
+
direction?: "bottom" | "top" | "left" | "right"
|
|
37
|
+
/** @desc 同一实例的触发器、内容区等组合子组件;省略时不显示内容,子组件通过上下文共享状态。 */
|
|
38
|
+
children?: React.ReactNode
|
|
39
|
+
}) {
|
|
40
|
+
const [internal, setInternal] = React.useState(defaultOpen ?? false)
|
|
41
|
+
const controlled = openProp !== undefined
|
|
42
|
+
const open = controlled ? openProp : internal
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<DrawerContext.Provider
|
|
46
|
+
value={{
|
|
47
|
+
open,
|
|
48
|
+
onOpenChange: (v) => {
|
|
49
|
+
if (!controlled) setInternal(v)
|
|
50
|
+
onOpenChange?.(v)
|
|
51
|
+
},
|
|
52
|
+
direction,
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
{children}
|
|
56
|
+
</DrawerContext.Provider>
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @desc 抽屉触发器。
|
|
62
|
+
* @param {Parameters<typeof DrawerTrigger>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
63
|
+
* @return {ReturnType<typeof DrawerTrigger>} 组件渲染结果;类型见返回值契约。
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* import { Drawer, DrawerTrigger } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
67
|
+
* <Drawer><DrawerTrigger /></Drawer>
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
function DrawerTrigger({ children, ...props }: ViewProps) {
|
|
71
|
+
const { onOpenChange } = React.useContext(DrawerContext)
|
|
72
|
+
return (
|
|
73
|
+
<View data-slot="drawer-trigger" onClick={() => onOpenChange(true)} {...props}>
|
|
74
|
+
{children}
|
|
75
|
+
</View>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @desc 抽屉跨层级渲染入口。
|
|
81
|
+
* @param {Parameters<typeof DrawerPortal>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
82
|
+
* @return {ReturnType<typeof DrawerPortal>} 组件渲染结果;类型见返回值契约。
|
|
83
|
+
* @example
|
|
84
|
+
* ```tsx
|
|
85
|
+
* import { Drawer, DrawerPortal } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
86
|
+
* <Drawer><DrawerPortal /></Drawer>
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
function DrawerPortal({ children }: {
|
|
90
|
+
/** @desc 要渲染的子节点;该兼容包装只返回 Fragment,不额外创建原生容器或执行挂载迁移。 */
|
|
91
|
+
children?: React.ReactNode }) {
|
|
92
|
+
return <>{children}</>
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @desc 抽屉关闭按钮。
|
|
97
|
+
* @param {Parameters<typeof DrawerClose>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
98
|
+
* @return {ReturnType<typeof DrawerClose>} 组件渲染结果;类型见返回值契约。
|
|
99
|
+
* @example
|
|
100
|
+
* ```tsx
|
|
101
|
+
* import { Drawer, DrawerClose } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
102
|
+
* <Drawer><DrawerClose /></Drawer>
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
function DrawerClose({ children, ...props }: ViewProps) {
|
|
106
|
+
const { onOpenChange } = React.useContext(DrawerContext)
|
|
107
|
+
return (
|
|
108
|
+
<View data-slot="drawer-close" onClick={() => onOpenChange(false)} {...props}>
|
|
109
|
+
{children}
|
|
110
|
+
</View>
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* @desc 抽屉遮罩。
|
|
116
|
+
* @param {Parameters<typeof DrawerOverlay>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
117
|
+
* @return {ReturnType<typeof DrawerOverlay>} 组件渲染结果;类型见返回值契约。
|
|
118
|
+
* @example
|
|
119
|
+
* ```tsx
|
|
120
|
+
* import { Drawer, DrawerOverlay } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
121
|
+
* <Drawer><DrawerOverlay /></Drawer>
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
function DrawerOverlay({ className, ...props }: ViewProps) {
|
|
125
|
+
return (
|
|
126
|
+
<View
|
|
127
|
+
data-slot="drawer-overlay"
|
|
128
|
+
className={cn("fixed inset-0 z-50 bg-black/50", className)}
|
|
129
|
+
{...props}
|
|
130
|
+
/>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @desc 抽屉内容容器。
|
|
136
|
+
* @param {Parameters<typeof DrawerContent>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
137
|
+
* @return {ReturnType<typeof DrawerContent>} 组件渲染结果;类型见返回值契约。
|
|
138
|
+
* @example
|
|
139
|
+
* ```tsx
|
|
140
|
+
* import { Drawer, DrawerContent } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
141
|
+
* <Drawer><DrawerContent /></Drawer>
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
function DrawerContent({
|
|
145
|
+
className,
|
|
146
|
+
children,
|
|
147
|
+
...props
|
|
148
|
+
}: ViewProps) {
|
|
149
|
+
const { open, onOpenChange, direction } = React.useContext(DrawerContext)
|
|
150
|
+
if (!open) return null
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<View className="fixed inset-0 z-50">
|
|
154
|
+
<DrawerOverlay onClick={() => onOpenChange(false)} />
|
|
155
|
+
<View
|
|
156
|
+
data-slot="drawer-content"
|
|
157
|
+
data-direction={direction}
|
|
158
|
+
className={cn(
|
|
159
|
+
"group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground",
|
|
160
|
+
direction === "bottom" &&
|
|
161
|
+
"inset-x-0 bottom-0 mt-24 max-h-[80vh] rounded-t-xl border-t",
|
|
162
|
+
direction === "top" &&
|
|
163
|
+
"inset-x-0 top-0 mb-24 max-h-[80vh] rounded-b-xl border-b",
|
|
164
|
+
direction === "left" &&
|
|
165
|
+
"inset-y-0 left-0 w-3/4 rounded-r-xl border-r sm:max-w-sm",
|
|
166
|
+
direction === "right" &&
|
|
167
|
+
"inset-y-0 right-0 w-3/4 rounded-l-xl border-l sm:max-w-sm",
|
|
168
|
+
className
|
|
169
|
+
)}
|
|
170
|
+
{...props}
|
|
171
|
+
>
|
|
172
|
+
{direction === "bottom" && (
|
|
173
|
+
<View className="mx-auto mt-4 h-1 w-[100px] shrink-0 rounded-full bg-muted" />
|
|
174
|
+
)}
|
|
175
|
+
{children}
|
|
176
|
+
</View>
|
|
177
|
+
</View>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @desc 抽屉头部布局。
|
|
183
|
+
* @param {Parameters<typeof DrawerHeader>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
184
|
+
* @return {ReturnType<typeof DrawerHeader>} 组件渲染结果;类型见返回值契约。
|
|
185
|
+
* @example
|
|
186
|
+
* ```tsx
|
|
187
|
+
* import { Drawer, DrawerHeader } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
188
|
+
* <Drawer><DrawerHeader /></Drawer>
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
function DrawerHeader({ className, ...props }: ViewProps) {
|
|
192
|
+
return (
|
|
193
|
+
<View
|
|
194
|
+
data-slot="drawer-header"
|
|
195
|
+
className={cn("flex flex-col gap-0.5 p-4 text-center md:text-left", className)}
|
|
196
|
+
{...props}
|
|
197
|
+
/>
|
|
198
|
+
)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* @desc 抽屉底部布局。
|
|
203
|
+
* @param {Parameters<typeof DrawerFooter>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
204
|
+
* @return {ReturnType<typeof DrawerFooter>} 组件渲染结果;类型见返回值契约。
|
|
205
|
+
* @example
|
|
206
|
+
* ```tsx
|
|
207
|
+
* import { Drawer, DrawerFooter } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
208
|
+
* <Drawer><DrawerFooter /></Drawer>
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
function DrawerFooter({ className, ...props }: ViewProps) {
|
|
212
|
+
return (
|
|
213
|
+
<View
|
|
214
|
+
data-slot="drawer-footer"
|
|
215
|
+
className={cn("mt-auto flex flex-col gap-2 p-4", className)}
|
|
216
|
+
{...props}
|
|
217
|
+
/>
|
|
218
|
+
)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* @desc 抽屉标题。
|
|
223
|
+
* @param {Parameters<typeof DrawerTitle>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
224
|
+
* @return {ReturnType<typeof DrawerTitle>} 组件渲染结果;类型见返回值契约。
|
|
225
|
+
* @example
|
|
226
|
+
* ```tsx
|
|
227
|
+
* import { Drawer, DrawerTitle } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
228
|
+
* <Drawer><DrawerTitle /></Drawer>
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
function DrawerTitle({ className, ...props }: ViewProps) {
|
|
232
|
+
return (
|
|
233
|
+
<View
|
|
234
|
+
data-slot="drawer-title"
|
|
235
|
+
className={cn("font-heading text-base font-medium text-foreground", className)}
|
|
236
|
+
{...props}
|
|
237
|
+
/>
|
|
238
|
+
)
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @desc 抽屉说明文本。
|
|
243
|
+
* @param {Parameters<typeof DrawerDescription>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
244
|
+
* @return {ReturnType<typeof DrawerDescription>} 组件渲染结果;类型见返回值契约。
|
|
245
|
+
* @example
|
|
246
|
+
* ```tsx
|
|
247
|
+
* import { Drawer, DrawerDescription } from '@open-dy/vibecoding-sdk-taro/ui/drawer'
|
|
248
|
+
* <Drawer><DrawerDescription /></Drawer>
|
|
249
|
+
* ```
|
|
250
|
+
*/
|
|
251
|
+
function DrawerDescription({ className, ...props }: ViewProps) {
|
|
252
|
+
return (
|
|
253
|
+
<View
|
|
254
|
+
data-slot="drawer-description"
|
|
255
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
256
|
+
{...props}
|
|
257
|
+
/>
|
|
258
|
+
)
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export {
|
|
262
|
+
Drawer,
|
|
263
|
+
DrawerPortal,
|
|
264
|
+
DrawerOverlay,
|
|
265
|
+
DrawerTrigger,
|
|
266
|
+
DrawerClose,
|
|
267
|
+
DrawerContent,
|
|
268
|
+
DrawerHeader,
|
|
269
|
+
DrawerFooter,
|
|
270
|
+
DrawerTitle,
|
|
271
|
+
DrawerDescription,
|
|
272
|
+
}
|