@lotte-innovate/ui-component-test 0.1.91 → 0.1.93
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/globals.css +2 -2
- package/dist/lib/Typography/Header/index.mjs +1 -1
- package/dist/lib/Typography/Header/index.mjs.map +1 -1
- package/dist/lib/Typography/Text/index.mjs +1 -1
- package/dist/lib/Typography/Text/index.mjs.map +1 -1
- package/dist/lib/components/Accordion/index.mjs +1 -1
- package/dist/lib/components/Accordion/index.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogAction.mjs +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogAction.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogCancel.mjs +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogCancel.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogContent.mjs +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogContent.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogDescription.mjs +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogDescription.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogRoot.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogTitle.mjs +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogTitle.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.mjs +1 -1
- package/dist/lib/components/AlertDialog/AlertDialogTrigger.mjs.map +1 -1
- package/dist/lib/components/AlertDialog/index.d.ts +0 -1
- package/dist/lib/components/AspectRatio/index.mjs +1 -1
- package/dist/lib/components/AspectRatio/index.mjs.map +1 -1
- package/dist/lib/components/Avatar/index.mjs +1 -1
- package/dist/lib/components/Avatar/index.mjs.map +1 -1
- package/dist/lib/components/Badge/index.mjs +1 -1
- package/dist/lib/components/Badge/index.mjs.map +1 -1
- package/dist/lib/components/BarChart/index.mjs +1 -1
- package/dist/lib/components/BarChart/index.mjs.map +1 -1
- package/dist/lib/components/BubbleChart/index.mjs +1 -1
- package/dist/lib/components/BubbleChart/index.mjs.map +1 -1
- package/dist/lib/components/Button/index.mjs +1 -1
- package/dist/lib/components/Button/index.mjs.map +1 -1
- package/dist/lib/components/Callout/CalloutIcon.mjs +1 -1
- package/dist/lib/components/Callout/CalloutIcon.mjs.map +1 -1
- package/dist/lib/components/Callout/CalloutRoot.mjs +1 -1
- package/dist/lib/components/Callout/CalloutRoot.mjs.map +1 -1
- package/dist/lib/components/Callout/CalloutText.mjs +1 -1
- package/dist/lib/components/Callout/CalloutText.mjs.map +1 -1
- package/dist/lib/components/Callout/index.d.ts +0 -1
- package/dist/lib/components/Card/index.mjs +1 -1
- package/dist/lib/components/Card/index.mjs.map +1 -1
- package/dist/lib/components/Checkbox/index.mjs +1 -1
- package/dist/lib/components/Checkbox/index.mjs.map +1 -1
- package/dist/lib/components/CheckboxCard/index.mjs +1 -1
- package/dist/lib/components/CheckboxCard/index.mjs.map +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.mjs +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupItem.mjs.map +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs +1 -1
- package/dist/lib/components/CheckboxGroup/CheckboxGroupRoot.mjs.map +1 -1
- package/dist/lib/components/CheckboxGroup/index.d.ts +1 -2
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuCheckboxItem.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuContent.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuContent.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuGroup.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuGroup.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItem.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItem.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuItemIndicator.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuLabel.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuLabel.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioGroup.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRadioItem.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuRoot.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSeparator.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubContent.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuSubTrigger.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.mjs +1 -1
- package/dist/lib/components/ContextMenu/ContextMenuTrigger.mjs.map +1 -1
- package/dist/lib/components/ContextMenu/index.d.ts +0 -1
- package/dist/lib/components/DataList/DataListItem.mjs +1 -1
- package/dist/lib/components/DataList/DataListItem.mjs.map +1 -1
- package/dist/lib/components/DataList/DataListLabel.mjs +1 -1
- package/dist/lib/components/DataList/DataListLabel.mjs.map +1 -1
- package/dist/lib/components/DataList/DataListRoot.mjs +1 -1
- package/dist/lib/components/DataList/DataListRoot.mjs.map +1 -1
- package/dist/lib/components/DataList/DataListValue.mjs +1 -1
- package/dist/lib/components/DataList/DataListValue.mjs.map +1 -1
- package/dist/lib/components/DataList/index.d.ts +0 -1
- package/dist/lib/components/Dialog/DialogAction.mjs +1 -1
- package/dist/lib/components/Dialog/DialogAction.mjs.map +1 -1
- package/dist/lib/components/Dialog/DialogCancel.mjs +1 -1
- package/dist/lib/components/Dialog/DialogCancel.mjs.map +1 -1
- package/dist/lib/components/Dialog/DialogContent.mjs +1 -1
- package/dist/lib/components/Dialog/DialogContent.mjs.map +1 -1
- package/dist/lib/components/Dialog/DialogDescription.mjs +1 -1
- package/dist/lib/components/Dialog/DialogDescription.mjs.map +1 -1
- package/dist/lib/components/Dialog/DialogRoot.mjs +1 -1
- package/dist/lib/components/Dialog/DialogRoot.mjs.map +1 -1
- package/dist/lib/components/Dialog/DialogSlot.mjs +1 -1
- package/dist/lib/components/Dialog/DialogSlot.mjs.map +1 -1
- package/dist/lib/components/Dialog/DialogTitle.mjs +1 -1
- package/dist/lib/components/Dialog/DialogTitle.mjs.map +1 -1
- package/dist/lib/components/Dialog/DialogTrigger.mjs +1 -1
- package/dist/lib/components/Dialog/DialogTrigger.mjs.map +1 -1
- package/dist/lib/components/Dialog/index.d.ts +1 -2
- package/dist/lib/components/DoughnutChart/index.mjs +1 -1
- package/dist/lib/components/DoughnutChart/index.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdonMenuRadioGroup.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdonMenuSubContent.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuCheckboxItem.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuContent.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItem.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuItemIndicator.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuLable.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRadioItem.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuRoot.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSeparator.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSub.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuSubTrigger.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.mjs +1 -1
- package/dist/lib/components/DropdownMenu/DropdownMenuTrigger.mjs.map +1 -1
- package/dist/lib/components/DropdownMenu/index.d.ts +1 -2
- package/dist/lib/components/HoverCard/HoverCardContent.mjs +1 -1
- package/dist/lib/components/HoverCard/HoverCardContent.mjs.map +1 -1
- package/dist/lib/components/HoverCard/HoverCardRoot.mjs +1 -1
- package/dist/lib/components/HoverCard/HoverCardRoot.mjs.map +1 -1
- package/dist/lib/components/HoverCard/HoverCardTrigger.mjs +1 -1
- package/dist/lib/components/HoverCard/HoverCardTrigger.mjs.map +1 -1
- package/dist/lib/components/HoverCard/index.d.ts +1 -2
- package/dist/lib/components/IconButton/index.mjs +1 -1
- package/dist/lib/components/IconButton/index.mjs.map +1 -1
- package/dist/lib/components/Inset/index.mjs +1 -1
- package/dist/lib/components/Inset/index.mjs.map +1 -1
- package/dist/lib/components/Label/index.mjs +1 -1
- package/dist/lib/components/Label/index.mjs.map +1 -1
- package/dist/lib/components/LineChart/index.mjs +1 -1
- package/dist/lib/components/LineChart/index.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarCheckboxItem.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarCheckboxItem.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarContent.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarContent.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarItem.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarItem.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarItemIndicator.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarItemIndicator.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarMenu.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarMenu.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarRadioGroup.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarRadioGroup.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarRadioItem.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarRadioItem.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarRoot.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarRoot.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarSeparator.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarSeparator.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarSub.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarSub.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarSubContent.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarSubContent.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarSubTrigger.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarSubTrigger.mjs.map +1 -1
- package/dist/lib/components/Menubar/MenubarTrigger.mjs +1 -1
- package/dist/lib/components/Menubar/MenubarTrigger.mjs.map +1 -1
- package/dist/lib/components/Menubar/index.d.ts +0 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuContent.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuIndicator.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuItem.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuLink.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuList.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuList.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuRoot.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuTrigger.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.mjs +1 -1
- package/dist/lib/components/NavigationMenu/NavigationMenuViewport.mjs.map +1 -1
- package/dist/lib/components/NavigationMenu/index.d.ts +0 -1
- package/dist/lib/components/PieChart/index.mjs +1 -1
- package/dist/lib/components/PieChart/index.mjs.map +1 -1
- package/dist/lib/components/Popover/PopoverClose.mjs +1 -1
- package/dist/lib/components/Popover/PopoverClose.mjs.map +1 -1
- package/dist/lib/components/Popover/PopoverContent.mjs +1 -1
- package/dist/lib/components/Popover/PopoverContent.mjs.map +1 -1
- package/dist/lib/components/Popover/PopoverRoot.mjs +1 -1
- package/dist/lib/components/Popover/PopoverRoot.mjs.map +1 -1
- package/dist/lib/components/Popover/PopoverTrigger.mjs +1 -1
- package/dist/lib/components/Popover/PopoverTrigger.mjs.map +1 -1
- package/dist/lib/components/Popover/index.d.ts +1 -2
- package/dist/lib/components/Progress/index.mjs +1 -1
- package/dist/lib/components/Progress/index.mjs.map +1 -1
- package/dist/lib/components/RadarChart/index.mjs +1 -1
- package/dist/lib/components/RadarChart/index.mjs.map +1 -1
- package/dist/lib/components/Radio/index.mjs +1 -1
- package/dist/lib/components/Radio/index.mjs.map +1 -1
- package/dist/lib/components/RadioCards/RadioCardsItem.mjs +1 -1
- package/dist/lib/components/RadioCards/RadioCardsItem.mjs.map +1 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.mjs +1 -1
- package/dist/lib/components/RadioCards/RadioCardsRoot.mjs.map +1 -1
- package/dist/lib/components/RadioCards/index.d.ts +0 -1
- package/dist/lib/components/RadioGroup/RadioGroupItem.mjs +1 -1
- package/dist/lib/components/RadioGroup/RadioGroupItem.mjs.map +1 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs +1 -1
- package/dist/lib/components/RadioGroup/RadioGroupRoot.mjs.map +1 -1
- package/dist/lib/components/RadioGroup/index.d.ts +0 -1
- package/dist/lib/components/ScrollArea/index.mjs +1 -1
- package/dist/lib/components/ScrollArea/index.mjs.map +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.mjs +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlItem.mjs.map +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs +1 -1
- package/dist/lib/components/SegmentedControl/SegmentedControlRoot.mjs.map +1 -1
- package/dist/lib/components/SegmentedControl/index.d.ts +1 -2
- package/dist/lib/components/Select/index.mjs +1 -1
- package/dist/lib/components/Select/index.mjs.map +1 -1
- package/dist/lib/components/Separator/index.mjs +1 -1
- package/dist/lib/components/Separator/index.mjs.map +1 -1
- package/dist/lib/components/Skeleton/index.mjs +1 -1
- package/dist/lib/components/Skeleton/index.mjs.map +1 -1
- package/dist/lib/components/Slider/index.mjs +1 -1
- package/dist/lib/components/Slider/index.mjs.map +1 -1
- package/dist/lib/components/Spinner/index.mjs +1 -1
- package/dist/lib/components/Spinner/index.mjs.map +1 -1
- package/dist/lib/components/TabNav/index.mjs +1 -1
- package/dist/lib/components/TabNav/index.mjs.map +1 -1
- package/dist/lib/components/Table/index.mjs +1 -1
- package/dist/lib/components/Table/index.mjs.map +1 -1
- package/dist/lib/components/Tabs/index.mjs +1 -1
- package/dist/lib/components/Tabs/index.mjs.map +1 -1
- package/dist/lib/components/TextArea/index.mjs +1 -1
- package/dist/lib/components/TextArea/index.mjs.map +1 -1
- package/dist/lib/components/TextField/index.mjs +1 -1
- package/dist/lib/components/TextField/index.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastActionButton.mjs +1 -1
- package/dist/lib/components/Toast/ToastActionButton.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastDescription.mjs +1 -1
- package/dist/lib/components/Toast/ToastDescription.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastRoot.mjs +1 -1
- package/dist/lib/components/Toast/ToastRoot.mjs.map +1 -1
- package/dist/lib/components/Toast/ToastTitle.mjs +1 -1
- package/dist/lib/components/Toast/ToastTitle.mjs.map +1 -1
- package/dist/lib/components/Toast/index.d.ts +0 -1
- package/dist/lib/components/Toggle/ToggleWithText.mjs +1 -1
- package/dist/lib/components/Toggle/ToggleWithText.mjs.map +1 -1
- package/dist/lib/components/Toggle/index.mjs +1 -1
- package/dist/lib/components/Toggle/index.mjs.map +1 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupItem.mjs +1 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupItem.mjs.map +1 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs +1 -1
- package/dist/lib/components/ToggleGroup/ToggleGroupRoot.mjs.map +1 -1
- package/dist/lib/components/ToggleGroup/index.d.ts +0 -1
- package/dist/lib/components/ToggleSwitch/index.mjs +1 -1
- package/dist/lib/components/ToggleSwitch/index.mjs.map +1 -1
- package/dist/lib/components/Tooltip/index.mjs +1 -1
- package/dist/lib/components/Tooltip/index.mjs.map +1 -1
- package/dist/lib/constants.d.ts +2 -2
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dialog/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-portal/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-presence/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-presence/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-aspect-ratio/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-avatar/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-checkbox/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-collapsible/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-collection/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-collection/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-context-menu/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-menu/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-menu/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-portal/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-presence/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-context-menu/node_modules/@radix-ui/react-presence/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-direction/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-direction/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-label/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-label/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-menu/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-menu/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-menubar/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-popper/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-portal/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-presence/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-progress/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-progress/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-roving-focus/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-presence/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-presence/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-toast/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-toast/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-toggle/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/react-toggle-group/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/checkbox-group.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/checkbox-group.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/checkbox-group.primitive.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/checkbox-group.primitive.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/dialog.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/dialog.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/grid.props.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/grid.props.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/hover-card.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/hover-card.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/icons.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/icons.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/popover.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/popover.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/radio-cards.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/radio-cards.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/radio-group.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/radio-group.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/select.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/select.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/slider.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/slider.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/switch.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/switch.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/tab-nav.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/tab-nav.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/tabs.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/tabs.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/theme.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/components/theme.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/helpers/get-responsive-styles.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/helpers/get-responsive-styles.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/props/layout.props.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/dist/esm/props/layout.props.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-checkbox/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-checkbox/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-context/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-context/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-dialog/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-dialog/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-focus-guards/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-hover-card/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-hover-card/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-navigation-menu/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-popover/dist/index.mjs +1 -1
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-popover/dist/index.mjs.map +1 -1
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-portal/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-presence/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-presence/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-radio-group/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-radio-group/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-select/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-select/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-slider/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-slider/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-switch/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-switch/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-tabs/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-tabs/dist/index.mjs.map +1 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-tooltip/dist/index.mjs +2 -0
- package/dist/node_modules/@radix-ui/themes/node_modules/@radix-ui/react-tooltip/dist/index.mjs.map +1 -0
- package/dist/node_modules/chart.js/dist/chart.mjs +3 -3
- package/dist/node_modules/chart.js/dist/chart.mjs.map +1 -1
- package/dist/node_modules/chart.js/dist/chunks/helpers.segment.mjs +3 -3
- package/dist/node_modules/chart.js/dist/chunks/helpers.segment.mjs.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -1
- package/dist/_virtual/jsx-runtime.mjs +0 -2
- package/dist/_virtual/jsx-runtime.mjs.map +0 -1
- package/dist/_virtual/jsx-runtime2.mjs +0 -2
- package/dist/_virtual/jsx-runtime2.mjs.map +0 -1
- package/dist/_virtual/react-jsx-runtime.development.mjs +0 -2
- package/dist/_virtual/react-jsx-runtime.development.mjs.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.min.mjs +0 -2
- package/dist/_virtual/react-jsx-runtime.production.min.mjs.map +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +0 -2
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.map +0 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +0 -2
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.map +0 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs +0 -2
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs.map +0 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +0 -2
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs.map +0 -1
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +0 -2
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.map +0 -1
- package/dist/node_modules/@kurkle/color/dist/color.esm.mjs +0 -8
- package/dist/node_modules/@kurkle/color/dist/color.esm.mjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.mjs +0 -2
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.mjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.mjs +0 -2
- package/dist/node_modules/@radix-ui/react-hover-card/dist/index.mjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.mjs +0 -2
- package/dist/node_modules/@radix-ui/react-radio-group/dist/index.mjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-select/dist/index.mjs +0 -2
- package/dist/node_modules/@radix-ui/react-select/dist/index.mjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-slider/dist/index.mjs +0 -2
- package/dist/node_modules/@radix-ui/react-slider/dist/index.mjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-switch/dist/index.mjs +0 -2
- package/dist/node_modules/@radix-ui/react-switch/dist/index.mjs.map +0 -1
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.mjs +0 -2
- package/dist/node_modules/@radix-ui/react-tabs/dist/index.mjs.map +0 -1
- package/dist/node_modules/chart.js/auto/auto.mjs +0 -2
- package/dist/node_modules/chart.js/auto/auto.mjs.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.mjs +0 -11
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.mjs.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.mjs +0 -11
- package/dist/node_modules/react/cjs/react-jsx-runtime.production.min.mjs.map +0 -1
- package/dist/node_modules/react/jsx-runtime.mjs +0 -2
- package/dist/node_modules/react/jsx-runtime.mjs.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/popper/src/Popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: \"referenceHidden\", ...detectOverflowOptions })\n ]\n });\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n [\"--radix-popper-transform-origin\"]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["POPPER_NAME","createPopperContext","createPopperScope","createContextScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","React","useState","jsx","scope","onAnchorChange","displayName","ANCHOR_NAME","PopperAnchor","forwardRef","forwardedRef","virtualRef","anchorProps","context","ref","useRef","composedRefs","useComposedRefs","useEffect","current","Primitive","div","CONTENT_NAME","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","collisionPaddingProp","sticky","hideWhenDetached","updatePositionStrategy","onPlaced","contentProps","content","setContent","node","arrow","setArrow","arrowSize","useSize","arrowWidth","width","arrowHeight","height","desiredPlacement","top","right","bottom","left","boundary","Array","isArray","hasExplicitBoundaries","length","detectOverflowOptions","padding","filter","isNotNull","altBoundary","refs","floatingStyles","placement","isPositioned","middlewareData","useFloating","strategy","whileElementsMounted","args","autoUpdate","animationFrame","elements","reference","middleware","offset","mainAxis","alignmentAxis","shift","crossAxis","limiter","limitShift","flip","size","apply","rects","availableWidth","availableHeight","anchorWidth","anchorHeight","contentStyle","floating","style","setProperty","floatingUIarrow","element","transformOrigin","hide","placedSide","placedAlign","getSideAndAlignFromPlacement","handlePlaced","useCallbackRef","useLayoutEffect","arrowX","x","arrowY","y","cannotCenterArrow","centerOffset","contentZIndex","setContentZIndex","window","getComputedStyle","zIndex","setFloating","transform","minWidth","join","referenceHidden","visibility","pointerEvents","dir","onArrowChange","shouldHideArrow","animation","ARROW_NAME","OPPOSITE_SIDE","PopperArrow","arrowProps","contentContext","baseSide","position","ArrowPrimitive.Root","display","value","options","name","fn","data","isArrowHidden","noArrowAlign","start","center","end","arrowXCenter","arrowYCenter","split","Root2","Anchor","Content","Arrow"],"mappings":"q3BAyBA,IAAIA,EAAc,UACbC,EAAqBC,GAAqBC,EAAmBH,IAC7DI,EAAgBC,GAAoBJ,EAAoBD,GACzDM,EAAUC,IACZ,MAAMC,cAAEA,EAAaC,SAAEA,GAAaF,GAC7BG,EAAQC,GAAaC,EAAMC,SAAS,MAC3C,OAAuBC,EAAGA,IAACV,EAAgB,CAAEW,MAAOP,EAAeE,SAAQM,eAAgBL,EAAWF,YAAW,EAEnHH,EAAOW,YAAcjB,EACrB,IAAIkB,EAAc,eACdC,EAAeP,EAAMQ,YACvB,CAACb,EAAOc,KACN,MAAMb,cAAEA,EAAac,WAAEA,KAAeC,GAAgBhB,EAChDiB,EAAUnB,EAAiBa,EAAaV,GACxCiB,EAAMb,EAAMc,OAAO,MACnBC,EAAeC,EAAgBP,EAAcI,GAInD,OAHAb,EA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BwC,IAAa,CAClCC,KAAM,kBACND,UACA,EAAAE,CAAGC,GACD,MAAM5E,UAAEA,EAASsB,MAAEA,EAAKpB,eAAEA,GAAmB0E,EAEvCC,EAD2D,IAAvC3E,EAAe3B,OAAOuE,aAE1CnE,EAAakG,EAAgB,EAAIJ,EAAQ9F,WACzCE,EAAcgG,EAAgB,EAAIJ,EAAQ5F,aACzCsD,EAAYC,GAAeC,EAA6BrC,GACzD8E,EAAe,CAAEC,MAAO,KAAMC,OAAQ,MAAOC,IAAK,QAAS7C,GAC3D8C,GAAgBhF,EAAe3B,OAAOmE,GAAK,GAAK/D,EAAa,EAC7DwG,GAAgBjF,EAAe3B,OAAOqE,GAAK,GAAK/D,EAAc,EACpE,IAAI6D,EAAI,GACJE,EAAI,GAcR,MAbmB,WAAfT,GACFO,EAAImC,EAAgBC,EAAe,GAAGI,MACtCtC,GAAQ/D,EAAJ,MACoB,QAAfsD,GACTO,EAAImC,EAAgBC,EAAe,GAAGI,MACtCtC,EAAI,GAAGtB,EAAMM,SAAS9C,OAASD,OACP,UAAfsD,GACTO,GAAQ7D,EAAJ,KACJ+D,EAAIiC,EAAgBC,EAAe,GAAGK,OACd,SAAfhD,IACTO,EAAI,GAAGpB,EAAMM,SAAShD,MAAQC,MAC9B+D,EAAIiC,EAAgBC,EAAe,GAAGK,OAEjC,CAAEP,KAAM,CAAElC,IAAGE,KACrB,IAEH,SAASP,EAA6BrC,GACpC,MAAO1C,EAAME,EAAQ,UAAYwC,EAAUoF,MAAM,KACjD,MAAO,CAAC9H,EAAME,EAChB,CACG,IAAC6H,EAAQ9J,EACR+J,EAASlJ,EACTmJ,EAAUlI,EACVmI,EAAQvB"}
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-popper/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/popper/src/Popper.tsx\nimport * as React from \"react\";\nimport {\n useFloating,\n autoUpdate,\n offset,\n shift,\n limitShift,\n hide,\n arrow as floatingUIarrow,\n flip,\n size\n} from \"@floating-ui/react-dom\";\nimport * as ArrowPrimitive from \"@radix-ui/react-arrow\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { useSize } from \"@radix-ui/react-use-size\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SIDE_OPTIONS = [\"top\", \"right\", \"bottom\", \"left\"];\nvar ALIGN_OPTIONS = [\"start\", \"center\", \"end\"];\nvar POPPER_NAME = \"Popper\";\nvar [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);\nvar [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);\nvar Popper = (props) => {\n const { __scopePopper, children } = props;\n const [anchor, setAnchor] = React.useState(null);\n return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });\n};\nPopper.displayName = POPPER_NAME;\nvar ANCHOR_NAME = \"PopperAnchor\";\nvar PopperAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopePopper, virtualRef, ...anchorProps } = props;\n const context = usePopperContext(ANCHOR_NAME, __scopePopper);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n context.onAnchorChange(virtualRef?.current || ref.current);\n });\n return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });\n }\n);\nPopperAnchor.displayName = ANCHOR_NAME;\nvar CONTENT_NAME = \"PopperContent\";\nvar [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);\nvar PopperContent = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopePopper,\n side = \"bottom\",\n sideOffset = 0,\n align = \"center\",\n alignOffset = 0,\n arrowPadding = 0,\n avoidCollisions = true,\n collisionBoundary = [],\n collisionPadding: collisionPaddingProp = 0,\n sticky = \"partial\",\n hideWhenDetached = false,\n updatePositionStrategy = \"optimized\",\n onPlaced,\n ...contentProps\n } = props;\n const context = usePopperContext(CONTENT_NAME, __scopePopper);\n const [content, setContent] = React.useState(null);\n const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));\n const [arrow, setArrow] = React.useState(null);\n const arrowSize = useSize(arrow);\n const arrowWidth = arrowSize?.width ?? 0;\n const arrowHeight = arrowSize?.height ?? 0;\n const desiredPlacement = side + (align !== \"center\" ? \"-\" + align : \"\");\n const collisionPadding = typeof collisionPaddingProp === \"number\" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };\n const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];\n const hasExplicitBoundaries = boundary.length > 0;\n const detectOverflowOptions = {\n padding: collisionPadding,\n boundary: boundary.filter(isNotNull),\n // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries\n altBoundary: hasExplicitBoundaries\n };\n const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({\n // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues\n strategy: \"fixed\",\n placement: desiredPlacement,\n whileElementsMounted: (...args) => {\n const cleanup = autoUpdate(...args, {\n animationFrame: updatePositionStrategy === \"always\"\n });\n return cleanup;\n },\n elements: {\n reference: context.anchor\n },\n middleware: [\n offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),\n avoidCollisions && shift({\n mainAxis: true,\n crossAxis: false,\n limiter: sticky === \"partial\" ? limitShift() : void 0,\n ...detectOverflowOptions\n }),\n avoidCollisions && flip({ ...detectOverflowOptions }),\n size({\n ...detectOverflowOptions,\n apply: ({ elements, rects, availableWidth, availableHeight }) => {\n const { width: anchorWidth, height: anchorHeight } = rects.reference;\n const contentStyle = elements.floating.style;\n contentStyle.setProperty(\"--radix-popper-available-width\", `${availableWidth}px`);\n contentStyle.setProperty(\"--radix-popper-available-height\", `${availableHeight}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-width\", `${anchorWidth}px`);\n contentStyle.setProperty(\"--radix-popper-anchor-height\", `${anchorHeight}px`);\n }\n }),\n arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),\n transformOrigin({ arrowWidth, arrowHeight }),\n hideWhenDetached && hide({ strategy: \"referenceHidden\", ...detectOverflowOptions })\n ]\n });\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const handlePlaced = useCallbackRef(onPlaced);\n useLayoutEffect(() => {\n if (isPositioned) {\n handlePlaced?.();\n }\n }, [isPositioned, handlePlaced]);\n const arrowX = middlewareData.arrow?.x;\n const arrowY = middlewareData.arrow?.y;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const [contentZIndex, setContentZIndex] = React.useState();\n useLayoutEffect(() => {\n if (content) setContentZIndex(window.getComputedStyle(content).zIndex);\n }, [content]);\n return /* @__PURE__ */ jsx(\n \"div\",\n {\n ref: refs.setFloating,\n \"data-radix-popper-content-wrapper\": \"\",\n style: {\n ...floatingStyles,\n transform: isPositioned ? floatingStyles.transform : \"translate(0, -200%)\",\n // keep off the page when measuring\n minWidth: \"max-content\",\n zIndex: contentZIndex,\n [\"--radix-popper-transform-origin\"]: [\n middlewareData.transformOrigin?.x,\n middlewareData.transformOrigin?.y\n ].join(\" \"),\n // hide the content if using the hide middleware and should be hidden\n // set visibility to hidden and disable pointer events so the UI behaves\n // as if the PopperContent isn't there at all\n ...middlewareData.hide?.referenceHidden && {\n visibility: \"hidden\",\n pointerEvents: \"none\"\n }\n },\n dir: props.dir,\n children: /* @__PURE__ */ jsx(\n PopperContentProvider,\n {\n scope: __scopePopper,\n placedSide,\n onArrowChange: setArrow,\n arrowX,\n arrowY,\n shouldHideArrow: cannotCenterArrow,\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-side\": placedSide,\n \"data-align\": placedAlign,\n ...contentProps,\n ref: composedRefs,\n style: {\n ...contentProps.style,\n // if the PopperContent hasn't been placed yet (not all measurements done)\n // we prevent animations so that users's animation don't kick in too early referring wrong sides\n animation: !isPositioned ? \"none\" : void 0\n }\n }\n )\n }\n )\n }\n );\n }\n);\nPopperContent.displayName = CONTENT_NAME;\nvar ARROW_NAME = \"PopperArrow\";\nvar OPPOSITE_SIDE = {\n top: \"bottom\",\n right: \"left\",\n bottom: \"top\",\n left: \"right\"\n};\nvar PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {\n const { __scopePopper, ...arrowProps } = props;\n const contentContext = useContentContext(ARROW_NAME, __scopePopper);\n const baseSide = OPPOSITE_SIDE[contentContext.placedSide];\n return (\n // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)\n // doesn't report size as we'd expect on SVG elements.\n // it reports their bounding box which is effectively the largest path inside the SVG.\n /* @__PURE__ */ jsx(\n \"span\",\n {\n ref: contentContext.onArrowChange,\n style: {\n position: \"absolute\",\n left: contentContext.arrowX,\n top: contentContext.arrowY,\n [baseSide]: 0,\n transformOrigin: {\n top: \"\",\n right: \"0 0\",\n bottom: \"center 0\",\n left: \"100% 0\"\n }[contentContext.placedSide],\n transform: {\n top: \"translateY(100%)\",\n right: \"translateY(50%) rotate(90deg) translateX(-50%)\",\n bottom: `rotate(180deg)`,\n left: \"translateY(50%) rotate(-90deg) translateX(50%)\"\n }[contentContext.placedSide],\n visibility: contentContext.shouldHideArrow ? \"hidden\" : void 0\n },\n children: /* @__PURE__ */ jsx(\n ArrowPrimitive.Root,\n {\n ...arrowProps,\n ref: forwardedRef,\n style: {\n ...arrowProps.style,\n // ensures the element can be measured correctly (mostly for if SVG)\n display: \"block\"\n }\n }\n )\n }\n )\n );\n});\nPopperArrow.displayName = ARROW_NAME;\nfunction isNotNull(value) {\n return value !== null;\n}\nvar transformOrigin = (options) => ({\n name: \"transformOrigin\",\n options,\n fn(data) {\n const { placement, rects, middlewareData } = data;\n const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;\n const isArrowHidden = cannotCenterArrow;\n const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;\n const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;\n const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);\n const noArrowAlign = { start: \"0%\", center: \"50%\", end: \"100%\" }[placedAlign];\n const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;\n const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;\n let x = \"\";\n let y = \"\";\n if (placedSide === \"bottom\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${-arrowHeight}px`;\n } else if (placedSide === \"top\") {\n x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;\n y = `${rects.floating.height + arrowHeight}px`;\n } else if (placedSide === \"right\") {\n x = `${-arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n } else if (placedSide === \"left\") {\n x = `${rects.floating.width + arrowHeight}px`;\n y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;\n }\n return { data: { x, y } };\n }\n});\nfunction getSideAndAlignFromPlacement(placement) {\n const [side, align = \"center\"] = placement.split(\"-\");\n return [side, align];\n}\nvar Root2 = Popper;\nvar Anchor = PopperAnchor;\nvar Content = PopperContent;\nvar Arrow = PopperArrow;\nexport {\n ALIGN_OPTIONS,\n Anchor,\n Arrow,\n Content,\n Popper,\n PopperAnchor,\n PopperArrow,\n PopperContent,\n Root2 as Root,\n SIDE_OPTIONS,\n createPopperScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["POPPER_NAME","createPopperContext","createPopperScope","createContextScope","PopperProvider","usePopperContext","Popper","props","__scopePopper","children","anchor","setAnchor","React","useState","jsx","scope","onAnchorChange","displayName","ANCHOR_NAME","PopperAnchor","forwardRef","forwardedRef","virtualRef","anchorProps","context","ref","useRef","composedRefs","useComposedRefs","useEffect","current","Primitive","div","CONTENT_NAME","PopperContentProvider","useContentContext","PopperContent","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","collisionPaddingProp","sticky","hideWhenDetached","updatePositionStrategy","onPlaced","contentProps","content","setContent","node","arrow","setArrow","arrowSize","useSize","arrowWidth","width","arrowHeight","height","desiredPlacement","top","right","bottom","left","boundary","Array","isArray","hasExplicitBoundaries","length","detectOverflowOptions","padding","filter","isNotNull","altBoundary","refs","floatingStyles","placement","isPositioned","middlewareData","useFloating","strategy","whileElementsMounted","args","autoUpdate","animationFrame","elements","reference","middleware","offset","mainAxis","alignmentAxis","shift","crossAxis","limiter","limitShift","flip","size","apply","rects","availableWidth","availableHeight","anchorWidth","anchorHeight","contentStyle","floating","style","setProperty","floatingUIarrow","element","transformOrigin","hide","placedSide","placedAlign","getSideAndAlignFromPlacement","handlePlaced","useCallbackRef","useLayoutEffect","arrowX","x","arrowY","y","cannotCenterArrow","centerOffset","contentZIndex","setContentZIndex","window","getComputedStyle","zIndex","setFloating","transform","minWidth","join","referenceHidden","visibility","pointerEvents","dir","onArrowChange","shouldHideArrow","animation","ARROW_NAME","OPPOSITE_SIDE","PopperArrow","arrowProps","contentContext","baseSide","position","ArrowPrimitive.Root","display","value","options","name","fn","data","isArrowHidden","noArrowAlign","start","center","end","arrowXCenter","arrowYCenter","split","Root2","Anchor","Content","Arrow"],"mappings":"8sBAyBA,IAAIA,EAAc,UACbC,EAAqBC,GAAqBC,EAAmBH,IAC7DI,EAAgBC,GAAoBJ,EAAoBD,GACzDM,EAAUC,IACZ,MAAMC,cAAEA,EAAaC,SAAEA,GAAaF,GAC7BG,EAAQC,GAAaC,EAAMC,SAAS,MAC3C,OAAuBC,EAAIV,EAAgB,CAAEW,MAAOP,EAAeE,SAAQM,eAAgBL,EAAWF,YAAW,EAEnHH,EAAOW,YAAcjB,EACrB,IAAIkB,EAAc,eACdC,EAAeP,EAAMQ,YACvB,CAACb,EAAOc,KACN,MAAMb,cAAEA,EAAac,WAAEA,KAAeC,GAAgBhB,EAChDiB,EA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CACT,CAHAP,EAAY/H,YAAc6H,EAI1B,IAAI9B,EAAmBwC,IAAa,CAClCC,KAAM,kBACND,UACA,EAAAE,CAAGC,GACD,MAAM5E,UAAEA,EAASsB,MAAEA,EAAKpB,eAAEA,GAAmB0E,EAEvCC,EAD2D,IAAvC3E,EAAe3B,OAAOuE,aAE1CnE,EAAakG,EAAgB,EAAIJ,EAAQ9F,WACzCE,EAAcgG,EAAgB,EAAIJ,EAAQ5F,aACzCsD,EAAYC,GAAeC,EAA6BrC,GACzD8E,EAAe,CAAEC,MAAO,KAAMC,OAAQ,MAAOC,IAAK,QAAS7C,GAC3D8C,GAAgBhF,EAAe3B,OAAOmE,GAAK,GAAK/D,EAAa,EAC7DwG,GAAgBjF,EAAe3B,OAAOqE,GAAK,GAAK/D,EAAc,EACpE,IAAI6D,EAAI,GACJE,EAAI,GAcR,MAbmB,WAAfT,GACFO,EAAImC,EAAgBC,EAAe,GAAGI,MACtCtC,GAAQ/D,EAAJ,MACoB,QAAfsD,GACTO,EAAImC,EAAgBC,EAAe,GAAGI,MACtCtC,EAAI,GAAGtB,EAAMM,SAAS9C,OAASD,OACP,UAAfsD,GACTO,GAAQ7D,EAAJ,KACJ+D,EAAIiC,EAAgBC,EAAe,GAAGK,OACd,SAAfhD,IACTO,EAAI,GAAGpB,EAAMM,SAAShD,MAAQC,MAC9B+D,EAAIiC,EAAgBC,EAAe,GAAGK,OAEjC,CAAEP,KAAM,CAAElC,IAAGE,KACrB,IAEH,SAASP,EAA6BrC,GACpC,MAAO1C,EAAME,EAAQ,UAAYwC,EAAUoF,MAAM,KACjD,MAAO,CAAC9H,EAAME,EAChB,CACG,IAAC6H,EAAQ9J,EACR+J,EAASlJ,EACTmJ,EAAUlI,EACVmI,EAAQvB"}
|
package/dist/node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-context/dist/index.mjs
ADDED
@@ -0,0 +1,2 @@
|
|
1
|
+
import*as e from"react";import{jsx as t}from"react/jsx-runtime";function o(o,r=[]){let c=[];const s=()=>{const t=c.map((t=>e.createContext(t)));return function(n){const r=n?.[o]||t;return e.useMemo((()=>({[`__scope${o}`]:{...n,[o]:r}})),[n,r])}};return s.scopeName=o,[function(n,r){const s=e.createContext(r),u=c.length;function i(n){const{scope:r,children:c,...i}=n,m=r?.[o][u]||s,p=e.useMemo((()=>i),Object.values(i));return t(m.Provider,{value:p,children:c})}return c=[...c,r],i.displayName=n+"Provider",[i,function(t,c){const i=c?.[o][u]||s,m=e.useContext(i);if(m)return m;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},n(s,...r)]}function n(...t){const o=t[0];if(1===t.length)return o;const n=()=>{const n=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const r=n.reduce(((e,{useScope:o,scopeName:n})=>({...e,...o(t)[`__scope${n}`]})),{});return e.useMemo((()=>({[`__scope${o.scopeName}`]:r})),[r])}};return n.scopeName=o.scopeName,n}export{o as createContextScope};
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../../../node_modules/@radix-ui/react-popper/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/createContext.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n function Provider(props) {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n function Provider(props) {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName][index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName][index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createContextScope","scopeName","createContextScopeDeps","defaultContexts","createScope","scopeContexts","map","defaultContext","React","createContext","scope","contexts","useMemo","rootComponentName","BaseContext","index","length","Provider","props","children","context","Context","value","Object","values","jsx","displayName","consumerName","useContext","Error","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","useScope","overrideScopes","nextScopes","reduce","nextScopes2"],"mappings":"gEAmBA,SAASA,EAAmBC,EAAWC,EAAyB,IAC9D,IAAIC,EAAkB,GAqBtB,MAAMC,EAAc,KAClB,MAAMC,EAAgBF,EAAgBG,KAAKC,GAClCC,EAAMC,cAAcF,KAE7B,OAAO,SAAkBG,GACvB,MAAMC,EAAWD,IAAQT,IAAcI,EACvC,OAAOG,EAAMI,SACX,KAAA,CAAS,CAAC,UAAUX,KAAc,IAAKS,EAAOT,CAACA,GAAYU,MAC3D,CAACD,EAAOC,GAEhB,CAAK,EAGH,OADAP,EAAYH,UAAYA,EACjB,CAjCP,SAAwBY,EAAmBN,GACzC,MAAMO,EAAcN,EAAMC,cAAcF,GAClCQ,EAAQZ,EAAgBa,OAE9B,SAASC,EAASC,GAChB,MAAMR,MAAEA,EAAKS,SAAEA,KAAaC,GAAYF,EAClCG,EAAUX,IAAQT,GAAWc,IAAUD,EACvCQ,EAAQd,EAAMI,SAAQ,IAAMQ,GAASG,OAAOC,OAAOJ,IACzD,OAAuBK,EAAIJ,EAAQJ,SAAU,CAAEK,QAAOH,YACvD,CASD,OAfAhB,EAAkB,IAAIA,EAAiBI,GAcvCU,EAASS,YAAcb,EAAoB,WACpC,CAACI,EARR,SAAqBU,EAAcjB,GACjC,MAAMW,EAAUX,IAAQT,GAAWc,IAAUD,EACvCM,EAAUZ,EAAMoB,WAAWP,GACjC,GAAID,EAAS,OAAOA,EACpB,QAAuB,IAAnBb,EAA2B,OAAOA,EACtC,MAAM,IAAIsB,MAAM,KAAKF,6BAAwCd,MAC9D,EAGF,EAcuBiB,EAAqB1B,KAAgBF,GAC/D,CACA,SAAS4B,KAAwBC,GAC/B,MAAMC,EAAYD,EAAO,GACzB,GAAsB,IAAlBA,EAAOf,OAAc,OAAOgB,EAChC,MAAM5B,EAAc,KAClB,MAAM6B,EAAaF,EAAOzB,KAAK4B,IAAkB,CAC/CC,SAAUD,IACVjC,UAAWiC,EAAajC,cAE1B,OAAO,SAA2BmC,GAChC,MAAMC,EAAaJ,EAAWK,QAAO,CAACC,GAAeJ,WAAUlC,gBAGtD,IAAKsC,KAFOJ,EAASC,GACI,UAAUnC,QAEzC,CAAE,GACL,OAAOO,EAAMI,SAAQ,MAAS,CAAC,UAAUoB,EAAU/B,aAAcoC,KAAe,CAACA,GACvF,CAAK,EAGH,OADAjC,EAAYH,UAAY+B,EAAU/B,UAC3BG,CACT"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as t from"react";import r from"react-dom";import{Primitive as e}from"../../react-primitive/dist/index.mjs";import{useLayoutEffect as o}from"../../react-use-layout-effect/dist/index.mjs";import{
|
1
|
+
import*as t from"react";import r from"react-dom";import{Primitive as e}from"../../react-primitive/dist/index.mjs";import{useLayoutEffect as o}from"../../react-use-layout-effect/dist/index.mjs";import{jsx as a}from"react/jsx-runtime";var i=t.forwardRef(((i,m)=>{const{container:s,...c}=i,[f,d]=t.useState(!1);o((()=>d(!0)),[]);const n=s||f&&globalThis?.document?.body;return n?r.createPortal(a(e.div,{...c,ref:m}),n):null}));i.displayName="Portal";export{i as Portal};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/portal/src/Portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Portal","React","forwardRef","props","forwardedRef","container","containerProp","portalProps","mounted","setMounted","useState","useLayoutEffect","globalThis","document","body","ReactDOM","createPortal","jsx","Primitive","div","ref","displayName"],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-portal/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/portal/src/Portal.tsx\nimport * as React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PORTAL_NAME = \"Portal\";\nvar Portal = React.forwardRef((props, forwardedRef) => {\n const { container: containerProp, ...portalProps } = props;\n const [mounted, setMounted] = React.useState(false);\n useLayoutEffect(() => setMounted(true), []);\n const container = containerProp || mounted && globalThis?.document?.body;\n return container ? ReactDOM.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;\n});\nPortal.displayName = PORTAL_NAME;\nvar Root = Portal;\nexport {\n Portal,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Portal","React","forwardRef","props","forwardedRef","container","containerProp","portalProps","mounted","setMounted","useState","useLayoutEffect","globalThis","document","body","ReactDOM","createPortal","jsx","Primitive","div","ref","displayName"],"mappings":"yOAQA,IACIA,EAASC,EAAMC,YAAW,CAACC,EAAOC,KACpC,MAAQC,UAAWC,KAAkBC,GAAgBJ,GAC9CK,EAASC,GAAcR,EAAMS,UAAS,GAC7CC,GAAgB,IAAMF,GAAW,IAAO,IACxC,MAAMJ,EAAYC,GAAiBE,GAAWI,YAAYC,UAAUC,KACpE,OAAOT,EAAYU,EAASC,aAA6BC,EAAIC,EAAUC,IAAK,IAAKZ,EAAaa,IAAKhB,IAAiBC,GAAa,IAAI,IAEvIL,EAAOqB,YARW"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import
|
1
|
+
import*as e from"react";import{useComposedRefs as n}from"../../react-compose-refs/dist/index.mjs";import{useLayoutEffect as t}from"../../react-use-layout-effect/dist/index.mjs";var r=r=>{const{present:i,children:u}=r,s=function(n){const[r,i]=e.useState(),u=e.useRef({}),s=e.useRef(n),a=e.useRef("none"),c=n?"mounted":"unmounted",[m,d]=function(n,t){return e.useReducer(((e,n)=>t[e][n]??e),n)}(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect((()=>{const e=o(u.current);a.current="mounted"===m?e:"none"}),[m]),t((()=>{const e=u.current,t=s.current;if(t!==n){const r=a.current,i=o(e);if(n)d("MOUNT");else if("none"===i||"none"===e?.display)d("UNMOUNT");else{d(t&&r!==i?"ANIMATION_OUT":"UNMOUNT")}s.current=n}}),[n,d]),t((()=>{if(r){let e;const n=r.ownerDocument.defaultView??window,t=t=>{const i=o(u.current).includes(t.animationName);if(t.target===r&&i&&(d("ANIMATION_END"),!s.current)){const t=r.style.animationFillMode;r.style.animationFillMode="forwards",e=n.setTimeout((()=>{"forwards"===r.style.animationFillMode&&(r.style.animationFillMode=t)}))}},i=e=>{e.target===r&&(a.current=o(u.current))};return r.addEventListener("animationstart",i),r.addEventListener("animationcancel",t),r.addEventListener("animationend",t),()=>{n.clearTimeout(e),r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",t),r.removeEventListener("animationend",t)}}d("ANIMATION_END")}),[r,d]),{isPresent:["mounted","unmountSuspended"].includes(m),ref:e.useCallback((e=>{e&&(u.current=getComputedStyle(e)),i(e)}),[])}}(i),a="function"==typeof u?u({present:s.isPresent}):e.Children.only(u),c=n(s.ref,function(e){let n=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning;if(t)return e.ref;if(n=Object.getOwnPropertyDescriptor(e,"ref")?.get,t=n&&"isReactWarning"in n&&n.isReactWarning,t)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof u||s.isPresent?e.cloneElement(a,{ref:c}):null};function o(e){return e?.animationName||"none"}r.displayName="Presence";export{r as Presence};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/presence/src/Presence.tsx\nimport * as React2 from \"react\";\nimport
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/presence/src/Presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// packages/react/presence/src/useStateMachine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// packages/react/presence/src/Presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef({});\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n if (node2) stylesRef.current = getComputedStyle(node2);\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nexport {\n Presence\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Presence","props","present","children","presence","node","setNode","React2","useState","stylesRef","useRef","prevPresentRef","prevAnimationNameRef","initialState","state","send","machine","React","useReducer","event","useStateMachine","mounted","UNMOUNT","ANIMATION_OUT","unmountSuspended","MOUNT","ANIMATION_END","unmounted","useEffect","currentAnimationName","getAnimationName","current","useLayoutEffect","styles","wasPresent","prevAnimationName","display","timeoutId","ownerWindow","ownerDocument","defaultView","window","handleAnimationEnd","isCurrentAnimation","includes","animationName","target","currentFillMode","style","animationFillMode","setTimeout","handleAnimationStart","addEventListener","clearTimeout","removeEventListener","isPresent","ref","useCallback","node2","getComputedStyle","usePresence","child","Children","only","useComposedRefs","element","getter","Object","getOwnPropertyDescriptor","get","mayWarn","isReactWarning","getElementRef","cloneElement","displayName"],"mappings":"iLAiBG,IAACA,EAAYC,IACd,MAAMC,QAAEA,EAAOC,SAAEA,GAAaF,EACxBG,EAOR,SAAqBF,GACnB,MAAOG,EAAMC,GAAWC,EAAOC,WACzBC,EAAYF,EAAOG,OAAO,CAAE,GA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@@ -1,2 +1,2 @@
|
|
1
|
-
import*as r from"react";import*as
|
1
|
+
import*as r from"react";import*as t from"react-dom";import{Slot as i}from"../../react-slot/dist/index.mjs";import{jsx as o}from"react/jsx-runtime";var e=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((t,e)=>{const n=r.forwardRef(((r,t)=>{const{asChild:n,...a}=r,m=n?i:e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),o(m,{...a,ref:t})}));return n.displayName=`Primitive.${e}`,{...t,[e]:n}}),{});function n(r,i){r&&t.flushSync((()=>r.dispatchEvent(i)))}export{e as Primitive,n as dispatchDiscreteCustomEvent};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// packages/react/primitive/src/Primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Primitive","reduce","primitive","node","Node","React","forwardRef","props","forwardedRef","asChild","primitiveProps","Comp","Slot","window","Symbol","for","jsx","ref","displayName","dispatchDiscreteCustomEvent","target","event","ReactDOM","flushSync","dispatchEvent"],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-primitive/dist/index.mjs"],"sourcesContent":["// packages/react/primitive/src/Primitive.tsx\nimport * as React from \"react\";\nimport * as ReactDOM from \"react-dom\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nvar NODES = [\n \"a\",\n \"button\",\n \"div\",\n \"form\",\n \"h2\",\n \"h3\",\n \"img\",\n \"input\",\n \"label\",\n \"li\",\n \"nav\",\n \"ol\",\n \"p\",\n \"span\",\n \"svg\",\n \"ul\"\n];\nvar Primitive = NODES.reduce((primitive, node) => {\n const Node = React.forwardRef((props, forwardedRef) => {\n const { asChild, ...primitiveProps } = props;\n const Comp = asChild ? Slot : node;\n if (typeof window !== \"undefined\") {\n window[Symbol.for(\"radix-ui\")] = true;\n }\n return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });\n });\n Node.displayName = `Primitive.${node}`;\n return { ...primitive, [node]: Node };\n}, {});\nfunction dispatchDiscreteCustomEvent(target, event) {\n if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));\n}\nvar Root = Primitive;\nexport {\n Primitive,\n Root,\n dispatchDiscreteCustomEvent\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["Primitive","reduce","primitive","node","Node","React","forwardRef","props","forwardedRef","asChild","primitiveProps","Comp","Slot","window","Symbol","for","jsx","ref","displayName","dispatchDiscreteCustomEvent","target","event","ReactDOM","flushSync","dispatchEvent"],"mappings":"mJAKA,IAkBIA,EAlBQ,CACV,IACA,SACA,MACA,OACA,KACA,KACA,MACA,QACA,QACA,KACA,MACA,KACA,IACA,OACA,MACA,MAEoBC,QAAO,CAACC,EAAWC,KACvC,MAAMC,EAAOC,EAAMC,YAAW,CAACC,EAAOC,KACpC,MAAMC,QAAEA,KAAYC,GAAmBH,EACjCI,EAAOF,EAAUG,EAAOT,EAI9B,MAHsB,oBAAXU,SACTA,OAAOC,OAAOC,IAAI,cAAe,GAEZC,EAAIL,EAAM,IAAKD,EAAgBO,IAAKT,GAAe,IAG5E,OADAJ,EAAKc,YAAc,aAAaf,IACzB,IAAKD,EAAWC,CAACA,GAAOC,EAAM,GACpC,IACH,SAASe,EAA4BC,EAAQC,GACvCD,GAAQE,EAASC,WAAU,IAAMH,EAAOI,cAAcH,IAC5D"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{createContextScope as
|
1
|
+
import*as e from"react";import{createContextScope as r}from"../node_modules/@radix-ui/react-context/dist/index.mjs";import{Primitive as a}from"../../react-primitive/dist/index.mjs";import{jsx as t}from"react/jsx-runtime";var o="Progress",n=100,[i,s]=r(o),[u,l]=i(o),d=e.forwardRef(((e,r)=>{const{__scopeProgress:o,value:i=null,max:s,getValueLabel:l=p,...d}=e;!s&&0!==s||x(s)||console.error(`Invalid prop \`max\` of value \`${`${s}`}\` supplied to \`${"Progress"}\`. Only numbers greater than 0 are valid max values. Defaulting to \`100\`.`);const m=x(s)?s:n;null===i||g(i,m)||console.error(function(e,r){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${r}\`. The \`value\` prop must be:\n - a positive number\n - less than the value passed to \`max\` (or 100 if no \`max\` prop is set)\n - \`null\` or \`undefined\` if the progress is indeterminate.\n\nDefaulting to \`null\`.`}(`${i}`,"Progress"));const v=g(i,m)?i:null,h=c(v)?l(v,m):void 0;return t(u,{scope:o,value:v,max:m,children:t(a.div,{"aria-valuemax":m,"aria-valuemin":0,"aria-valuenow":c(v)?v:void 0,"aria-valuetext":h,role:"progressbar","data-state":f(v,m),"data-value":v??void 0,"data-max":m,...d,ref:r})})}));d.displayName=o;var m="ProgressIndicator",v=e.forwardRef(((e,r)=>{const{__scopeProgress:o,...n}=e,i=l(m,o);return t(a.div,{"data-state":f(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...n,ref:r})}));function p(e,r){return`${Math.round(e/r*100)}%`}function f(e,r){return null==e?"indeterminate":e===r?"complete":"loading"}function c(e){return"number"==typeof e}function x(e){return c(e)&&!isNaN(e)&&e>0}function g(e,r){return c(e)&&!isNaN(e)&&e<=r&&e>=0}v.displayName=m;var h=d,$=v;export{$ as Indicator,d as Progress,v as ProgressIndicator,h as Root,s as createProgressScope};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-progress/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/progress/src/Progress.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PROGRESS_NAME = \"Progress\";\nvar DEFAULT_MAX = 100;\nvar [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar Progress = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp = null,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n ...progressProps\n } = props;\n if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {\n console.error(getInvalidMaxError(`${maxProp}`, \"Progress\"));\n }\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n if (valueProp !== null && !isValidValueNumber(valueProp, max)) {\n console.error(getInvalidValueError(`${valueProp}`, \"Progress\"));\n }\n const value = isValidValueNumber(valueProp, max) ? valueProp : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n ...progressProps,\n ref: forwardedRef\n }\n ) });\n }\n);\nProgress.displayName = PROGRESS_NAME;\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n ...indicatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nProgressIndicator.displayName = INDICATOR_NAME;\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !isNaN(value) && value <= max && value >= 0;\n}\nfunction getInvalidMaxError(propValue, componentName) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n}\nfunction getInvalidValueError(propValue, componentName) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`;\n}\nvar Root = Progress;\nvar Indicator = ProgressIndicator;\nexport {\n Indicator,\n Progress,\n ProgressIndicator,\n Root,\n createProgressScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PROGRESS_NAME","DEFAULT_MAX","createProgressContext","createProgressScope","createContextScope","ProgressProvider","useProgressContext","Progress","React","forwardRef","props","forwardedRef","__scopeProgress","value","valueProp","max","maxProp","getValueLabel","defaultGetValueLabel","progressProps","isValidMaxNumber","console","error","isValidValueNumber","propValue","componentName","getInvalidValueError","valueLabel","isNumber","jsx","scope","children","Primitive","div","role","getProgressState","ref","displayName","INDICATOR_NAME","ProgressIndicator","indicatorProps","context","Math","round","maxValue","isNaN","Root","Indicator"],"mappings":"
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-progress/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/progress/src/Progress.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar PROGRESS_NAME = \"Progress\";\nvar DEFAULT_MAX = 100;\nvar [createProgressContext, createProgressScope] = createContextScope(PROGRESS_NAME);\nvar [ProgressProvider, useProgressContext] = createProgressContext(PROGRESS_NAME);\nvar Progress = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeProgress,\n value: valueProp = null,\n max: maxProp,\n getValueLabel = defaultGetValueLabel,\n ...progressProps\n } = props;\n if ((maxProp || maxProp === 0) && !isValidMaxNumber(maxProp)) {\n console.error(getInvalidMaxError(`${maxProp}`, \"Progress\"));\n }\n const max = isValidMaxNumber(maxProp) ? maxProp : DEFAULT_MAX;\n if (valueProp !== null && !isValidValueNumber(valueProp, max)) {\n console.error(getInvalidValueError(`${valueProp}`, \"Progress\"));\n }\n const value = isValidValueNumber(valueProp, max) ? valueProp : null;\n const valueLabel = isNumber(value) ? getValueLabel(value, max) : void 0;\n return /* @__PURE__ */ jsx(ProgressProvider, { scope: __scopeProgress, value, max, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"aria-valuemax\": max,\n \"aria-valuemin\": 0,\n \"aria-valuenow\": isNumber(value) ? value : void 0,\n \"aria-valuetext\": valueLabel,\n role: \"progressbar\",\n \"data-state\": getProgressState(value, max),\n \"data-value\": value ?? void 0,\n \"data-max\": max,\n ...progressProps,\n ref: forwardedRef\n }\n ) });\n }\n);\nProgress.displayName = PROGRESS_NAME;\nvar INDICATOR_NAME = \"ProgressIndicator\";\nvar ProgressIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeProgress, ...indicatorProps } = props;\n const context = useProgressContext(INDICATOR_NAME, __scopeProgress);\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n \"data-state\": getProgressState(context.value, context.max),\n \"data-value\": context.value ?? void 0,\n \"data-max\": context.max,\n ...indicatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nProgressIndicator.displayName = INDICATOR_NAME;\nfunction defaultGetValueLabel(value, max) {\n return `${Math.round(value / max * 100)}%`;\n}\nfunction getProgressState(value, maxValue) {\n return value == null ? \"indeterminate\" : value === maxValue ? \"complete\" : \"loading\";\n}\nfunction isNumber(value) {\n return typeof value === \"number\";\n}\nfunction isValidMaxNumber(max) {\n return isNumber(max) && !isNaN(max) && max > 0;\n}\nfunction isValidValueNumber(value, max) {\n return isNumber(value) && !isNaN(value) && value <= max && value >= 0;\n}\nfunction getInvalidMaxError(propValue, componentName) {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n}\nfunction getInvalidValueError(propValue, componentName) {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\nDefaulting to \\`null\\`.`;\n}\nvar Root = Progress;\nvar Indicator = ProgressIndicator;\nexport {\n Indicator,\n Progress,\n ProgressIndicator,\n Root,\n createProgressScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["PROGRESS_NAME","DEFAULT_MAX","createProgressContext","createProgressScope","createContextScope","ProgressProvider","useProgressContext","Progress","React","forwardRef","props","forwardedRef","__scopeProgress","value","valueProp","max","maxProp","getValueLabel","defaultGetValueLabel","progressProps","isValidMaxNumber","console","error","isValidValueNumber","propValue","componentName","getInvalidValueError","valueLabel","isNumber","jsx","scope","children","Primitive","div","role","getProgressState","ref","displayName","INDICATOR_NAME","ProgressIndicator","indicatorProps","context","Math","round","maxValue","isNaN","Root","Indicator"],"mappings":"6NAOA,IAAIA,EAAgB,WAChBC,EAAc,KACbC,EAAuBC,GAAuBC,EAAmBJ,IACjEK,EAAkBC,GAAsBJ,EAAsBF,GAC/DO,EAAWC,EAAMC,YACnB,CAACC,EAAOC,KACN,MAAMC,gBACJA,EACAC,MAAOC,EAAY,KACnBC,IAAKC,EAAOC,cACZA,EAAgBC,KACbC,GACDT,GACCM,GAAuB,IAAZA,GAAmBI,EAAiBJ,IAClDK,QAAQC,MA4DL,mCA5D8B,GAAGN,uBAAW,0FAEjD,MAAMD,EAAMK,EAAiBJ,GAAWA,EAAUf,EAChC,OAAda,GAAuBS,EAAmBT,EAAWC,IACvDM,QAAQC,MA0Dd,SAA8BE,EAAWC,GACvC,MAAO,qCAAqCD,qBAA6BC,mOAM3E,CAjEoBC,CAAqB,GAAGZ,IAAa,aAErD,MAAMD,EAAQU,EAAmBT,EAAWC,GAAOD,EAAY,KACzDa,EAAaC,EAASf,GAASI,EAAcJ,EAAOE,QAAO,EACjE,OAAuBc,EAAIxB,EAAkB,CAAEyB,MAAOlB,EAAiBC,QAAOE,MAAKgB,SAA0BF,EAC3GG,EAAUC,IACV,CACE,gBAAiBlB,EACjB,gBAAiB,EACjB,gBAAiBa,EAASf,GAASA,OAAQ,EAC3C,iBAAkBc,EAClBO,KAAM,cACN,aAAcC,EAAiBtB,EAAOE,GACtC,aAAcF,QAAS,EACvB,WAAYE,KACTI,EACHiB,IAAKzB,KAEL,IAGRJ,EAAS8B,YAAcrC,EACvB,IAAIsC,EAAiB,oBACjBC,EAAoB/B,EAAMC,YAC5B,CAACC,EAAOC,KACN,MAAMC,gBAAEA,KAAoB4B,GAAmB9B,EACzC+B,EAAUnC,EAAmBgC,EAAgB1B,GACnD,OAAuBiB,EACrBG,EAAUC,IACV,CACE,aAAcE,EAAiBM,EAAQ5B,MAAO4B,EAAQ1B,KACtD,aAAc0B,EAAQ5B,YAAS,EAC/B,WAAY4B,EAAQ1B,OACjByB,EACHJ,IAAKzB,GAER,IAIL,SAASO,EAAqBL,EAAOE,GACnC,MAAO,GAAG2B,KAAKC,MAAM9B,EAAQE,EAAM,OACrC,CACA,SAASoB,EAAiBtB,EAAO+B,GAC/B,OAAgB,MAAT/B,EAAgB,gBAAkBA,IAAU+B,EAAW,WAAa,SAC7E,CACA,SAAShB,EAASf,GAChB,MAAwB,iBAAVA,CAChB,CACA,SAASO,EAAiBL,GACxB,OAAOa,EAASb,KAAS8B,MAAM9B,IAAQA,EAAM,CAC/C,CACA,SAASQ,EAAmBV,EAAOE,GACjC,OAAOa,EAASf,KAAWgC,MAAMhC,IAAUA,GAASE,GAAOF,GAAS,CACtE,CAfA0B,EAAkBF,YAAcC,EA2B7B,IAACQ,EAAOvC,EACPwC,EAAYR"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import*as e from"react";import{jsx as t}from"react/jsx-runtime";function o(o,r=[]){let c=[];const s=()=>{const t=c.map((t=>e.createContext(t)));return function(n){const r=n?.[o]||t;return e.useMemo((()=>({[`__scope${o}`]:{...n,[o]:r}})),[n,r])}};return s.scopeName=o,[function(n,r){const s=e.createContext(r),u=c.length;function i(n){const{scope:r,children:c,...i}=n,m=r?.[o][u]||s,p=e.useMemo((()=>i),Object.values(i));return t(m.Provider,{value:p,children:c})}return c=[...c,r],i.displayName=n+"Provider",[i,function(t,c){const i=c?.[o][u]||s,m=e.useContext(i);if(m)return m;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},n(s,...r)]}function n(...t){const o=t[0];if(1===t.length)return o;const n=()=>{const n=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const r=n.reduce(((e,{useScope:o,scopeName:n})=>({...e,...o(t)[`__scope${n}`]})),{});return e.useMemo((()=>({[`__scope${o.scopeName}`]:r})),[r])}};return n.scopeName=o.scopeName,n}export{o as createContextScope};
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../../../node_modules/@radix-ui/react-progress/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/createContext.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n function Provider(props) {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n function Provider(props) {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName][index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName][index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createContextScope","scopeName","createContextScopeDeps","defaultContexts","createScope","scopeContexts","map","defaultContext","React","createContext","scope","contexts","useMemo","rootComponentName","BaseContext","index","length","Provider","props","children","context","Context","value","Object","values","jsx","displayName","consumerName","useContext","Error","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","useScope","overrideScopes","nextScopes","reduce","nextScopes2"],"mappings":"gEAmBA,SAASA,EAAmBC,EAAWC,EAAyB,IAC9D,IAAIC,EAAkB,GAqBtB,MAAMC,EAAc,KAClB,MAAMC,EAAgBF,EAAgBG,KAAKC,GAClCC,EAAMC,cAAcF,KAE7B,OAAO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CAACA,GACvF,CAAK,EAGH,OADAjC,EAAYH,UAAY+B,EAAU/B,UAC3BG,CACT"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{composeEventHandlers as
|
1
|
+
import*as e from"react";import{composeEventHandlers as o}from"../../primitive/dist/index.mjs";import{createCollection as r}from"../../react-collection/dist/index.mjs";import{useComposedRefs as t}from"../../react-compose-refs/dist/index.mjs";import{createContextScope as n}from"../node_modules/@radix-ui/react-context/dist/index.mjs";import{useId as i}from"../../react-id/dist/index.mjs";import{Primitive as s}from"../../react-primitive/dist/index.mjs";import{useCallbackRef as c}from"../../react-use-callback-ref/dist/index.mjs";import{useControllableState as a}from"../../react-use-controllable-state/dist/index.mjs";import{useDirection as u}from"../../react-direction/dist/index.mjs";import{jsx as l}from"react/jsx-runtime";var f="rovingFocusGroup.onEntryFocus",d={bubbles:!1,cancelable:!0},m="RovingFocusGroup",[p,v,b]=r(m),[w,g]=n(m,[b]),[F,x]=w(m),I=e.forwardRef(((e,o)=>l(p.Provider,{scope:e.__scopeRovingFocusGroup,children:l(p.Slot,{scope:e.__scopeRovingFocusGroup,children:l(h,{...e,ref:o})})})));I.displayName=m;var h=e.forwardRef(((r,n)=>{const{__scopeRovingFocusGroup:i,orientation:m,loop:p=!1,dir:b,currentTabStopId:w,defaultCurrentTabStopId:g,onCurrentTabStopIdChange:x,onEntryFocus:I,preventScrollOnEntryFocus:h=!1,...R}=r,y=e.useRef(null),A=t(n,y),T=u(b),[E=null,D]=a({prop:w,defaultProp:g,onChange:x}),[j,C]=e.useState(!1),_=c(I),k=v(i),G=e.useRef(!1),[K,L]=e.useState(0);return e.useEffect((()=>{const e=y.current;if(e)return e.addEventListener(f,_),()=>e.removeEventListener(f,_)}),[_]),l(F,{scope:i,orientation:m,dir:T,loop:p,currentTabStopId:E,onItemFocus:e.useCallback((e=>D(e)),[D]),onItemShiftTab:e.useCallback((()=>C(!0)),[]),onFocusableItemAdd:e.useCallback((()=>L((e=>e+1))),[]),onFocusableItemRemove:e.useCallback((()=>L((e=>e-1))),[]),children:l(s.div,{tabIndex:j||0===K?-1:0,"data-orientation":m,...R,ref:A,style:{outline:"none",...r.style},onMouseDown:o(r.onMouseDown,(()=>{G.current=!0})),onFocus:o(r.onFocus,(e=>{const o=!G.current;if(e.target===e.currentTarget&&o&&!j){const o=new CustomEvent(f,d);if(e.currentTarget.dispatchEvent(o),!o.defaultPrevented){const e=k().filter((e=>e.focusable));S([e.find((e=>e.active)),e.find((e=>e.id===E)),...e].filter(Boolean).map((e=>e.ref.current)),h)}}G.current=!1})),onBlur:o(r.onBlur,(()=>C(!1)))})})})),R="RovingFocusGroupItem",y=e.forwardRef(((r,t)=>{const{__scopeRovingFocusGroup:n,focusable:c=!0,active:a=!1,tabStopId:u,...f}=r,d=i(),m=u||d,b=x(R,n),w=b.currentTabStopId===m,g=v(n),{onFocusableItemAdd:F,onFocusableItemRemove:I}=b;return e.useEffect((()=>{if(c)return F(),()=>I()}),[c,F,I]),l(p.ItemSlot,{scope:n,id:m,focusable:c,active:a,children:l(s.span,{tabIndex:w?0:-1,"data-orientation":b.orientation,...f,ref:t,onMouseDown:o(r.onMouseDown,(e=>{c?b.onItemFocus(m):e.preventDefault()})),onFocus:o(r.onFocus,(()=>b.onItemFocus(m))),onKeyDown:o(r.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void b.onItemShiftTab();if(e.target!==e.currentTarget)return;const o=function(e,o,r){const t=function(e,o){return"rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:A[t]}(e,b.orientation,b.dir);if(void 0!==o){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=g().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===o)n.reverse();else if("prev"===o||"next"===o){"prev"===o&&n.reverse();const i=n.indexOf(e.currentTarget);n=b.loop?(t=i+1,(r=n).map(((e,o)=>r[(t+o)%r.length]))):n.slice(i+1)}setTimeout((()=>S(n)))}var r,t}))})})}));y.displayName=R;var A={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function S(e,o=!1){const r=document.activeElement;for(const t of e){if(t===r)return;if(t.focus({preventScroll:o}),document.activeElement!==r)return}}var T=I,E=y;export{E as Item,T as Root,I as RovingFocusGroup,y as RovingFocusGroupItem,g as createRovingFocusGroupScope};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/roving-focus/src/RovingFocusGroup.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId,\n onChange: onCurrentTabStopIdChange\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n })\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","bubbles","cancelable","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","forwardRef","props","forwardedRef","jsx","Provider","scope","__scopeRovingFocusGroup","children","Slot","RovingFocusGroupImpl","ref","displayName","orientation","loop","dir","currentTabStopId","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","useRef","composedRefs","useComposedRefs","direction","useDirection","setCurrentTabStopId","useControllableState","prop","defaultProp","onChange","isTabbingBackOut","setIsTabbingBackOut","useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","useEffect","node","current","addEventListener","removeEventListener","onItemFocus","useCallback","tabStopId","onItemShiftTab","onFocusableItemAdd","prevCount","onFocusableItemRemove","Primitive","div","tabIndex","style","outline","onMouseDown","composeEventHandlers","onFocus","event","isKeyboardFocus","target","currentTarget","entryFocusEvent","CustomEvent","dispatchEvent","defaultPrevented","items","filter","item","focusable","focusFirst","find","active","id","Boolean","map","onBlur","ITEM_NAME","RovingFocusGroupItem","itemProps","autoId","useId","context","isCurrentTabStop","ItemSlot","span","preventDefault","onKeyDown","key","shiftKey","focusIntent","getDirectionAwareKey","includes","MAP_KEY_TO_FOCUS_INTENT","getFocusIntent","metaKey","ctrlKey","altKey","candidateNodes","reverse","currentIndex","indexOf","startIndex","array","_","index","length","slice","setTimeout","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","PageUp","Home","PageDown","End","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","document","activeElement","candidate","focus","Root","Item"],"mappings":"mtBAcA,IAAIA,EAAc,gCACdC,EAAgB,CAAEC,SAAS,EAAOC,YAAY,GAC9CC,EAAa,oBACZC,EAAYC,EAAeC,GAAyBC,EAAiBJ,IACrEK,EAA+BC,GAA+BC,EACjEP,EACA,CAACG,KAEEK,EAAqBC,GAAyBJ,EAA8BL,GAC7EU,EAAmBC,EAAMC,YAC3B,CAACC,EAAOC,IACiBC,MAAId,EAAWe,SAAU,CAAEC,MAAOJ,EAAMK,wBAAyBC,SAA0BJ,EAAAA,IAAId,EAAWmB,KAAM,CAAEH,MAAOJ,EAAMK,wBAAyBC,SAA0BJ,EAAGA,IAACM,EAAsB,IAAKR,EAAOS,IAAKR,UAGxPJ,EAAiBa,YAAcvB,EAC/B,IAAIqB,EAAuBV,EAAMC,YAAW,CAACC,EAAOC,KAClD,MAAMI,wBACJA,EAAuBM,YACvBA,EAAWC,KACXA,GAAO,EAAKC,IACZA,EACAC,iBAAkBC,EAAoBC,wBACtCA,EAAuBC,yBACvBA,EAAwBC,aACxBA,EAAYC,0BACZA,GAA4B,KACzBC,GACDpB,EACES,EAAMX,EAAMuB,OAAO,MACnBC,EAAeC,EAAgBtB,EAAcQ,GAC7Ce,EAAYC,EAAaZ,IACxBC,EAAmB,KAAMY,GAAuBC,EAAqB,CAC1EC,KAAMb,EACNc,YAAab,EACbc,SAAUb,KAELc,EAAkBC,GAAuBlC,EAAMmC,UAAS,GACzDC,EAAmBC,EAAejB,GAClCkB,EAAW/C,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1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// packages/react/roving-focus/src/RovingFocusGroup.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId = null, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId,\n onChange: onCurrentTabStopIdChange\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n })\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","bubbles","cancelable","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","forwardRef","props","forwardedRef","jsx","Provider","scope","__scopeRovingFocusGroup","children","Slot","RovingFocusGroupImpl","ref","displayName","orientation","loop","dir","currentTabStopId","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","useRef","composedRefs","useComposedRefs","direction","useDirection","setCurrentTabStopId","useControllableState","prop","defaultProp","onChange","isTabbingBackOut","setIsTabbingBackOut","useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","useEffect","node","current","addEventListener","removeEventListener","onItemFocus","useCallback","tabStopId","onItemShiftTab","onFocusableItemAdd","prevCount","onFocusableItemRemove","Primitive","div","tabIndex","style","outline","onMouseDown","composeEventHandlers","onFocus","event","isKeyboardFocus","target","currentTarget","entryFocusEvent","CustomEvent","dispatchEvent","defaultPrevented","items","filter","item","focusable","focusFirst","find","active","id","Boolean","map","onBlur","ITEM_NAME","RovingFocusGroupItem","itemProps","autoId","useId","context","isCurrentTabStop","ItemSlot","span","preventDefault","onKeyDown","key","shiftKey","focusIntent","getDirectionAwareKey","includes","MAP_KEY_TO_FOCUS_INTENT","getFocusIntent","metaKey","ctrlKey","altKey","candidateNodes","reverse","currentIndex","indexOf","startIndex","array","_","index","length","slice","setTimeout","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","PageUp","Home","PageDown","End","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","document","activeElement","candidate","focus","Root","Item"],"mappings":"stBAcA,IAAIA,EAAc,gCACdC,EAAgB,CAAEC,SAAS,EAAOC,YAAY,GAC9CC,EAAa,oBACZC,EAAYC,EA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eC,eACtC,GAAoB,SAAhBT,GAA0C,SAAhBA,EAAwB,CACrC,SAAhBA,GAAwBQ,EAAeC,UAC3C,MAAMC,EAAeF,EAAeG,QAAQ3C,EAAMG,eAClDqC,EAAiBhB,EAAQxE,MAwCjB4F,EAxCkDF,EAAe,GAwCxEG,EAxCyCL,GAyC7CvB,KAAI,CAAC6B,EAAGC,IAAUF,GAAOD,EAAaG,GAASF,EAAMG,WAzC4BR,EAAeS,MAAMP,EAAe,EACnH,CACDQ,YAAW,IAAMtC,EAAW4B,IAC7B,CAqCf,IAAmBK,EAAOD,CArCX,OAKV,IAGLxB,EAAqBtE,YAAcqE,EACnC,IAAIgB,EAA0B,CAC5BgB,UAAW,OACXC,QAAS,OACTC,WAAY,OACZC,UAAW,OACXC,OAAQ,QACRC,KAAM,QACNC,SAAU,OACVC,IAAK,QAYP,SAAS9C,EAAW+C,EAAYC,GAAgB,GAC9C,MAAMC,EAA6BC,SAASC,cAC5C,IAAK,MAAMC,KAAaL,EAAY,CAClC,GAAIK,IAAcH,EAA4B,OAE9C,GADAG,EAAUC,MAAM,CAAEL,kBACdE,SAASC,gBAAkBF,EAA4B,MAC5D,CACH,CAIG,IAACK,EAAOjI,EACPkI,EAAO/C"}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import*as e from"react";import{jsx as t}from"react/jsx-runtime";function o(o,r=[]){let c=[];const s=()=>{const t=c.map((t=>e.createContext(t)));return function(n){const r=n?.[o]||t;return e.useMemo((()=>({[`__scope${o}`]:{...n,[o]:r}})),[n,r])}};return s.scopeName=o,[function(n,r){const s=e.createContext(r),u=c.length;function i(n){const{scope:r,children:c,...i}=n,m=r?.[o][u]||s,p=e.useMemo((()=>i),Object.values(i));return t(m.Provider,{value:p,children:c})}return c=[...c,r],i.displayName=n+"Provider",[i,function(t,c){const i=c?.[o][u]||s,m=e.useContext(i);if(m)return m;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},n(s,...r)]}function n(...t){const o=t[0];if(1===t.length)return o;const n=()=>{const n=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const r=n.reduce(((e,{useScope:o,scopeName:n})=>({...e,...o(t)[`__scope${n}`]})),{});return e.useMemo((()=>({[`__scope${o.scopeName}`]:r})),[r])}};return n.scopeName=o.scopeName,n}export{o as createContextScope};
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../../../node_modules/@radix-ui/react-roving-focus/node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/createContext.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n function Provider(props) {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n function Provider(props) {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName][index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n }\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName][index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + \"Provider\";\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createContextScope","scopeName","createContextScopeDeps","defaultContexts","createScope","scopeContexts","map","defaultContext","React","createContext","scope","contexts","useMemo","rootComponentName","BaseContext","index","length","Provider","props","children","context","Context","value","Object","values","jsx","displayName","consumerName","useContext","Error","composeContextScopes","scopes","baseScope","scopeHooks","createScope2","useScope","overrideScopes","nextScopes","reduce","nextScopes2"],"mappings":"gEAmBA,SAASA,EAAmBC,EAAWC,EAAyB,IAC9D,IAAIC,EAAkB,GAqBtB,MAAMC,EAAc,KAClB,MAAMC,EAAgBF,EAAgBG,KAAKC,GAClCC,EAAMC,cAAcF,KAE7B,OAAO,SAAkBG,GACvB,MAAMC,EAAWD,IAAQT,IAAcI,EACvC,OAAOG,EAAMI,SACX,KAAA,CAAS,CAAC,UAAUX,KAAc,IAAKS,EAAOT,CAACA,GAAYU,MAC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primitive/dist/index.mjs";import{Presence as t}from"../../react-presence/dist/index.mjs";import{createContextScope as o}from"../../react-context/dist/index.mjs";import{useComposedRefs as n}from"../../react-compose-refs/dist/index.mjs";import{useCallbackRef as l}from"../../react-use-callback-ref/dist/index.mjs";import{useDirection as i}from"../../react-direction/dist/index.mjs";import{useLayoutEffect as s}from"../../react-use-layout-effect/dist/index.mjs";import{clamp as a}from"../../number/dist/index.mjs";import{composeEventHandlers as c}from"../../primitive/dist/index.mjs";import{j as d}from"../../../../_virtual/jsx-runtime.mjs";var u="ScrollArea",[p,f]=o(u),[h,w]=p(u),v=e.forwardRef(((t,o)=>{const{__scopeScrollArea:l,type:s="hover",dir:a,scrollHideDelay:c=600,...u}=t,[p,f]=e.useState(null),[w,v]=e.useState(null),[m,b]=e.useState(null),[g,S]=e.useState(null),[x,y]=e.useState(null),[E,T]=e.useState(0),[C,R]=e.useState(0),[j,P]=e.useState(!1),[_,L]=e.useState(!1),D=n(o,(e=>f(e))),A=i(a);return d.jsx(h,{scope:l,type:s,dir:A,scrollHideDelay:c,scrollArea:p,viewport:w,onViewportChange:v,content:m,onContentChange:b,scrollbarX:g,onScrollbarXChange:S,scrollbarXEnabled:j,onScrollbarXEnabledChange:P,scrollbarY:x,onScrollbarYChange:y,scrollbarYEnabled:_,onScrollbarYEnabledChange:L,onCornerWidthChange:T,onCornerHeightChange:R,children:d.jsx(r.div,{dir:A,...u,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":E+"px","--radix-scroll-area-corner-height":C+"px",...t.style}})})}));v.displayName=u;var m="ScrollAreaViewport",b=e.forwardRef(((t,o)=>{const{__scopeScrollArea:l,children:i,nonce:s,...a}=t,c=w(m,l),u=e.useRef(null),p=n(o,u,c.onViewportChange);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),d.jsx(r.div,{"data-radix-scroll-area-viewport":"",...a,ref:p,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:d.jsx("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})}));b.displayName=m;var g="ScrollAreaScrollbar",S=e.forwardRef(((r,t)=>{const{forceMount:o,...n}=r,l=w(g,r.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=l,a="horizontal"===r.orientation;return e.useEffect((()=>(a?i(!0):s(!0),()=>{a?i(!1):s(!1)})),[a,i,s]),"hover"===l.type?d.jsx(x,{...n,ref:t,forceMount:o}):"scroll"===l.type?d.jsx(y,{...n,ref:t,forceMount:o}):"auto"===l.type?d.jsx(E,{...n,ref:t,forceMount:o}):"always"===l.type?d.jsx(T,{...n,ref:t}):null}));S.displayName=g;var x=e.forwardRef(((r,o)=>{const{forceMount:n,...l}=r,i=w(g,r.__scopeScrollArea),[s,a]=e.useState(!1);return e.useEffect((()=>{const e=i.scrollArea;let r=0;if(e){const t=()=>{window.clearTimeout(r),a(!0)},o=()=>{r=window.setTimeout((()=>a(!1)),i.scrollHideDelay)};return e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",o),()=>{window.clearTimeout(r),e.removeEventListener("pointerenter",t),e.removeEventListener("pointerleave",o)}}}),[i.scrollArea,i.scrollHideDelay]),d.jsx(t,{present:n||s,children:d.jsx(E,{"data-state":s?"visible":"hidden",...l,ref:o})})})),y=e.forwardRef(((r,o)=>{const{forceMount:n,...l}=r,i=w(g,r.__scopeScrollArea),s="horizontal"===r.orientation,a=B((()=>p("SCROLL_END")),100),[u,p]=(f="hidden",h={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},e.useReducer(((e,r)=>h[e][r]??e),f));var f,h;return e.useEffect((()=>{if("idle"===u){const e=window.setTimeout((()=>p("HIDE")),i.scrollHideDelay);return()=>window.clearTimeout(e)}}),[u,i.scrollHideDelay,p]),e.useEffect((()=>{const e=i.viewport,r=s?"scrollLeft":"scrollTop";if(e){let t=e[r];const o=()=>{const o=e[r];t!==o&&(p("SCROLL"),a()),t=o};return e.addEventListener("scroll",o),()=>e.removeEventListener("scroll",o)}}),[i.viewport,s,p,a]),d.jsx(t,{present:n||"hidden"!==u,children:d.jsx(T,{"data-state":"hidden"===u?"hidden":"visible",...l,ref:o,onPointerEnter:c(r.onPointerEnter,(()=>p("POINTER_ENTER"))),onPointerLeave:c(r.onPointerLeave,(()=>p("POINTER_LEAVE")))})})})),E=e.forwardRef(((r,o)=>{const n=w(g,r.__scopeScrollArea),{forceMount:l,...i}=r,[s,a]=e.useState(!1),c="horizontal"===r.orientation,u=B((()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,r=n.viewport.offsetHeight<n.viewport.scrollHeight;a(c?e:r)}}),10);return k(n.viewport,u),k(n.content,u),d.jsx(t,{present:l||s,children:d.jsx(T,{"data-state":s?"visible":"hidden",...i,ref:o})})})),T=e.forwardRef(((r,t)=>{const{orientation:o="vertical",...n}=r,l=w(g,r.__scopeScrollArea),i=e.useRef(null),s=e.useRef(0),[a,c]=e.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=X(a.viewport,a.content),p={...n,sizes:a,onSizesChange:c,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:e=>s.current=e};function f(e,r){return function(e,r,t,o="ltr"){const n=Y(t),l=n/2,i=r||l,s=n-i,a=t.scrollbar.paddingStart+i,c=t.scrollbar.size-t.scrollbar.paddingEnd-s,d=t.content-t.viewport,u="ltr"===o?[0,d]:[-1*d,0];return M([a,c],u)(e)}(e,s.current,a,r)}return"horizontal"===o?d.jsx(C,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&i.current){const e=I(l.viewport.scrollLeft,a,l.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{l.viewport&&(l.viewport.scrollLeft=e)},onDragScroll:e=>{l.viewport&&(l.viewport.scrollLeft=f(e,l.dir))}}):"vertical"===o?d.jsx(R,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&i.current){const e=I(l.viewport.scrollTop,a);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{l.viewport&&(l.viewport.scrollTop=e)},onDragScroll:e=>{l.viewport&&(l.viewport.scrollTop=f(e))}}):null})),C=e.forwardRef(((r,t)=>{const{sizes:o,onSizesChange:l,...i}=r,s=w(g,r.__scopeScrollArea),[a,c]=e.useState(),u=e.useRef(null),p=n(t,u,s.onScrollbarXChange);return e.useEffect((()=>{u.current&&c(getComputedStyle(u.current))}),[u]),d.jsx(_,{"data-orientation":"horizontal",...i,ref:p,sizes:o,style:{bottom:0,left:"rtl"===s.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===s.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Y(o)+"px",...r.style},onThumbPointerDown:e=>r.onThumbPointerDown(e.x),onDragScroll:e=>r.onDragScroll(e.x),onWheelScroll:(e,t)=>{if(s.viewport){const o=s.viewport.scrollLeft+e.deltaX;r.onWheelScroll(o),O(o,t)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&a&&l({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:W(a.paddingLeft),paddingEnd:W(a.paddingRight)}})}})})),R=e.forwardRef(((r,t)=>{const{sizes:o,onSizesChange:l,...i}=r,s=w(g,r.__scopeScrollArea),[a,c]=e.useState(),u=e.useRef(null),p=n(t,u,s.onScrollbarYChange);return e.useEffect((()=>{u.current&&c(getComputedStyle(u.current))}),[u]),d.jsx(_,{"data-orientation":"vertical",...i,ref:p,sizes:o,style:{top:0,right:"ltr"===s.dir?0:void 0,left:"rtl"===s.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Y(o)+"px",...r.style},onThumbPointerDown:e=>r.onThumbPointerDown(e.y),onDragScroll:e=>r.onDragScroll(e.y),onWheelScroll:(e,t)=>{if(s.viewport){const o=s.viewport.scrollTop+e.deltaY;r.onWheelScroll(o),O(o,t)&&e.preventDefault()}},onResize:()=>{u.current&&s.viewport&&a&&l({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:W(a.paddingTop),paddingEnd:W(a.paddingBottom)}})}})})),[j,P]=p(g),_=e.forwardRef(((t,o)=>{const{__scopeScrollArea:i,sizes:s,hasThumb:a,onThumbChange:u,onThumbPointerUp:p,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:v,onWheelScroll:m,onResize:b,...S}=t,x=w(g,i),[y,E]=e.useState(null),T=n(o,(e=>E(e))),C=e.useRef(null),R=e.useRef(""),P=x.viewport,_=s.content-s.viewport,L=l(m),D=l(h),A=B(b,10);function z(e){if(C.current){const r=e.clientX-C.current.left,t=e.clientY-C.current.top;v({x:r,y:t})}}return e.useEffect((()=>{const e=e=>{const r=e.target,t=y?.contains(r);t&&L(e,_)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[P,y,_,L]),e.useEffect(D,[s,D]),k(y,A),k(x.content,A),d.jsx(j,{scope:i,scrollbar:y,hasThumb:a,onThumbChange:l(u),onThumbPointerUp:l(p),onThumbPositionChange:D,onThumbPointerDown:l(f),children:d.jsx(r.div,{...S,ref:T,style:{position:"absolute",...S.style},onPointerDown:c(t.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),C.current=y.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",x.viewport&&(x.viewport.style.scrollBehavior="auto"),z(e)}})),onPointerMove:c(t.onPointerMove,z),onPointerUp:c(t.onPointerUp,(e=>{const r=e.target;r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=R.current,x.viewport&&(x.viewport.style.scrollBehavior=""),C.current=null}))})})})),L="ScrollAreaThumb",D=e.forwardRef(((e,r)=>{const{forceMount:o,...n}=e,l=P(L,e.__scopeScrollArea);return d.jsx(t,{present:o||l.hasThumb,children:d.jsx(A,{ref:r,...n})})})),A=e.forwardRef(((t,o)=>{const{__scopeScrollArea:l,style:i,...s}=t,a=w(L,l),u=P(L,l),{onThumbPositionChange:p}=u,f=n(o,(e=>u.onThumbChange(e))),h=e.useRef(),v=B((()=>{h.current&&(h.current(),h.current=void 0)}),100);return e.useEffect((()=>{const e=a.viewport;if(e){const r=()=>{if(v(),!h.current){const r=U(e,p);h.current=r,p()}};return p(),e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[a.viewport,v,p]),d.jsx(r.div,{"data-state":u.hasThumb?"visible":"hidden",...s,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:c(t.onPointerDownCapture,(e=>{const r=e.target.getBoundingClientRect(),t=e.clientX-r.left,o=e.clientY-r.top;u.onThumbPointerDown({x:t,y:o})})),onPointerUp:c(t.onPointerUp,u.onThumbPointerUp)})}));D.displayName=L;var z="ScrollAreaCorner",H=e.forwardRef(((e,r)=>{const t=w(z,e.__scopeScrollArea),o=Boolean(t.scrollbarX&&t.scrollbarY);return"scroll"!==t.type&&o?d.jsx(N,{...e,ref:r}):null}));H.displayName=z;var N=e.forwardRef(((t,o)=>{const{__scopeScrollArea:n,...l}=t,i=w(z,n),[s,a]=e.useState(0),[c,u]=e.useState(0),p=Boolean(s&&c);return k(i.scrollbarX,(()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)})),k(i.scrollbarY,(()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),a(e)})),p?d.jsx(r.div,{...l,ref:o,style:{width:s,height:c,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null}));function W(e){return e?parseInt(e,10):0}function X(e,r){const t=e/r;return isNaN(t)?0:t}function Y(e){const r=X(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-t)*r;return Math.max(o,18)}function I(e,r,t="ltr"){const o=Y(r),n=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=r.scrollbar.size-n,i=r.content-r.viewport,s=l-o,c=a(e,"ltr"===t?[0,i]:[-1*i,0]);return M([0,i],[0,s])(c)}function M(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(e[1]-e[0]);return r[0]+o*(t-e[0])}}function O(e,r){return e>0&&e<r}var U=(e,r=(()=>{}))=>{let t={left:e.scrollLeft,top:e.scrollTop},o=0;return function n(){const l={left:e.scrollLeft,top:e.scrollTop},i=t.left!==l.left,s=t.top!==l.top;(i||s)&&r(),t=l,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function B(r,t){const o=l(r),n=e.useRef(0);return e.useEffect((()=>()=>window.clearTimeout(n.current)),[]),e.useCallback((()=>{window.clearTimeout(n.current),n.current=window.setTimeout(o,t)}),[o,t])}function k(e,r){const t=l(r);s((()=>{let r=0;if(e){const o=new ResizeObserver((()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)}));return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}}),[e,t])}var F=v,V=b,q=S,$=D,G=H;export{G as Corner,F as Root,v as ScrollArea,H as ScrollAreaCorner,S as ScrollAreaScrollbar,D as ScrollAreaThumb,b as ScrollAreaViewport,q as Scrollbar,$ as Thumb,V as Viewport,f as createScrollAreaScope};
|
1
|
+
import*as e from"react";import{Primitive as r}from"../../react-primitive/dist/index.mjs";import{Presence as t}from"../node_modules/@radix-ui/react-presence/dist/index.mjs";import{createContextScope as o}from"../node_modules/@radix-ui/react-context/dist/index.mjs";import{useComposedRefs as n}from"../../react-compose-refs/dist/index.mjs";import{useCallbackRef as l}from"../../react-use-callback-ref/dist/index.mjs";import{useDirection as i}from"../../react-direction/dist/index.mjs";import{useLayoutEffect as a}from"../../react-use-layout-effect/dist/index.mjs";import{clamp as s}from"../../number/dist/index.mjs";import{composeEventHandlers as c}from"../../primitive/dist/index.mjs";import{jsx as d,jsxs as u,Fragment as p}from"react/jsx-runtime";var f="ScrollArea",[h,w]=o(f),[v,m]=h(f),b=e.forwardRef(((t,o)=>{const{__scopeScrollArea:l,type:a="hover",dir:s,scrollHideDelay:c=600,...u}=t,[p,f]=e.useState(null),[h,w]=e.useState(null),[m,b]=e.useState(null),[g,S]=e.useState(null),[y,E]=e.useState(null),[T,C]=e.useState(0),[R,P]=e.useState(0),[_,x]=e.useState(!1),[L,D]=e.useState(!1),A=n(o,(e=>f(e))),z=i(s);return d(v,{scope:l,type:a,dir:z,scrollHideDelay:c,scrollArea:p,viewport:h,onViewportChange:w,content:m,onContentChange:b,scrollbarX:g,onScrollbarXChange:S,scrollbarXEnabled:_,onScrollbarXEnabledChange:x,scrollbarY:y,onScrollbarYChange:E,scrollbarYEnabled:L,onScrollbarYEnabledChange:D,onCornerWidthChange:C,onCornerHeightChange:P,children:d(r.div,{dir:z,...u,ref:A,style:{position:"relative","--radix-scroll-area-corner-width":T+"px","--radix-scroll-area-corner-height":R+"px",...t.style}})})}));b.displayName=f;var g="ScrollAreaViewport",S=e.forwardRef(((t,o)=>{const{__scopeScrollArea:l,children:i,nonce:a,...s}=t,c=m(g,l),f=e.useRef(null),h=n(o,f,c.onViewportChange);return u(p,{children:[d("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),d(r.div,{"data-radix-scroll-area-viewport":"",...s,ref:h,style:{overflowX:c.scrollbarXEnabled?"scroll":"hidden",overflowY:c.scrollbarYEnabled?"scroll":"hidden",...t.style},children:d("div",{ref:c.onContentChange,style:{minWidth:"100%",display:"table"},children:i})})]})}));S.displayName=g;var y="ScrollAreaScrollbar",E=e.forwardRef(((r,t)=>{const{forceMount:o,...n}=r,l=m(y,r.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=l,s="horizontal"===r.orientation;return e.useEffect((()=>(s?i(!0):a(!0),()=>{s?i(!1):a(!1)})),[s,i,a]),"hover"===l.type?d(T,{...n,ref:t,forceMount:o}):"scroll"===l.type?d(C,{...n,ref:t,forceMount:o}):"auto"===l.type?d(R,{...n,ref:t,forceMount:o}):"always"===l.type?d(P,{...n,ref:t}):null}));E.displayName=y;var T=e.forwardRef(((r,o)=>{const{forceMount:n,...l}=r,i=m(y,r.__scopeScrollArea),[a,s]=e.useState(!1);return e.useEffect((()=>{const e=i.scrollArea;let r=0;if(e){const t=()=>{window.clearTimeout(r),s(!0)},o=()=>{r=window.setTimeout((()=>s(!1)),i.scrollHideDelay)};return e.addEventListener("pointerenter",t),e.addEventListener("pointerleave",o),()=>{window.clearTimeout(r),e.removeEventListener("pointerenter",t),e.removeEventListener("pointerleave",o)}}}),[i.scrollArea,i.scrollHideDelay]),d(t,{present:n||a,children:d(R,{"data-state":a?"visible":"hidden",...l,ref:o})})})),C=e.forwardRef(((r,o)=>{const{forceMount:n,...l}=r,i=m(y,r.__scopeScrollArea),a="horizontal"===r.orientation,s=F((()=>p("SCROLL_END")),100),[u,p]=(f="hidden",h={hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}},e.useReducer(((e,r)=>h[e][r]??e),f));var f,h;return e.useEffect((()=>{if("idle"===u){const e=window.setTimeout((()=>p("HIDE")),i.scrollHideDelay);return()=>window.clearTimeout(e)}}),[u,i.scrollHideDelay,p]),e.useEffect((()=>{const e=i.viewport,r=a?"scrollLeft":"scrollTop";if(e){let t=e[r];const o=()=>{const o=e[r];t!==o&&(p("SCROLL"),s()),t=o};return e.addEventListener("scroll",o),()=>e.removeEventListener("scroll",o)}}),[i.viewport,a,p,s]),d(t,{present:n||"hidden"!==u,children:d(P,{"data-state":"hidden"===u?"hidden":"visible",...l,ref:o,onPointerEnter:c(r.onPointerEnter,(()=>p("POINTER_ENTER"))),onPointerLeave:c(r.onPointerLeave,(()=>p("POINTER_LEAVE")))})})})),R=e.forwardRef(((r,o)=>{const n=m(y,r.__scopeScrollArea),{forceMount:l,...i}=r,[a,s]=e.useState(!1),c="horizontal"===r.orientation,u=F((()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,r=n.viewport.offsetHeight<n.viewport.scrollHeight;s(c?e:r)}}),10);return V(n.viewport,u),V(n.content,u),d(t,{present:l||a,children:d(P,{"data-state":a?"visible":"hidden",...i,ref:o})})})),P=e.forwardRef(((r,t)=>{const{orientation:o="vertical",...n}=r,l=m(y,r.__scopeScrollArea),i=e.useRef(null),a=e.useRef(0),[s,c]=e.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=M(s.viewport,s.content),p={...n,sizes:s,onSizesChange:c,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>i.current=e,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:e=>a.current=e};function f(e,r){return function(e,r,t,o="ltr"){const n=O(t),l=n/2,i=r||l,a=n-i,s=t.scrollbar.paddingStart+i,c=t.scrollbar.size-t.scrollbar.paddingEnd-a,d=t.content-t.viewport,u="ltr"===o?[0,d]:[-1*d,0];return j([s,c],u)(e)}(e,a.current,s,r)}return"horizontal"===o?d(_,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&i.current){const e=U(l.viewport.scrollLeft,s,l.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{l.viewport&&(l.viewport.scrollLeft=e)},onDragScroll:e=>{l.viewport&&(l.viewport.scrollLeft=f(e,l.dir))}}):"vertical"===o?d(x,{...p,ref:t,onThumbPositionChange:()=>{if(l.viewport&&i.current){const e=U(l.viewport.scrollTop,s);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{l.viewport&&(l.viewport.scrollTop=e)},onDragScroll:e=>{l.viewport&&(l.viewport.scrollTop=f(e))}}):null})),_=e.forwardRef(((r,t)=>{const{sizes:o,onSizesChange:l,...i}=r,a=m(y,r.__scopeScrollArea),[s,c]=e.useState(),u=e.useRef(null),p=n(t,u,a.onScrollbarXChange);return e.useEffect((()=>{u.current&&c(getComputedStyle(u.current))}),[u]),d(A,{"data-orientation":"horizontal",...i,ref:p,sizes:o,style:{bottom:0,left:"rtl"===a.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===a.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":O(o)+"px",...r.style},onThumbPointerDown:e=>r.onThumbPointerDown(e.x),onDragScroll:e=>r.onDragScroll(e.x),onWheelScroll:(e,t)=>{if(a.viewport){const o=a.viewport.scrollLeft+e.deltaX;r.onWheelScroll(o),B(o,t)&&e.preventDefault()}},onResize:()=>{u.current&&a.viewport&&s&&l({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:I(s.paddingLeft),paddingEnd:I(s.paddingRight)}})}})})),x=e.forwardRef(((r,t)=>{const{sizes:o,onSizesChange:l,...i}=r,a=m(y,r.__scopeScrollArea),[s,c]=e.useState(),u=e.useRef(null),p=n(t,u,a.onScrollbarYChange);return e.useEffect((()=>{u.current&&c(getComputedStyle(u.current))}),[u]),d(A,{"data-orientation":"vertical",...i,ref:p,sizes:o,style:{top:0,right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":O(o)+"px",...r.style},onThumbPointerDown:e=>r.onThumbPointerDown(e.y),onDragScroll:e=>r.onDragScroll(e.y),onWheelScroll:(e,t)=>{if(a.viewport){const o=a.viewport.scrollTop+e.deltaY;r.onWheelScroll(o),B(o,t)&&e.preventDefault()}},onResize:()=>{u.current&&a.viewport&&s&&l({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:I(s.paddingTop),paddingEnd:I(s.paddingBottom)}})}})})),[L,D]=h(y),A=e.forwardRef(((t,o)=>{const{__scopeScrollArea:i,sizes:a,hasThumb:s,onThumbChange:u,onThumbPointerUp:p,onThumbPointerDown:f,onThumbPositionChange:h,onDragScroll:w,onWheelScroll:v,onResize:b,...g}=t,S=m(y,i),[E,T]=e.useState(null),C=n(o,(e=>T(e))),R=e.useRef(null),P=e.useRef(""),_=S.viewport,x=a.content-a.viewport,D=l(v),A=l(h),z=F(b,10);function H(e){if(R.current){const r=e.clientX-R.current.left,t=e.clientY-R.current.top;w({x:r,y:t})}}return e.useEffect((()=>{const e=e=>{const r=e.target,t=E?.contains(r);t&&D(e,x)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})}),[_,E,x,D]),e.useEffect(A,[a,A]),V(E,z),V(S.content,z),d(L,{scope:i,scrollbar:E,hasThumb:s,onThumbChange:l(u),onThumbPointerUp:l(p),onThumbPositionChange:A,onThumbPointerDown:l(f),children:d(r.div,{...g,ref:C,style:{position:"absolute",...g.style},onPointerDown:c(t.onPointerDown,(e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),R.current=E.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",S.viewport&&(S.viewport.style.scrollBehavior="auto"),H(e)}})),onPointerMove:c(t.onPointerMove,H),onPointerUp:c(t.onPointerUp,(e=>{const r=e.target;r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=P.current,S.viewport&&(S.viewport.style.scrollBehavior=""),R.current=null}))})})})),z="ScrollAreaThumb",H=e.forwardRef(((e,r)=>{const{forceMount:o,...n}=e,l=D(z,e.__scopeScrollArea);return d(t,{present:o||l.hasThumb,children:d(N,{ref:r,...n})})})),N=e.forwardRef(((t,o)=>{const{__scopeScrollArea:l,style:i,...a}=t,s=m(z,l),u=D(z,l),{onThumbPositionChange:p}=u,f=n(o,(e=>u.onThumbChange(e))),h=e.useRef(),w=F((()=>{h.current&&(h.current(),h.current=void 0)}),100);return e.useEffect((()=>{const e=s.viewport;if(e){const r=()=>{if(w(),!h.current){const r=k(e,p);h.current=r,p()}};return p(),e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}}),[s.viewport,w,p]),d(r.div,{"data-state":u.hasThumb?"visible":"hidden",...a,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...i},onPointerDownCapture:c(t.onPointerDownCapture,(e=>{const r=e.target.getBoundingClientRect(),t=e.clientX-r.left,o=e.clientY-r.top;u.onThumbPointerDown({x:t,y:o})})),onPointerUp:c(t.onPointerUp,u.onThumbPointerUp)})}));H.displayName=z;var W="ScrollAreaCorner",X=e.forwardRef(((e,r)=>{const t=m(W,e.__scopeScrollArea),o=Boolean(t.scrollbarX&&t.scrollbarY);return"scroll"!==t.type&&o?d(Y,{...e,ref:r}):null}));X.displayName=W;var Y=e.forwardRef(((t,o)=>{const{__scopeScrollArea:n,...l}=t,i=m(W,n),[a,s]=e.useState(0),[c,u]=e.useState(0),p=Boolean(a&&c);return V(i.scrollbarX,(()=>{const e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),u(e)})),V(i.scrollbarY,(()=>{const e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),s(e)})),p?d(r.div,{...l,ref:o,style:{width:a,height:c,position:"absolute",right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:0,...t.style}}):null}));function I(e){return e?parseInt(e,10):0}function M(e,r){const t=e/r;return isNaN(t)?0:t}function O(e){const r=M(e.viewport,e.content),t=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=(e.scrollbar.size-t)*r;return Math.max(o,18)}function U(e,r,t="ltr"){const o=O(r),n=r.scrollbar.paddingStart+r.scrollbar.paddingEnd,l=r.scrollbar.size-n,i=r.content-r.viewport,a=l-o,c=s(e,"ltr"===t?[0,i]:[-1*i,0]);return j([0,i],[0,a])(c)}function j(e,r){return t=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const o=(r[1]-r[0])/(e[1]-e[0]);return r[0]+o*(t-e[0])}}function B(e,r){return e>0&&e<r}var k=(e,r=()=>{})=>{let t={left:e.scrollLeft,top:e.scrollTop},o=0;return function n(){const l={left:e.scrollLeft,top:e.scrollTop},i=t.left!==l.left,a=t.top!==l.top;(i||a)&&r(),t=l,o=window.requestAnimationFrame(n)}(),()=>window.cancelAnimationFrame(o)};function F(r,t){const o=l(r),n=e.useRef(0);return e.useEffect((()=>()=>window.clearTimeout(n.current)),[]),e.useCallback((()=>{window.clearTimeout(n.current),n.current=window.setTimeout(o,t)}),[o,t])}function V(e,r){const t=l(r);a((()=>{let r=0;if(e){const o=new ResizeObserver((()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)}));return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}}),[e,t])}var q=b,$=S,G=E,J=H,K=X;export{K as Corner,q as Root,b as ScrollArea,X as ScrollAreaCorner,E as ScrollAreaScrollbar,H as ScrollAreaThumb,S as ScrollAreaViewport,G as Scrollbar,J as Thumb,$ as Viewport,w as createScrollAreaScope};
|
2
2
|
//# sourceMappingURL=index.mjs.map
|