@open-dy/vibecoding-sdk-taro 0.0.1-beta.5 → 0.0.1-beta.6
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 +11 -0
- 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 +564 -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,407 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { View, type ViewProps } from "@tarojs/components"
|
|
3
|
+
import { type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../lib/utils"
|
|
6
|
+
import { Button, buttonVariants } from "./button"
|
|
7
|
+
|
|
8
|
+
const AlertDialogContext = React.createContext<{
|
|
9
|
+
open: boolean
|
|
10
|
+
onOpenChange: (open: boolean) => void
|
|
11
|
+
}>({ open: false, onOpenChange: () => {} })
|
|
12
|
+
|
|
13
|
+
const AlertDialogContentContext = React.createContext<{
|
|
14
|
+
size: "default" | "sm"
|
|
15
|
+
hasMedia: boolean
|
|
16
|
+
}>({
|
|
17
|
+
size: "default",
|
|
18
|
+
hasMedia: false,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
type AlertDialogTriggerRenderProps = Omit<ViewProps, "children"> & {
|
|
22
|
+
/** @desc 组件自动注入的触发器标识;自定义 render 应转发到触发节点,不手动修改。 */
|
|
23
|
+
"data-slot": "alert-dialog-trigger"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type AlertDialogTriggerClickEvent = Parameters<
|
|
27
|
+
NonNullable<ViewProps["onClick"]>
|
|
28
|
+
>[0]
|
|
29
|
+
|
|
30
|
+
type AlertDialogTriggerProps = Omit<ViewProps, "children"> & {
|
|
31
|
+
/** @desc 默认触发器内的内容;设置 render 时由自定义渲染结果取代。 */
|
|
32
|
+
children?: React.ReactNode
|
|
33
|
+
/** @desc 自定义触发器元素或渲染函数;省略时使用 View。元素会被克隆并合并点击处理;函数收到状态和事件 props,必须传给实际可点击节点。 */
|
|
34
|
+
render?:
|
|
35
|
+
| React.ReactElement
|
|
36
|
+
| ((props: AlertDialogTriggerRenderProps) => React.ReactNode)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
type AlertDialogActionProps = ViewProps & VariantProps<typeof buttonVariants>
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @desc 确认对话框组件。
|
|
43
|
+
* @param {Parameters<typeof AlertDialog>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
44
|
+
* @return {ReturnType<typeof AlertDialog>} 组件渲染结果;类型见返回值契约。
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* import { AlertDialog } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
48
|
+
* <AlertDialog />
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
function AlertDialog({
|
|
52
|
+
open: openProp,
|
|
53
|
+
defaultOpen,
|
|
54
|
+
onOpenChange,
|
|
55
|
+
children,
|
|
56
|
+
}: {
|
|
57
|
+
/** @desc 受控展开状态;传入后以该值为准,需在 onOpenChange 中更新。省略时由组件内部管理。 */
|
|
58
|
+
open?: boolean
|
|
59
|
+
/** @desc 非受控模式的初始展开状态,默认 false;仅初始化时读取,传入 open 后不生效。 */
|
|
60
|
+
defaultOpen?: boolean
|
|
61
|
+
/** @desc 触发器或关闭操作请求改变展开状态时调用,参数为下一状态;受控模式需由调用方同步 open。 */
|
|
62
|
+
onOpenChange?: (open: boolean) => void
|
|
63
|
+
/** @desc 同一实例的触发器、内容区等组合子组件;省略时不显示内容,子组件通过上下文共享状态。 */
|
|
64
|
+
children?: React.ReactNode
|
|
65
|
+
}) {
|
|
66
|
+
const [internal, setInternal] = React.useState(defaultOpen ?? false)
|
|
67
|
+
const controlled = openProp !== undefined
|
|
68
|
+
const open = controlled ? openProp : internal
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<AlertDialogContext.Provider
|
|
72
|
+
value={{
|
|
73
|
+
open,
|
|
74
|
+
onOpenChange: (v) => {
|
|
75
|
+
if (!controlled) setInternal(v)
|
|
76
|
+
onOpenChange?.(v)
|
|
77
|
+
},
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
{children}
|
|
81
|
+
</AlertDialogContext.Provider>
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @desc 确认对话框触发器。
|
|
87
|
+
* @param {Parameters<typeof AlertDialogTrigger>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
88
|
+
* @return {ReturnType<typeof AlertDialogTrigger>} 组件渲染结果;类型见返回值契约。
|
|
89
|
+
* @example
|
|
90
|
+
* ```tsx
|
|
91
|
+
* import { AlertDialog, AlertDialogTrigger } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
92
|
+
* <AlertDialog><AlertDialogTrigger /></AlertDialog>
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
function AlertDialogTrigger({
|
|
96
|
+
children,
|
|
97
|
+
render,
|
|
98
|
+
onClick,
|
|
99
|
+
...props
|
|
100
|
+
}: AlertDialogTriggerProps) {
|
|
101
|
+
const { onOpenChange } = React.useContext(AlertDialogContext)
|
|
102
|
+
const handleClick = (event: AlertDialogTriggerClickEvent) => {
|
|
103
|
+
event.stopPropagation()
|
|
104
|
+
onClick?.(event)
|
|
105
|
+
onOpenChange(true)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const triggerProps: AlertDialogTriggerRenderProps = {
|
|
109
|
+
"data-slot": "alert-dialog-trigger",
|
|
110
|
+
onClick: handleClick,
|
|
111
|
+
...props,
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (render) {
|
|
115
|
+
if (typeof render === "function") {
|
|
116
|
+
return <>{render(triggerProps)}</>
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (React.isValidElement(render)) {
|
|
120
|
+
const element = render as React.ReactElement<{
|
|
121
|
+
onClick?: ViewProps["onClick"]
|
|
122
|
+
}>
|
|
123
|
+
|
|
124
|
+
return React.cloneElement(element, {
|
|
125
|
+
...triggerProps,
|
|
126
|
+
onClick: (event: AlertDialogTriggerClickEvent) => {
|
|
127
|
+
element.props.onClick?.(event)
|
|
128
|
+
handleClick(event)
|
|
129
|
+
},
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return (
|
|
135
|
+
<View {...triggerProps}>
|
|
136
|
+
{children}
|
|
137
|
+
</View>
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @desc 确认对话框跨层级渲染入口。
|
|
143
|
+
* @param {Parameters<typeof AlertDialogPortal>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
144
|
+
* @return {ReturnType<typeof AlertDialogPortal>} 组件渲染结果;类型见返回值契约。
|
|
145
|
+
* @example
|
|
146
|
+
* ```tsx
|
|
147
|
+
* import { AlertDialog, AlertDialogPortal } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
148
|
+
* <AlertDialog><AlertDialogPortal /></AlertDialog>
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
function AlertDialogPortal({ children }: {
|
|
152
|
+
/** @desc 要渲染的子节点;该兼容包装只返回 Fragment,不额外创建原生容器或执行挂载迁移。 */
|
|
153
|
+
children?: React.ReactNode }) {
|
|
154
|
+
return <>{children}</>
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @desc 确认对话框遮罩。
|
|
159
|
+
* @param {Parameters<typeof AlertDialogOverlay>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
160
|
+
* @return {ReturnType<typeof AlertDialogOverlay>} 组件渲染结果;类型见返回值契约。
|
|
161
|
+
* @example
|
|
162
|
+
* ```tsx
|
|
163
|
+
* import { AlertDialog, AlertDialogOverlay } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
164
|
+
* <AlertDialog><AlertDialogOverlay /></AlertDialog>
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
function AlertDialogOverlay({ className, ...props }: ViewProps) {
|
|
168
|
+
return (
|
|
169
|
+
<View
|
|
170
|
+
data-slot="alert-dialog-overlay"
|
|
171
|
+
className={cn(
|
|
172
|
+
"fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs",
|
|
173
|
+
className
|
|
174
|
+
)}
|
|
175
|
+
{...props}
|
|
176
|
+
/>
|
|
177
|
+
)
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @desc 确认对话框内容容器。
|
|
182
|
+
* @param {Parameters<typeof AlertDialogContent>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
183
|
+
* @return {ReturnType<typeof AlertDialogContent>} 组件渲染结果;类型见返回值契约。
|
|
184
|
+
* @example
|
|
185
|
+
* ```tsx
|
|
186
|
+
* import { AlertDialog, AlertDialogContent } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
187
|
+
* <AlertDialog><AlertDialogContent /></AlertDialog>
|
|
188
|
+
* ```
|
|
189
|
+
*/
|
|
190
|
+
function AlertDialogContent({
|
|
191
|
+
className,
|
|
192
|
+
children,
|
|
193
|
+
size = "default",
|
|
194
|
+
...props
|
|
195
|
+
}: ViewProps & {
|
|
196
|
+
/** @desc 对话框尺寸,默认 default;sm 使用紧凑宽度和双列操作区,default 可在较宽屏幕扩展到 max-w-sm。 */
|
|
197
|
+
size?: "default" | "sm" }) {
|
|
198
|
+
const ctx = React.useContext(AlertDialogContext)
|
|
199
|
+
|
|
200
|
+
const hasMedia = React.useMemo(
|
|
201
|
+
() =>
|
|
202
|
+
React.Children.toArray(children).some(
|
|
203
|
+
(child) =>
|
|
204
|
+
React.isValidElement(child) &&
|
|
205
|
+
(child.props as { "data-slot"?: string })["data-slot"] === "alert-dialog-media"
|
|
206
|
+
),
|
|
207
|
+
[children]
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
if (!ctx.open) return null
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<View className="fixed inset-0 z-50 flex items-center justify-center">
|
|
214
|
+
<AlertDialogOverlay />
|
|
215
|
+
<AlertDialogContentContext.Provider value={{ size, hasMedia }}>
|
|
216
|
+
<View
|
|
217
|
+
data-slot="alert-dialog-content"
|
|
218
|
+
className={cn(
|
|
219
|
+
"group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none",
|
|
220
|
+
size === "sm" ? "max-w-xs" : "max-w-xs sm:max-w-sm",
|
|
221
|
+
className
|
|
222
|
+
)}
|
|
223
|
+
{...props}
|
|
224
|
+
>
|
|
225
|
+
{children}
|
|
226
|
+
</View>
|
|
227
|
+
</AlertDialogContentContext.Provider>
|
|
228
|
+
</View>
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @desc 确认对话框头部布局。
|
|
234
|
+
* @param {Parameters<typeof AlertDialogHeader>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
235
|
+
* @return {ReturnType<typeof AlertDialogHeader>} 组件渲染结果;类型见返回值契约。
|
|
236
|
+
* @example
|
|
237
|
+
* ```tsx
|
|
238
|
+
* import { AlertDialog, AlertDialogHeader } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
239
|
+
* <AlertDialog><AlertDialogHeader /></AlertDialog>
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
function AlertDialogHeader({ className, ...props }: ViewProps) {
|
|
243
|
+
const { size, hasMedia } = React.useContext(AlertDialogContentContext)
|
|
244
|
+
return (
|
|
245
|
+
<View
|
|
246
|
+
data-slot="alert-dialog-header"
|
|
247
|
+
className={cn(
|
|
248
|
+
"grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center",
|
|
249
|
+
hasMedia && "grid-rows-[auto_auto_1fr] gap-x-4",
|
|
250
|
+
size === "default" && "sm:place-items-start sm:text-left",
|
|
251
|
+
size === "default" && hasMedia && "sm:grid-rows-[auto_1fr]",
|
|
252
|
+
className
|
|
253
|
+
)}
|
|
254
|
+
{...props}
|
|
255
|
+
/>
|
|
256
|
+
)
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @desc 确认对话框底部布局。
|
|
261
|
+
* @param {Parameters<typeof AlertDialogFooter>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
262
|
+
* @return {ReturnType<typeof AlertDialogFooter>} 组件渲染结果;类型见返回值契约。
|
|
263
|
+
* @example
|
|
264
|
+
* ```tsx
|
|
265
|
+
* import { AlertDialog, AlertDialogFooter } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
266
|
+
* <AlertDialog><AlertDialogFooter /></AlertDialog>
|
|
267
|
+
* ```
|
|
268
|
+
*/
|
|
269
|
+
function AlertDialogFooter({ className, ...props }: ViewProps) {
|
|
270
|
+
const { size } = React.useContext(AlertDialogContentContext)
|
|
271
|
+
return (
|
|
272
|
+
<View
|
|
273
|
+
data-slot="alert-dialog-footer"
|
|
274
|
+
className={cn(
|
|
275
|
+
"-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4",
|
|
276
|
+
size === "sm" && "grid grid-cols-2",
|
|
277
|
+
size !== "sm" && "sm:flex-row sm:justify-end",
|
|
278
|
+
className
|
|
279
|
+
)}
|
|
280
|
+
{...props}
|
|
281
|
+
/>
|
|
282
|
+
)
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* @desc 确认对话框标题。
|
|
287
|
+
* @param {Parameters<typeof AlertDialogTitle>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
288
|
+
* @return {ReturnType<typeof AlertDialogTitle>} 组件渲染结果;类型见返回值契约。
|
|
289
|
+
* @example
|
|
290
|
+
* ```tsx
|
|
291
|
+
* import { AlertDialog, AlertDialogTitle } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
292
|
+
* <AlertDialog><AlertDialogTitle /></AlertDialog>
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
function AlertDialogTitle({ className, ...props }: ViewProps) {
|
|
296
|
+
return (
|
|
297
|
+
<View
|
|
298
|
+
data-slot="alert-dialog-title"
|
|
299
|
+
className={cn("text-lg font-semibold", className)}
|
|
300
|
+
{...props}
|
|
301
|
+
/>
|
|
302
|
+
)
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @desc 确认对话框说明文本。
|
|
307
|
+
* @param {Parameters<typeof AlertDialogDescription>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
308
|
+
* @return {ReturnType<typeof AlertDialogDescription>} 组件渲染结果;类型见返回值契约。
|
|
309
|
+
* @example
|
|
310
|
+
* ```tsx
|
|
311
|
+
* import { AlertDialog, AlertDialogDescription } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
312
|
+
* <AlertDialog><AlertDialogDescription /></AlertDialog>
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
function AlertDialogDescription({ className, ...props }: ViewProps) {
|
|
316
|
+
return (
|
|
317
|
+
<View
|
|
318
|
+
data-slot="alert-dialog-description"
|
|
319
|
+
className={cn("text-sm text-muted-foreground", className)}
|
|
320
|
+
{...props}
|
|
321
|
+
/>
|
|
322
|
+
)
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* @desc 确认对话框操作入口。
|
|
327
|
+
* @param {Parameters<typeof AlertDialogAction>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
328
|
+
* @param {Parameters<typeof AlertDialogAction>[0]["variant"]} props.variant 确认按钮外观,默认 default;其余变体同 Button.variant。
|
|
329
|
+
* @param {Parameters<typeof AlertDialogAction>[0]["size"]} props.size 尺寸,默认 default(h-8);xs/sm/lg 分别为 h-6/h-7/h-9;icon/icon-xs/icon-sm/icon-lg 为 size-8/6/7/9 正方形图标按钮。
|
|
330
|
+
* @return {ReturnType<typeof AlertDialogAction>} 组件渲染结果;类型见返回值契约。
|
|
331
|
+
* @example
|
|
332
|
+
* ```tsx
|
|
333
|
+
* import { AlertDialog, AlertDialogAction } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
334
|
+
* <AlertDialog><AlertDialogAction /></AlertDialog>
|
|
335
|
+
* ```
|
|
336
|
+
*/
|
|
337
|
+
function AlertDialogAction({
|
|
338
|
+
className,
|
|
339
|
+
variant = "default",
|
|
340
|
+
size = "default",
|
|
341
|
+
onClick,
|
|
342
|
+
...props
|
|
343
|
+
}: AlertDialogActionProps) {
|
|
344
|
+
const { onOpenChange } = React.useContext(AlertDialogContext)
|
|
345
|
+
return (
|
|
346
|
+
<Button
|
|
347
|
+
data-slot="alert-dialog-action"
|
|
348
|
+
className={cn(buttonVariants({ variant, size }), "w-full sm:w-auto", className)}
|
|
349
|
+
onClick={(event) => {
|
|
350
|
+
onOpenChange(false)
|
|
351
|
+
onClick?.(event)
|
|
352
|
+
}}
|
|
353
|
+
{...props}
|
|
354
|
+
/>
|
|
355
|
+
)
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* @desc 确认对话框取消按钮。
|
|
360
|
+
* @param {Parameters<typeof AlertDialogCancel>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
361
|
+
* @param {Parameters<typeof AlertDialogCancel>[0]["variant"]} props.variant 取消按钮外观,默认 outline;其余变体同 Button.variant。
|
|
362
|
+
* @param {Parameters<typeof AlertDialogCancel>[0]["size"]} props.size 尺寸,默认 default(h-8);xs/sm/lg 分别为 h-6/h-7/h-9;icon/icon-xs/icon-sm/icon-lg 为 size-8/6/7/9 正方形图标按钮。
|
|
363
|
+
* @return {ReturnType<typeof AlertDialogCancel>} 组件渲染结果;类型见返回值契约。
|
|
364
|
+
* @example
|
|
365
|
+
* ```tsx
|
|
366
|
+
* import { AlertDialog, AlertDialogCancel } from '@open-dy/vibecoding-sdk-taro/ui/alert-dialog'
|
|
367
|
+
* <AlertDialog><AlertDialogCancel /></AlertDialog>
|
|
368
|
+
* ```
|
|
369
|
+
*/
|
|
370
|
+
function AlertDialogCancel({
|
|
371
|
+
className,
|
|
372
|
+
variant = "outline",
|
|
373
|
+
size = "default",
|
|
374
|
+
onClick,
|
|
375
|
+
...props
|
|
376
|
+
}: AlertDialogActionProps) {
|
|
377
|
+
const { onOpenChange } = React.useContext(AlertDialogContext)
|
|
378
|
+
return (
|
|
379
|
+
<View
|
|
380
|
+
data-slot="alert-dialog-cancel"
|
|
381
|
+
className={cn(
|
|
382
|
+
buttonVariants({ variant, size }),
|
|
383
|
+
"mt-2 w-full sm:mt-0 sm:w-auto",
|
|
384
|
+
className
|
|
385
|
+
)}
|
|
386
|
+
onClick={(event) => {
|
|
387
|
+
onOpenChange(false)
|
|
388
|
+
onClick?.(event)
|
|
389
|
+
}}
|
|
390
|
+
{...props}
|
|
391
|
+
/>
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export {
|
|
396
|
+
AlertDialog,
|
|
397
|
+
AlertDialogPortal,
|
|
398
|
+
AlertDialogOverlay,
|
|
399
|
+
AlertDialogTrigger,
|
|
400
|
+
AlertDialogContent,
|
|
401
|
+
AlertDialogHeader,
|
|
402
|
+
AlertDialogFooter,
|
|
403
|
+
AlertDialogTitle,
|
|
404
|
+
AlertDialogDescription,
|
|
405
|
+
AlertDialogAction,
|
|
406
|
+
AlertDialogCancel,
|
|
407
|
+
}
|
package/src/ui/alert.tsx
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { View, type ViewProps } from "@tarojs/components"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
|
|
5
|
+
import { cn } from "../lib/utils"
|
|
6
|
+
|
|
7
|
+
const AlertContext = React.createContext({
|
|
8
|
+
hasAction: false,
|
|
9
|
+
hasMedia: false,
|
|
10
|
+
variant: "default" as "default" | "destructive",
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
const alertVariants = cva(
|
|
14
|
+
// Taro doesn't render `svg` icons in most cases. Only switch to the icon+content
|
|
15
|
+
// two-column layout when the first child is an Image-like element.
|
|
16
|
+
"group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-[>image]:grid-cols-[auto_1fr] has-[>image]:gap-x-2 has-[>taro-image-core]:grid-cols-[auto_1fr] has-[>taro-image-core]:gap-x-2 has-[>img]:grid-cols-[auto_1fr] has-[>img]:gap-x-2 [&>image]:row-span-2 [&>image]:translate-y-0.5 [&>taro-image-core]:row-span-2 [&>taro-image-core]:translate-y-0.5 [&>img]:row-span-2 [&>img]:translate-y-0.5",
|
|
17
|
+
{
|
|
18
|
+
variants: {
|
|
19
|
+
variant: {
|
|
20
|
+
default: "bg-card text-card-foreground",
|
|
21
|
+
destructive: "bg-card text-destructive",
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
defaultVariants: {
|
|
25
|
+
variant: "default",
|
|
26
|
+
},
|
|
27
|
+
}
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @desc 提示信息组件。
|
|
32
|
+
* @param {Parameters<typeof Alert>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
33
|
+
* @param {Parameters<typeof Alert>[0]["variant"]} props.variant 提示色彩,默认 default;destructive 使用危险操作颜色并同步到 AlertDescription,只控制视觉,不执行错误处理。
|
|
34
|
+
* @return {ReturnType<typeof Alert>} 组件渲染结果;类型见返回值契约。
|
|
35
|
+
* @example
|
|
36
|
+
* ```tsx
|
|
37
|
+
* import { Alert } from '@open-dy/vibecoding-sdk-taro/ui/alert'
|
|
38
|
+
* <Alert />
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
function Alert({
|
|
42
|
+
className,
|
|
43
|
+
variant,
|
|
44
|
+
children,
|
|
45
|
+
...props
|
|
46
|
+
}: ViewProps & VariantProps<typeof alertVariants>) {
|
|
47
|
+
const resolvedVariant = variant ?? "default"
|
|
48
|
+
const childArray = React.Children.toArray(children)
|
|
49
|
+
const hasAction = childArray.some(
|
|
50
|
+
(child) => React.isValidElement(child) && child.type === AlertAction
|
|
51
|
+
)
|
|
52
|
+
const hasMedia = childArray.some((child) => {
|
|
53
|
+
if (!React.isValidElement(child)) return false
|
|
54
|
+
const childType = typeof child.type === "string" ? child.type : ""
|
|
55
|
+
return childType === "image" || childType === "img" || childType === "taro-image-core"
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<AlertContext.Provider value={{ hasAction, hasMedia, variant: resolvedVariant }}>
|
|
60
|
+
<View
|
|
61
|
+
data-slot="alert"
|
|
62
|
+
className={cn(
|
|
63
|
+
alertVariants({ variant: resolvedVariant }),
|
|
64
|
+
hasAction && "relative pr-18",
|
|
65
|
+
hasMedia && "grid-cols-[auto_1fr] gap-x-2",
|
|
66
|
+
className
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
>
|
|
70
|
+
{children}
|
|
71
|
+
</View>
|
|
72
|
+
</AlertContext.Provider>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @desc 提示信息标题。
|
|
78
|
+
* @param {Parameters<typeof AlertTitle>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
79
|
+
* @return {ReturnType<typeof AlertTitle>} 组件渲染结果;类型见返回值契约。
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* import { Alert, AlertTitle } from '@open-dy/vibecoding-sdk-taro/ui/alert'
|
|
83
|
+
* <Alert><AlertTitle /></Alert>
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
function AlertTitle({ className, ...props }: ViewProps) {
|
|
87
|
+
const { hasMedia } = React.useContext(AlertContext)
|
|
88
|
+
return (
|
|
89
|
+
<View
|
|
90
|
+
data-slot="alert-title"
|
|
91
|
+
className={cn(
|
|
92
|
+
"font-medium [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",
|
|
93
|
+
hasMedia && "col-start-2",
|
|
94
|
+
className
|
|
95
|
+
)}
|
|
96
|
+
{...props}
|
|
97
|
+
/>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @desc 提示信息说明文本。
|
|
103
|
+
* @param {Parameters<typeof AlertDescription>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
104
|
+
* @return {ReturnType<typeof AlertDescription>} 组件渲染结果;类型见返回值契约。
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* import { Alert, AlertDescription } from '@open-dy/vibecoding-sdk-taro/ui/alert'
|
|
108
|
+
* <Alert><AlertDescription /></Alert>
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
function AlertDescription({
|
|
112
|
+
className,
|
|
113
|
+
...props
|
|
114
|
+
}: ViewProps) {
|
|
115
|
+
const { variant } = React.useContext(AlertContext)
|
|
116
|
+
return (
|
|
117
|
+
<View
|
|
118
|
+
data-slot="alert-description"
|
|
119
|
+
className={cn(
|
|
120
|
+
"text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
121
|
+
variant === "destructive" && "text-destructive/90",
|
|
122
|
+
className
|
|
123
|
+
)}
|
|
124
|
+
{...props}
|
|
125
|
+
/>
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @desc 提示信息操作入口。
|
|
131
|
+
* @param {Parameters<typeof AlertAction>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
132
|
+
* @return {ReturnType<typeof AlertAction>} 组件渲染结果;类型见返回值契约。
|
|
133
|
+
* @example
|
|
134
|
+
* ```tsx
|
|
135
|
+
* import { Alert, AlertAction } from '@open-dy/vibecoding-sdk-taro/ui/alert'
|
|
136
|
+
* <Alert><AlertAction /></Alert>
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
function AlertAction({ className, ...props }: ViewProps) {
|
|
140
|
+
return (
|
|
141
|
+
<View
|
|
142
|
+
data-slot="alert-action"
|
|
143
|
+
className={cn("absolute top-2 right-2", className)}
|
|
144
|
+
{...props}
|
|
145
|
+
/>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction }
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { View, type ViewProps } from "@tarojs/components"
|
|
2
|
+
|
|
3
|
+
import { cn } from "../lib/utils"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @desc 固定宽高比容器组件。
|
|
7
|
+
* @param {Parameters<typeof AspectRatio>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
8
|
+
* @return {ReturnType<typeof AspectRatio>} 组件渲染结果;类型见返回值契约。
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { AspectRatio } from '@open-dy/vibecoding-sdk-taro/ui/aspect-ratio'
|
|
12
|
+
* <AspectRatio ratio={16 / 9} />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
function AspectRatio({
|
|
16
|
+
ratio,
|
|
17
|
+
className,
|
|
18
|
+
style,
|
|
19
|
+
...props
|
|
20
|
+
}: ViewProps & {
|
|
21
|
+
/** @desc 必填宽高比(宽 ÷ 高),应为正数,例如 16 / 9;通过 CSS aspect-ratio 控制根容器,不设置固定宽度。 */
|
|
22
|
+
ratio: number }) {
|
|
23
|
+
return (
|
|
24
|
+
<View
|
|
25
|
+
data-slot="aspect-ratio"
|
|
26
|
+
style={
|
|
27
|
+
{
|
|
28
|
+
"--ratio": ratio,
|
|
29
|
+
} as React.CSSProperties
|
|
30
|
+
}
|
|
31
|
+
className={cn("relative aspect-(--ratio)", className)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { AspectRatio }
|