@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,342 @@
|
|
|
1
|
+
/// <reference types="@tarojs/taro" />
|
|
2
|
+
/// <reference path="../internal/runtime/douyin-open-button.d.ts" />
|
|
3
|
+
|
|
4
|
+
declare const PROJECT_DOMAIN: string | undefined;
|
|
5
|
+
declare const DOUYIN_CLOUD_ENV_ID: string;
|
|
6
|
+
declare const DOUYIN_CLOUD_DEV_ENV_ID: string;
|
|
7
|
+
declare const DOUYIN_CLOUD_SERVICE_ID: string;
|
|
8
|
+
declare const AUDIT_DOUYIN_CLOUD_ENV_ID: string;
|
|
9
|
+
declare const AUDIT_DOUYIN_CLOUD_SERVICE_ID: string;
|
|
10
|
+
declare const OPEN_CARD_ID: string;
|
|
11
|
+
declare const UPLOAD_URL: string;
|
|
12
|
+
declare const DOWNLOAD_URL: string;
|
|
13
|
+
|
|
14
|
+
declare namespace Taro {
|
|
15
|
+
interface ShareAppMessageReturnObject {
|
|
16
|
+
channel?: string;
|
|
17
|
+
success?: () => void;
|
|
18
|
+
fail?: (error?: unknown) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface ShareAppMessageObject {
|
|
22
|
+
channel?: string;
|
|
23
|
+
success?: () => void;
|
|
24
|
+
fail?: (error?: unknown) => void;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
interface AppConfig {
|
|
28
|
+
isDependCard?: boolean;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
type DouyinCallContainerSuccessResult<T = unknown> = {
|
|
33
|
+
data?: T | string;
|
|
34
|
+
body?: T | string;
|
|
35
|
+
statusCode: number;
|
|
36
|
+
headers?: Record<string, unknown>;
|
|
37
|
+
header?: Record<string, unknown>;
|
|
38
|
+
errMsg?: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type DouyinCallContainerFailResult = {
|
|
42
|
+
errMsg?: string;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
type DouyinCloudInstance = {
|
|
46
|
+
callContainer?: <T = unknown>(options: {
|
|
47
|
+
path: string;
|
|
48
|
+
id?: string;
|
|
49
|
+
usePrefetchCache?: boolean;
|
|
50
|
+
init?: {
|
|
51
|
+
method?: string;
|
|
52
|
+
header?: Record<string, unknown>;
|
|
53
|
+
timeout?: number;
|
|
54
|
+
body?: unknown;
|
|
55
|
+
};
|
|
56
|
+
success?: (result: DouyinCallContainerSuccessResult<T>) => void;
|
|
57
|
+
fail?: (result: DouyinCallContainerFailResult) => void;
|
|
58
|
+
}) => void;
|
|
59
|
+
uploadFile: (params: {
|
|
60
|
+
cloudPath: string;
|
|
61
|
+
filePath: string;
|
|
62
|
+
timeout?: number;
|
|
63
|
+
success?: (res: { errMsg: string }) => void;
|
|
64
|
+
fail?: (res: { errMsg: string; errNo: number }) => void;
|
|
65
|
+
}) => void;
|
|
66
|
+
downloadFile: (params: {
|
|
67
|
+
cloudPath: string;
|
|
68
|
+
filePath?: string;
|
|
69
|
+
timeout?: number;
|
|
70
|
+
success?: (res: {
|
|
71
|
+
tempFilePath: string;
|
|
72
|
+
filePath: string;
|
|
73
|
+
errMsg: string;
|
|
74
|
+
}) => void;
|
|
75
|
+
fail?: (res: { errMsg: string; errNo: number }) => void;
|
|
76
|
+
}) => void;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
interface EventSourceTask {
|
|
80
|
+
close: () => void;
|
|
81
|
+
onClose: (cb: () => void) => void;
|
|
82
|
+
onOpen: (cb: () => void) => void;
|
|
83
|
+
onError: (cb: () => void) => void;
|
|
84
|
+
onMessage: (cb: (chunk: { data: string; id: number }) => void) => void;
|
|
85
|
+
readonly readyState: 0 | 1 | 2;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
type SceneActivityScene = "bind" | "receive";
|
|
89
|
+
|
|
90
|
+
type SceneActivityEventType =
|
|
91
|
+
| "bind" // 绑定福利
|
|
92
|
+
| "receive" // 领取福利
|
|
93
|
+
| "autoReceive" // 复访自动领取(基础库 3.32.0+)
|
|
94
|
+
| "toUse"; // 复访“去使用”点击(基础库 3.32.0+)
|
|
95
|
+
|
|
96
|
+
type SceneActivityFailResult = {
|
|
97
|
+
errMsg?: string;
|
|
98
|
+
errNo?: number; // 21001 / 21011 / 21021 / 21041 等,详见官方错误码表
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
type SceneActivityBindResult = {
|
|
102
|
+
mainTitle?: string; // 主标题
|
|
103
|
+
subTitle?: string; // 副标题
|
|
104
|
+
imageUrl?: string; // 封面图片
|
|
105
|
+
leftButtonText?: string; // 关闭按钮文案
|
|
106
|
+
rightButtonText?: string; // 引导标题文案
|
|
107
|
+
extra?: string; // 福利信息(透传字符串)
|
|
108
|
+
errMsg?: string; // "SceneActivityContext.bind:ok"
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
type SceneActivityQueryResult = {
|
|
112
|
+
activityList: string[]; // 复访福利活动 id 列表
|
|
113
|
+
errMsg?: string; // "SceneActivityContext.query:ok"
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type SceneActivityReceiveResult = {
|
|
117
|
+
welfareId?: string; // 复访营销活动 id
|
|
118
|
+
errMsg?: string; // "SceneActivityContext.receive:ok"
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
type SceneActivityEvent = {
|
|
122
|
+
eventType: SceneActivityEventType;
|
|
123
|
+
data: {
|
|
124
|
+
welfareId: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
type SceneActivityContext = {
|
|
129
|
+
query: (options?: {
|
|
130
|
+
success?: (result: SceneActivityQueryResult) => void;
|
|
131
|
+
fail?: (result: SceneActivityFailResult) => void;
|
|
132
|
+
complete?: () => void;
|
|
133
|
+
}) => void;
|
|
134
|
+
checkScene: (options: { scene: SceneActivityScene }) => boolean;
|
|
135
|
+
bind: (options: {
|
|
136
|
+
activityId?: string; // 留空时基础库默认选择最后创建的活动
|
|
137
|
+
success?: (result: SceneActivityBindResult) => void;
|
|
138
|
+
fail?: (result: SceneActivityFailResult) => void;
|
|
139
|
+
complete?: () => void;
|
|
140
|
+
}) => void;
|
|
141
|
+
jump: (options?: {
|
|
142
|
+
success?: (result: { errMsg?: string }) => void;
|
|
143
|
+
fail?: (result: SceneActivityFailResult) => void; // 21041:需先调用 bind
|
|
144
|
+
complete?: () => void;
|
|
145
|
+
}) => void;
|
|
146
|
+
receive: (options?: {
|
|
147
|
+
success?: (result: SceneActivityReceiveResult) => void;
|
|
148
|
+
fail?: (result: SceneActivityFailResult) => void;
|
|
149
|
+
complete?: () => void;
|
|
150
|
+
}) => void;
|
|
151
|
+
on: (cb: (event: SceneActivityEvent) => void) => void; // 监听复访营销活动状态变更
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
type DouyinMiniProgramRuntime = {
|
|
155
|
+
getEnvInfoSync?: () => { microapp?: { envType?: string } };
|
|
156
|
+
getEnvInfoSync?: () => { microapp?: { envType?: string } }
|
|
157
|
+
getSystemInfoSync?: () => { platform: string }
|
|
158
|
+
getLaunchOptionsSync?: () => {
|
|
159
|
+
refererInfo?: {
|
|
160
|
+
extraData?: {
|
|
161
|
+
version?: unknown
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
createCloud?: (options: {
|
|
166
|
+
envID: string;
|
|
167
|
+
serviceID?: string;
|
|
168
|
+
}) => DouyinCloudInstance;
|
|
169
|
+
login?: (options: {
|
|
170
|
+
success?: (result: { code?: string; errMsg?: string }) => void;
|
|
171
|
+
fail?: (result: { errMsg?: string }) => void;
|
|
172
|
+
}) => void;
|
|
173
|
+
createEventSource(params: any, timeout?: number): EventSourceTask;
|
|
174
|
+
canIUseVideoFormat?: (options: {
|
|
175
|
+
format: "H.265"; // 视频编码格式,目前仅支持 H.265
|
|
176
|
+
success?: (result: {
|
|
177
|
+
errMsg: string;
|
|
178
|
+
result: boolean; // 表示是否支持特定编码格式的视频
|
|
179
|
+
}) => void;
|
|
180
|
+
fail?: (result: { errMsg?: string }) => void;
|
|
181
|
+
complete?: () => void;
|
|
182
|
+
}) => void;
|
|
183
|
+
prerenderVideo?: (options: {
|
|
184
|
+
size?: number; // 预渲染资源大小,单位 byte,取值范围(0,10M]。默认400*1024
|
|
185
|
+
src: string; // 视频资源地址
|
|
186
|
+
success?: (result: { errMsg: string }) => void;
|
|
187
|
+
fail?: (result: { errMsg?: string }) => void;
|
|
188
|
+
complete?: () => void;
|
|
189
|
+
}) => void;
|
|
190
|
+
navigateToVideoView?: (options: {
|
|
191
|
+
videoId?: string; // 被分享视频的 id,通过 onShareAppMessage extra.withVideoId=true 获取
|
|
192
|
+
encryptedId?: string; // 加密后的抖音开放平台视频 id,与 videoId 二选一;同传时按 encryptedId 处理
|
|
193
|
+
success?: (result: { errMsg: string }) => void;
|
|
194
|
+
fail?: (result: { errMsg?: string; errCode?: number }) => void;
|
|
195
|
+
complete?: () => void;
|
|
196
|
+
}) => void;
|
|
197
|
+
createSceneActivityContext?: () => SceneActivityContext; // 基础库 3.27.0+;同步返回侧边栏复访营销活动实例
|
|
198
|
+
getSidebarActivity?: (options?: {
|
|
199
|
+
success?: (result: { activityList: string[]; errMsg?: string }) => void;
|
|
200
|
+
fail?: (result: { errMsg?: string; errorCode?: number; errorType?: string }) => void;
|
|
201
|
+
complete?: () => void;
|
|
202
|
+
}) => void; // 基础库 3.6.0+;获取生效中侧边栏活动 id 列表,可配合 tt.navigateToScene 使用
|
|
203
|
+
navigateToScene?: (options: {
|
|
204
|
+
scene: "sidebar"; // 目前仅支持跳转「侧边栏」场景
|
|
205
|
+
activity: string; // 活动 id;不填或填错会兜底样式
|
|
206
|
+
success?: (result: { code: 0 | 1; errMsg?: string }) => void; // code 0=成功跳转,1=用户取消
|
|
207
|
+
fail?: (result: { errMsg?: string; errorCode?: number; errorType?: string }) => void;
|
|
208
|
+
complete?: () => void;
|
|
209
|
+
}) => void; // 基础库 3.6.0+;跳转到指定入口场景,目前仅支持 sidebar
|
|
210
|
+
startFacialRecognitionVerify?: (options: {
|
|
211
|
+
ticket: string; // 由服务端 /api/apps/facial_recognition/v3/get_ticket 获取,30 天有效
|
|
212
|
+
scene: string; // 火山引擎为该小程序分配的业务场景值(microapp_xxx)
|
|
213
|
+
certAppId: "1128" | "2329" | string; // 1128=抖音;2329=抖音极速版(抖音火山版 8663 已下线)
|
|
214
|
+
success?: (result: { verifyResult: string; errMsg: string }) => void; // verifyResult 为中台 auth_ticket
|
|
215
|
+
fail?: (result: { errMsg?: string; errNo?: number }) => void; // 错误码见 SOP:10101/21101~21113/10200/10208/10301/10104 等
|
|
216
|
+
complete?: () => void;
|
|
217
|
+
}) => void; // 基础库 2.52.0+;活体人脸识别,仅抖音/抖音极速版 22.4+ 支持
|
|
218
|
+
showDouyinOpenAuth?: (options: {
|
|
219
|
+
// 抖音开放平台已开通的 scope,例如 { im: 0, "im.media": 2 }
|
|
220
|
+
// value: 0=必选(用户不可取消),1=非必选默认选中,2=非必选默认不选中
|
|
221
|
+
// 每次调用为「全量授权」,不支持增量,需要把所有需要的 scope 一起传入
|
|
222
|
+
scopes: Record<string, 0 | 1 | 2>;
|
|
223
|
+
success?: (result: {
|
|
224
|
+
ticket: string; // 即开放平台 authCode,需服务端换 access_token
|
|
225
|
+
grantPermissions: string[]; // 用户实际授权的 scope 列表
|
|
226
|
+
errMsg: string; // "showDouyinOpenAuth:ok"
|
|
227
|
+
}) => void;
|
|
228
|
+
fail?: (result: {
|
|
229
|
+
errMsg?: string; // "showDouyinOpenAuth:fail ..."
|
|
230
|
+
// 常见错误码:
|
|
231
|
+
// 20000 scopes 为空/内部错误;20001 参数错误;
|
|
232
|
+
// 10200/21105 用户拒绝授权;21104 该 scope 未配置使用场景;
|
|
233
|
+
// 21100 登录失败、21101 取票失败、21102 拉 scope 失败、21103 取 code 失败;
|
|
234
|
+
// 10301 当前宿主不支持;10403 unknown error
|
|
235
|
+
errNo?: number;
|
|
236
|
+
}) => void;
|
|
237
|
+
complete?: () => void;
|
|
238
|
+
}) => void; // 基础库 1.93.0+;仅抖音宿主,调起抖音开放能力授权弹窗
|
|
239
|
+
getCustomButtonBoundingClientRect?: (options?: {
|
|
240
|
+
measurementUnit?: "px" | "rpx"; // 默认 px
|
|
241
|
+
}) => {
|
|
242
|
+
// 左上角 logo/返回按钮位置;不存在或获取时机太早时为 undefined
|
|
243
|
+
leftIcon?: {
|
|
244
|
+
width: number;
|
|
245
|
+
height: number;
|
|
246
|
+
top: number; // 上边界坐标
|
|
247
|
+
right: number; // 右边界坐标
|
|
248
|
+
bottom: number; // 下边界坐标
|
|
249
|
+
left: number; // 左边界坐标
|
|
250
|
+
};
|
|
251
|
+
// 右上角反馈+more+close 胶囊位置;不存在或获取时机太早时为 undefined
|
|
252
|
+
capsule?: {
|
|
253
|
+
width: number;
|
|
254
|
+
height: number;
|
|
255
|
+
top: number;
|
|
256
|
+
right: number;
|
|
257
|
+
bottom: number;
|
|
258
|
+
left: number;
|
|
259
|
+
};
|
|
260
|
+
// 自定义导航栏可绘制区域
|
|
261
|
+
customNavigation?: {
|
|
262
|
+
width: number; // 可绘制区域宽度
|
|
263
|
+
height: number; // 可绘制区域高度
|
|
264
|
+
marginLeft: number; // 距可使用窗口的左边距
|
|
265
|
+
marginRight: number; // 距可使用窗口的右边距
|
|
266
|
+
marginTop: number; // 距可使用窗口的上边距
|
|
267
|
+
centerLineToTop: number; // 中线到顶部的距离
|
|
268
|
+
};
|
|
269
|
+
}; // 同步方法,仅自定义导航栏下返回真实数据,建议在 onReady 后调用
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
declare module "@tarojs/components" {
|
|
273
|
+
// 保留 @tarojs/components 原有导出
|
|
274
|
+
export * from "@tarojs/components/types/index";
|
|
275
|
+
import type { ComponentType } from "react";
|
|
276
|
+
import type {
|
|
277
|
+
CommonEventFunction,
|
|
278
|
+
StandardProps,
|
|
279
|
+
} from "@tarojs/components/types/common";
|
|
280
|
+
|
|
281
|
+
export interface ChannelVideoProps extends StandardProps {
|
|
282
|
+
itemId: string;
|
|
283
|
+
loop?: boolean;
|
|
284
|
+
objectFit?: "contain" | "cover";
|
|
285
|
+
preload?: boolean;
|
|
286
|
+
onPlay?: CommonEventFunction;
|
|
287
|
+
onPause?: CommonEventFunction;
|
|
288
|
+
onWaiting?: CommonEventFunction;
|
|
289
|
+
onStop?: CommonEventFunction;
|
|
290
|
+
onEnd?: CommonEventFunction;
|
|
291
|
+
onProgress?: CommonEventFunction<{
|
|
292
|
+
currentTime: number;
|
|
293
|
+
}>;
|
|
294
|
+
onError?: CommonEventFunction<{
|
|
295
|
+
errorCode?: number;
|
|
296
|
+
errorMsg?: string;
|
|
297
|
+
errorType?: string;
|
|
298
|
+
}>;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
export const ChannelVideo: ComponentType<ChannelVideoProps>;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
declare module "*.png";
|
|
305
|
+
declare module "*.gif";
|
|
306
|
+
declare module "*.jpg";
|
|
307
|
+
declare module "*.jpeg";
|
|
308
|
+
declare module "*.svg";
|
|
309
|
+
declare module "*.css";
|
|
310
|
+
declare module "*.less";
|
|
311
|
+
declare module "*.scss";
|
|
312
|
+
declare module "*.sass";
|
|
313
|
+
declare module "*.styl";
|
|
314
|
+
|
|
315
|
+
declare namespace NodeJS {
|
|
316
|
+
interface ProcessEnv {
|
|
317
|
+
/** NODE 内置环境变量, 会影响到最终构建生成产物 */
|
|
318
|
+
NODE_ENV: "development" | "production";
|
|
319
|
+
/** 当前构建的平台 */
|
|
320
|
+
TARO_ENV:
|
|
321
|
+
| "weapp"
|
|
322
|
+
| "swan"
|
|
323
|
+
| "alipay"
|
|
324
|
+
| "h5"
|
|
325
|
+
| "rn"
|
|
326
|
+
| "tt"
|
|
327
|
+
| "quickapp"
|
|
328
|
+
| "qq"
|
|
329
|
+
| "jd";
|
|
330
|
+
/**
|
|
331
|
+
* 当前构建的小程序 appid
|
|
332
|
+
* @description 若不同环境有不同的小程序,可通过在 env 文件中配置环境变量`TARO_APP_ID`来方便快速切换 appid, 而不必手动去修改 dist/project.config.json 文件
|
|
333
|
+
* @see https://taro-docs.jd.com/docs/next/env-mode-config#特殊环境变量-taro_app_id
|
|
334
|
+
*/
|
|
335
|
+
TARO_APP_ID: string;
|
|
336
|
+
DOUYIN_CLOUD_ENV_ID?: string;
|
|
337
|
+
DOUYIN_CLOUD_DEV_ENV_ID?: string;
|
|
338
|
+
DOUYIN_CLOUD_SERVICE_ID?: string;
|
|
339
|
+
AUDIT_DOUYIN_CLOUD_ENV_ID?: string;
|
|
340
|
+
AUDIT_DOUYIN_CLOUD_SERVICE_ID?: string;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export const createUrl = (url: string): string => {
|
|
2
|
+
if (url.startsWith('http://') || url.startsWith('https://')) {
|
|
3
|
+
return url
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
return `${PROJECT_DOMAIN}${url}`
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const encodeExistingQuery = (url: string): string => {
|
|
10
|
+
const qIndex = url.indexOf('?')
|
|
11
|
+
if (qIndex === -1) return url
|
|
12
|
+
|
|
13
|
+
const path = url.slice(0, qIndex)
|
|
14
|
+
const query = url.slice(qIndex + 1)
|
|
15
|
+
const encodedQuery = query
|
|
16
|
+
.split('&')
|
|
17
|
+
.filter(Boolean)
|
|
18
|
+
.map(part => {
|
|
19
|
+
const eqIndex = part.indexOf('=')
|
|
20
|
+
if (eqIndex === -1) return encodeURIComponent(decodeURIComponent(part))
|
|
21
|
+
const k = part.slice(0, eqIndex)
|
|
22
|
+
const v = part.slice(eqIndex + 1)
|
|
23
|
+
return `${encodeURIComponent(decodeURIComponent(k))}=${encodeURIComponent(decodeURIComponent(v))}`
|
|
24
|
+
})
|
|
25
|
+
.join('&')
|
|
26
|
+
return `${path}?${encodedQuery}`
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const appendGetQuery = (
|
|
30
|
+
url: string,
|
|
31
|
+
data?: Record<string, any>,
|
|
32
|
+
method?: string,
|
|
33
|
+
): string => {
|
|
34
|
+
if ((method ?? 'GET').toUpperCase() !== 'GET' || !data) {
|
|
35
|
+
const result = encodeExistingQuery(url)
|
|
36
|
+
// console.log('[appendGetQuery] path:', result)
|
|
37
|
+
return result
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const queryString = Object.entries(data)
|
|
41
|
+
.filter(([, value]) => value !== undefined && value !== null)
|
|
42
|
+
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)
|
|
43
|
+
.join('&')
|
|
44
|
+
|
|
45
|
+
const base = encodeExistingQuery(url)
|
|
46
|
+
if (!queryString) {
|
|
47
|
+
// console.log('[appendGetQuery] path:', base)
|
|
48
|
+
return base
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const result = `${base}${base.includes('?') ? '&' : '?'}${queryString}`
|
|
52
|
+
// console.log('[appendGetQuery] path:', result)
|
|
53
|
+
return result
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export const createContainerPath = (url: string): string => {
|
|
57
|
+
if (!url.startsWith('http://') && !url.startsWith('https://')) {
|
|
58
|
+
return url
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const parsedUrl = new URL(url)
|
|
62
|
+
return `${parsedUrl.pathname}${parsedUrl.search}`
|
|
63
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { View, type ViewProps } from "@tarojs/components"
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils"
|
|
5
|
+
import { ChevronDown, ChevronUp } from "@open-dy/lucide-taro"
|
|
6
|
+
|
|
7
|
+
const AccordionContext = React.createContext<{
|
|
8
|
+
value: string[]
|
|
9
|
+
toggle: (val: string) => void
|
|
10
|
+
disabled: boolean
|
|
11
|
+
}>({ value: [], toggle: () => {}, disabled: false })
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @desc 手风琴折叠面板组件。
|
|
15
|
+
* @param {Parameters<typeof Accordion>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
16
|
+
* @return {ReturnType<typeof Accordion>} 组件渲染结果;类型见返回值契约。
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { Accordion } from '@open-dy/vibecoding-sdk-taro/ui/accordion'
|
|
20
|
+
* <Accordion />
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
function Accordion({
|
|
24
|
+
className,
|
|
25
|
+
type = "single",
|
|
26
|
+
value: valueProp,
|
|
27
|
+
defaultValue,
|
|
28
|
+
onValueChange,
|
|
29
|
+
children,
|
|
30
|
+
disabled = false,
|
|
31
|
+
multiple = false,
|
|
32
|
+
...props
|
|
33
|
+
}: ViewProps & {
|
|
34
|
+
/** @desc 展开模式:single 仅展开一项、multiple 可展开多项,默认 single;multiple 为 true 时强制多项展开。 */
|
|
35
|
+
type?: "single" | "multiple"
|
|
36
|
+
/** @desc 受控展开项的标识;字符串表示单项,数组表示多项。传入后需在 onValueChange 中同步,省略时由内部状态管理。 */
|
|
37
|
+
value?: string | string[]
|
|
38
|
+
/** @desc 非受控模式的初始展开项;默认全部收起,字符串表示单项、数组表示多项。仅初始化时读取,传入 value 后不生效。 */
|
|
39
|
+
defaultValue?: string | string[]
|
|
40
|
+
/** @desc 是否禁止整组切换,默认 false;禁用后各项不能通过内部操作改变选中状态。 */
|
|
41
|
+
disabled?: boolean
|
|
42
|
+
/** @desc 多选快捷开关,默认 false;为 true 时优先于 type,允许同时选中多项。 */
|
|
43
|
+
multiple?: boolean
|
|
44
|
+
/** @desc 用户展开或收起项目时调用;单项模式返回字符串(全部收起为空字符串),多项模式返回字符串数组(全部收起为空数组)。 */
|
|
45
|
+
onValueChange?: (value: string | string[]) => void
|
|
46
|
+
}) {
|
|
47
|
+
const [internal, setInternal] = React.useState<string[]>(
|
|
48
|
+
defaultValue
|
|
49
|
+
? Array.isArray(defaultValue)
|
|
50
|
+
? defaultValue
|
|
51
|
+
: [defaultValue]
|
|
52
|
+
: []
|
|
53
|
+
)
|
|
54
|
+
const controlled = valueProp !== undefined
|
|
55
|
+
const current = React.useMemo(
|
|
56
|
+
() =>
|
|
57
|
+
controlled
|
|
58
|
+
? Array.isArray(valueProp)
|
|
59
|
+
? valueProp
|
|
60
|
+
: [valueProp]
|
|
61
|
+
: internal,
|
|
62
|
+
[controlled, valueProp, internal]
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
const isMultiple = multiple || type === "multiple"
|
|
66
|
+
|
|
67
|
+
const toggle = React.useCallback(
|
|
68
|
+
(val: string) => {
|
|
69
|
+
if (disabled) return
|
|
70
|
+
let next: string[]
|
|
71
|
+
if (isMultiple) {
|
|
72
|
+
next = current.includes(val)
|
|
73
|
+
? current.filter((v) => v !== val)
|
|
74
|
+
: [...current, val]
|
|
75
|
+
} else {
|
|
76
|
+
next = current.includes(val) ? [] : [val]
|
|
77
|
+
}
|
|
78
|
+
if (!controlled) setInternal(next)
|
|
79
|
+
onValueChange?.(isMultiple ? next : next[0] ?? "")
|
|
80
|
+
},
|
|
81
|
+
[current, isMultiple, controlled, onValueChange, disabled]
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<AccordionContext.Provider value={{ value: current, toggle, disabled }}>
|
|
86
|
+
<View
|
|
87
|
+
data-slot="accordion"
|
|
88
|
+
className={cn("flex w-full flex-col", className)}
|
|
89
|
+
{...props}
|
|
90
|
+
>
|
|
91
|
+
{children}
|
|
92
|
+
</View>
|
|
93
|
+
</AccordionContext.Provider>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const AccordionItemContext = React.createContext<{
|
|
98
|
+
value: string
|
|
99
|
+
disabled: boolean
|
|
100
|
+
}>({ value: "", disabled: false })
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* @desc 手风琴折叠面板条目。
|
|
104
|
+
* @param {Parameters<typeof AccordionItem>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
105
|
+
* @return {ReturnType<typeof AccordionItem>} 组件渲染结果;类型见返回值契约。
|
|
106
|
+
* @example
|
|
107
|
+
* ```tsx
|
|
108
|
+
* import { Accordion, AccordionItem } from '@open-dy/vibecoding-sdk-taro/ui/accordion'
|
|
109
|
+
* <Accordion><AccordionItem value="details"><AccordionItem value="details" /></AccordionItem></Accordion>
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
function AccordionItem({
|
|
113
|
+
className,
|
|
114
|
+
value,
|
|
115
|
+
children,
|
|
116
|
+
disabled = false,
|
|
117
|
+
...props
|
|
118
|
+
}: ViewProps & {
|
|
119
|
+
/** @desc 当前项目的唯一标识;必须与父组件的 value/defaultValue 对应,不同项目使用不同值。 */
|
|
120
|
+
value: string,
|
|
121
|
+
/** @desc 是否禁用当前项目,默认 false;禁用后不执行内部切换。父组件禁用时此项也不可操作。 */
|
|
122
|
+
disabled?: boolean }) {
|
|
123
|
+
const itemContext = React.useMemo(() => ({ value, disabled }), [value, disabled])
|
|
124
|
+
return (
|
|
125
|
+
<AccordionItemContext.Provider value={itemContext}>
|
|
126
|
+
<View
|
|
127
|
+
data-slot="accordion-item"
|
|
128
|
+
className={cn("not-last:border-b", className)}
|
|
129
|
+
{...props}
|
|
130
|
+
>
|
|
131
|
+
{children}
|
|
132
|
+
</View>
|
|
133
|
+
</AccordionItemContext.Provider>
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @desc 手风琴折叠面板触发器。
|
|
139
|
+
* @param {Parameters<typeof AccordionTrigger>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
140
|
+
* @return {ReturnType<typeof AccordionTrigger>} 组件渲染结果;类型见返回值契约。
|
|
141
|
+
* @example
|
|
142
|
+
* ```tsx
|
|
143
|
+
* import { Accordion, AccordionItem, AccordionTrigger } from '@open-dy/vibecoding-sdk-taro/ui/accordion'
|
|
144
|
+
* <Accordion><AccordionItem value="details"><AccordionTrigger /></AccordionItem></Accordion>
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
function AccordionTrigger({
|
|
148
|
+
className,
|
|
149
|
+
children,
|
|
150
|
+
...props
|
|
151
|
+
}: ViewProps) {
|
|
152
|
+
const { value, toggle, disabled: accordionDisabled } = React.useContext(AccordionContext)
|
|
153
|
+
const { value: itemValue, disabled: itemDisabled } = React.useContext(AccordionItemContext)
|
|
154
|
+
const isOpen = value.includes(itemValue)
|
|
155
|
+
const isDisabled = accordionDisabled || itemDisabled
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<View className="flex">
|
|
159
|
+
<View
|
|
160
|
+
data-slot="accordion-trigger"
|
|
161
|
+
aria-expanded={isOpen}
|
|
162
|
+
aria-disabled={isDisabled}
|
|
163
|
+
className={cn(
|
|
164
|
+
"group/accordion-trigger relative flex flex-1 items-start justify-between rounded-lg border border-transparent py-2.5 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:after:border-ring aria-disabled:pointer-events-none aria-disabled:opacity-50",
|
|
165
|
+
className
|
|
166
|
+
)}
|
|
167
|
+
onClick={() => { if (!isDisabled) toggle(itemValue) }}
|
|
168
|
+
{...props}
|
|
169
|
+
>
|
|
170
|
+
{children}
|
|
171
|
+
{isOpen ? (
|
|
172
|
+
<ChevronUp
|
|
173
|
+
data-slot="accordion-trigger-icon"
|
|
174
|
+
className="pointer-events-none ml-auto size-4 shrink-0 text-muted-foreground"
|
|
175
|
+
/>
|
|
176
|
+
) : (
|
|
177
|
+
<ChevronDown
|
|
178
|
+
data-slot="accordion-trigger-icon"
|
|
179
|
+
className="pointer-events-none ml-auto size-4 shrink-0 text-muted-foreground"
|
|
180
|
+
/>
|
|
181
|
+
)}
|
|
182
|
+
</View>
|
|
183
|
+
</View>
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @desc 手风琴折叠面板内容容器。
|
|
189
|
+
* @param {Parameters<typeof AccordionContent>[0]} props 组件属性;自有字段的用途及默认行为见下表,继承属性另列。
|
|
190
|
+
* @return {ReturnType<typeof AccordionContent>} 组件渲染结果;类型见返回值契约。
|
|
191
|
+
* @example
|
|
192
|
+
* ```tsx
|
|
193
|
+
* import { Accordion, AccordionItem, AccordionContent } from '@open-dy/vibecoding-sdk-taro/ui/accordion'
|
|
194
|
+
* <Accordion><AccordionItem value="details"><AccordionContent /></AccordionItem></Accordion>
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
197
|
+
function AccordionContent({
|
|
198
|
+
className,
|
|
199
|
+
children,
|
|
200
|
+
...props
|
|
201
|
+
}: ViewProps) {
|
|
202
|
+
const { value } = React.useContext(AccordionContext)
|
|
203
|
+
const { value: itemValue } = React.useContext(AccordionItemContext)
|
|
204
|
+
const isOpen = value.includes(itemValue)
|
|
205
|
+
|
|
206
|
+
if (!isOpen) return null
|
|
207
|
+
|
|
208
|
+
return (
|
|
209
|
+
<View
|
|
210
|
+
data-slot="accordion-content"
|
|
211
|
+
className="overflow-hidden text-sm"
|
|
212
|
+
{...props}
|
|
213
|
+
>
|
|
214
|
+
<View
|
|
215
|
+
className={cn(
|
|
216
|
+
"pt-0 pb-2.5 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",
|
|
217
|
+
className
|
|
218
|
+
)}
|
|
219
|
+
>
|
|
220
|
+
{children}
|
|
221
|
+
</View>
|
|
222
|
+
</View>
|
|
223
|
+
)
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
|