@overmap-ai/blocks 1.0.31-minimize-size.6 → 1.0.31-tailwind-components.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/AlertDialog/Content.d.ts +7 -0
- package/dist/AlertDialog/Provider.d.ts +2 -0
- package/dist/AlertDialog/context.d.ts +5 -0
- package/dist/AlertDialog/cva.d.ts +4 -0
- package/dist/AlertDialog/hooks.d.ts +1 -0
- package/dist/AlertDialog/index.d.ts +14 -0
- package/dist/AlertDialog/typings.d.ts +19 -0
- package/dist/Avatar/Fallback.d.ts +5 -0
- package/dist/Avatar/Image.d.ts +5 -0
- package/dist/Avatar/Root.d.ts +7 -0
- package/dist/Avatar/context.d.ts +7 -0
- package/dist/Avatar/cva.d.ts +6 -0
- package/dist/Avatar/index.d.ts +9 -0
- package/dist/Avatar/typings.d.ts +12 -0
- package/dist/Badge/Badge.d.ts +6 -6
- package/dist/Badge/cva.d.ts +5 -0
- package/dist/Badge/index.d.ts +1 -0
- package/dist/Badge/typings.d.ts +12 -7
- package/dist/ButtonGroup/ButtonGroup.d.ts +9 -7
- package/dist/ButtonGroup/context.d.ts +9 -4
- package/dist/ButtonGroup/index.d.ts +1 -2
- package/dist/Buttons/Button.d.ts +6 -4
- package/dist/Buttons/IconButton.d.ts +5 -7
- package/dist/Buttons/cva.d.ts +5 -0
- package/dist/Buttons/index.d.ts +4 -4
- package/dist/Buttons/typings.d.ts +11 -24
- package/dist/Checkbox/Indicator.d.ts +5 -0
- package/dist/Checkbox/Root.d.ts +7 -0
- package/dist/Checkbox/cva.d.ts +4 -0
- package/dist/Checkbox/index.d.ts +7 -3
- package/dist/Checkbox/typings.d.ts +11 -15
- package/dist/CollapsibleTree/context.d.ts +1 -4
- package/dist/CollapsibleTree/typings.d.ts +3 -16
- package/dist/Dialog/Content.d.ts +11 -0
- package/dist/Dialog/Root.d.ts +2 -0
- package/dist/Dialog/context.d.ts +3 -0
- package/dist/Dialog/hooks.d.ts +1 -0
- package/dist/Dialog/index.d.ts +11 -0
- package/dist/Dialog/typings.d.ts +17 -0
- package/dist/HoverCard/Arrow.d.ts +5 -0
- package/dist/HoverCard/Content.d.ts +8 -0
- package/dist/HoverCard/cva.d.ts +3 -0
- package/dist/HoverCard/index.d.ts +10 -0
- package/dist/HoverCard/typings.d.ts +10 -0
- package/dist/HoverUtility/HoverUtility.d.ts +1 -0
- package/dist/Input/Field.d.ts +4 -0
- package/dist/Input/Root.d.ts +6 -0
- package/dist/Input/Slot.d.ts +4 -0
- package/dist/Input/context.d.ts +8 -0
- package/dist/Input/cva.d.ts +12 -0
- package/dist/Input/index.d.ts +9 -2
- package/dist/Input/typings.d.ts +10 -12
- package/dist/Layout/Container.d.ts +3 -4
- package/dist/Layout/SlideOutOverlay.d.ts +2 -3
- package/dist/Layout/index.d.ts +3 -3
- package/dist/OvermapMenu/ClickTrigger/index.d.ts +1 -1
- package/dist/OvermapMenu/Content/Content.d.ts +1 -1
- package/dist/OvermapMenu/Content/context.d.ts +7 -1
- package/dist/OvermapMenu/Input/Field.d.ts +3 -0
- package/dist/OvermapMenu/Input/Root.d.ts +4 -0
- package/dist/OvermapMenu/Input/Slot.d.ts +5 -0
- package/dist/OvermapMenu/Input/index.d.ts +3 -1
- package/dist/OvermapMenu/Pages/index.d.ts +1 -1
- package/dist/OvermapMenu/SelectAll/SelectAllIndicator.d.ts +6 -0
- package/dist/OvermapMenu/SelectAll/SelectAllItem.d.ts +3 -0
- package/dist/OvermapMenu/SelectAll/context.d.ts +6 -0
- package/dist/OvermapMenu/SelectAll/index.d.ts +2 -0
- package/dist/OvermapMenu/SelectedIndicator/index.d.ts +1 -1
- package/dist/OvermapMenu/Separator/Separator.d.ts +1 -1
- package/dist/OvermapMenu/Sub/context.d.ts +1 -1
- package/dist/OvermapMenu/Sub/index.d.ts +1 -1
- package/dist/OvermapMenu/SubTrigger/index.d.ts +1 -1
- package/dist/OvermapMenu/cva.d.ts +20 -0
- package/dist/OvermapMenu/root/context.d.ts +1 -4
- package/dist/OvermapMenu/root/index.d.ts +1 -1
- package/dist/OvermapMenu/typings.d.ts +30 -20
- package/dist/Popover/Arrow.d.ts +5 -0
- package/dist/Popover/Content.d.ts +8 -0
- package/dist/Popover/cva.d.ts +3 -0
- package/dist/Popover/index.d.ts +19 -2
- package/dist/Popover/typings.d.ts +8 -17
- package/dist/Provider/Provider.d.ts +8 -0
- package/dist/Provider/context.d.ts +8 -0
- package/dist/Provider/index.d.ts +3 -0
- package/dist/Provider/typings.d.ts +1 -0
- package/dist/RadioGroup/Indicator.d.ts +5 -0
- package/dist/RadioGroup/Item.d.ts +6 -0
- package/dist/RadioGroup/Root.d.ts +7 -0
- package/dist/RadioGroup/context.d.ts +7 -0
- package/dist/RadioGroup/cva.d.ts +4 -0
- package/dist/RadioGroup/index.d.ts +9 -0
- package/dist/RadioGroup/typings.d.ts +10 -0
- package/dist/RiIcon/RiIcon.d.ts +4 -5
- package/dist/RiIcon/index.d.ts +0 -2
- package/dist/SelectContext/index.d.ts +1 -1
- package/dist/Separator/Separator.d.ts +8 -3
- package/dist/Separator/cva.d.ts +5 -0
- package/dist/Separator/index.d.ts +0 -1
- package/dist/Separator/typings.d.ts +11 -19
- package/dist/SlideOut/SlideOutV2.d.ts +1 -3
- package/dist/TextArea/TextArea.d.ts +6 -7
- package/dist/TextArea/cva.d.ts +5 -0
- package/dist/TextArea/typings.d.ts +13 -15
- package/dist/Toast/cva.d.ts +4 -0
- package/dist/Toast/typings.d.ts +13 -10
- package/dist/ToggleButton/BaseToggleButton.d.ts +3 -0
- package/dist/ToggleButton/IconToggleButton.d.ts +3 -0
- package/dist/ToggleButton/ToggleButton.d.ts +2 -7
- package/dist/ToggleButton/cva.d.ts +5 -0
- package/dist/ToggleButton/index.d.ts +2 -0
- package/dist/ToggleButton/typings.d.ts +18 -0
- package/dist/Tooltip/Arrow.d.ts +5 -0
- package/dist/Tooltip/Content.d.ts +8 -0
- package/dist/Tooltip/cva.d.ts +4 -0
- package/dist/Tooltip/index.d.ts +11 -1
- package/dist/Tooltip/typings.d.ts +10 -0
- package/dist/blocks.js +3089 -4024
- package/dist/blocks.js.map +1 -1
- package/dist/blocks.umd.cjs +3358 -19
- package/dist/blocks.umd.cjs.map +1 -1
- package/dist/constants.d.ts +1 -2
- package/dist/cva/floating.d.ts +6 -0
- package/dist/cva/index.d.ts +2 -0
- package/dist/cva/radius.d.ts +4 -0
- package/dist/index.d.ts +17 -35
- package/dist/typings.d.ts +3 -3
- package/dist/utils.d.ts +2 -27
- package/package.json +66 -42
- package/dist/Breadcrumb/Breadcrumb.d.ts +0 -27
- package/dist/Breadcrumb/context.d.ts +0 -10
- package/dist/Breadcrumb/index.d.ts +0 -2
- package/dist/ButtonGroup/ButtonList.d.ts +0 -25
- package/dist/ButtonGroup/typings.d.ts +0 -37
- package/dist/Buttons/constants.d.ts +0 -9
- package/dist/Checkbox/Checkbox.d.ts +0 -3
- package/dist/Checkbox/SelectAllCheckbox.d.ts +0 -3
- package/dist/ConfirmEditInput/ConfirmEditInput.d.ts +0 -3
- package/dist/ConfirmEditInput/index.d.ts +0 -2
- package/dist/ConfirmEditInput/typings.d.ts +0 -15
- package/dist/Dialogs/AlertDialog/AlertDialog.d.ts +0 -11
- package/dist/Dialogs/AlertDialog/AlertDialogContent.d.ts +0 -4
- package/dist/Dialogs/AlertDialog/context.d.ts +0 -8
- package/dist/Dialogs/AlertDialog/hooks.d.ts +0 -7
- package/dist/Dialogs/AlertDialog/index.d.ts +0 -3
- package/dist/Dialogs/AlertDialog/typings.d.ts +0 -49
- package/dist/Dialogs/BaseDialog/BaseDialog.d.ts +0 -3
- package/dist/Dialogs/BaseDialog/index.d.ts +0 -2
- package/dist/Dialogs/BaseDialog/typings.d.ts +0 -31
- package/dist/Dialogs/Dialog/Dialog.d.ts +0 -7
- package/dist/Dialogs/Dialog/DialogContent.d.ts +0 -3
- package/dist/Dialogs/Dialog/index.d.ts +0 -3
- package/dist/Dialogs/Dialog/typings.d.ts +0 -40
- package/dist/Dialogs/Dialog/utils.d.ts +0 -7
- package/dist/Dialogs/Overlay/Overlay.d.ts +0 -7
- package/dist/Dialogs/Overlay/index.d.ts +0 -1
- package/dist/Dialogs/index.d.ts +0 -4
- package/dist/Dialogs/typings.d.ts +0 -7
- package/dist/DownloadButtonUtility/DownloadButtonUtility.d.ts +0 -7
- package/dist/DownloadButtonUtility/index.d.ts +0 -1
- package/dist/Flex/Flex.d.ts +0 -17
- package/dist/Flex/index.d.ts +0 -1
- package/dist/IconColorUtility/IconColorUtility.d.ts +0 -17
- package/dist/IconColorUtility/index.d.ts +0 -1
- package/dist/Input/Input.d.ts +0 -3
- package/dist/ItemStack/Group.d.ts +0 -9
- package/dist/ItemStack/Item.d.ts +0 -4
- package/dist/LeftAndRightPanels/LeftAndRightPanels.d.ts +0 -34
- package/dist/LeftAndRightPanels/index.d.ts +0 -1
- package/dist/MultiPagePopover/MultiPagePopover.d.ts +0 -3
- package/dist/MultiPagePopover/index.d.ts +0 -1
- package/dist/MultiPagePopover/typings.d.ts +0 -21
- package/dist/MultiSelect/MultiSelect.d.ts +0 -28
- package/dist/MultiSelect/MultiSelectItem.d.ts +0 -14
- package/dist/MultiSelect/index.d.ts +0 -1
- package/dist/OvermapDropdownMenu/DropdownMenu.d.ts +0 -8
- package/dist/OvermapDropdownMenu/index.d.ts +0 -1
- package/dist/OvermapDropdownMultiSelect/DropdownMultiSelect.d.ts +0 -8
- package/dist/OvermapDropdownMultiSelect/index.d.ts +0 -1
- package/dist/OvermapDropdownSelect/DropdownSelect.d.ts +0 -8
- package/dist/OvermapDropdownSelect/index.d.ts +0 -1
- package/dist/OvermapInputItem/OvermapInputItem.d.ts +0 -6
- package/dist/OvermapInputItem/index.d.ts +0 -2
- package/dist/OvermapInputItem/typings.d.ts +0 -4
- package/dist/OvermapItem/OvermapItem.d.ts +0 -5
- package/dist/OvermapItem/constants.d.ts +0 -2
- package/dist/OvermapItem/index.d.ts +0 -2
- package/dist/OvermapItem/typings.d.ts +0 -24
- package/dist/OvermapItemGroup/OvermapItemGroup.d.ts +0 -3
- package/dist/OvermapItemGroup/context.d.ts +0 -9
- package/dist/OvermapItemGroup/index.d.ts +0 -3
- package/dist/OvermapItemGroup/typings.d.ts +0 -6
- package/dist/OvermapMenu/Input/Input.d.ts +0 -3
- package/dist/OvermapMenu/Scroll/Scroll.d.ts +0 -2
- package/dist/OvermapMenu/Scroll/index.d.ts +0 -1
- package/dist/OvermapMenu/index.d.ts +0 -29
- package/dist/Popover/Popover.d.ts +0 -3
- package/dist/RiIcon/constants.d.ts +0 -134
- package/dist/RiIcon/typings.d.ts +0 -2
- package/dist/Select/Select.d.ts +0 -3
- package/dist/Select/index.d.ts +0 -2
- package/dist/Select/typings.d.ts +0 -22
- package/dist/Sidebar/Sidebar.d.ts +0 -30
- package/dist/Sidebar/index.d.ts +0 -1
- package/dist/Switch/Switch.d.ts +0 -7
- package/dist/Switch/index.d.ts +0 -2
- package/dist/Switch/typings.d.ts +0 -13
- package/dist/Table/Table.d.ts +0 -3
- package/dist/Table/index.d.ts +0 -2
- package/dist/Table/typings.d.ts +0 -70
- package/dist/Text/Text.d.ts +0 -24
- package/dist/Text/index.d.ts +0 -1
- package/dist/Theme/DefaultTheme.d.ts +0 -4
- package/dist/Theme/index.d.ts +0 -2
- package/dist/ToggleGroup/ToggleGroup.d.ts +0 -7
- package/dist/ToggleGroup/index.d.ts +0 -2
- package/dist/ToggleGroup/typings.d.ts +0 -7
- package/dist/Toolbar/Toolbar.d.ts +0 -23
- package/dist/Toolbar/index.d.ts +0 -1
- package/dist/Tooltip/Tooltip.d.ts +0 -6
- package/dist/style.css +0 -1
package/dist/blocks.umd.cjs
CHANGED
|
@@ -1,20 +1,3359 @@
|
|
|
1
|
-
(function(d,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react/jsx-runtime"),require("@radix-ui/themes"),require("react"),require("react-responsive"),require("@react-hook/resize-observer"),require("@react-icons/all-files/ri/RiAccountBoxLine"),require("@react-icons/all-files/ri/RiAddLine"),require("@react-icons/all-files/ri/RiAlertLine"),require("@react-icons/all-files/ri/RiArrowDownSLine"),require("@react-icons/all-files/ri/RiArrowLeftDoubleLine"),require("@react-icons/all-files/ri/RiArrowLeftLine"),require("@react-icons/all-files/ri/RiArrowLeftSLine"),require("@react-icons/all-files/ri/RiArrowRightDoubleLine"),require("@react-icons/all-files/ri/RiArrowRightLine"),require("@react-icons/all-files/ri/RiArrowRightSLine"),require("@react-icons/all-files/ri/RiArrowUpLine"),require("@react-icons/all-files/ri/RiArrowUpSLine"),require("@react-icons/all-files/ri/RiArticleFill"),require("@react-icons/all-files/ri/RiAttachment2"),require("@react-icons/all-files/ri/RiBankCardFill"),require("@react-icons/all-files/ri/RiBarChartFill"),require("@react-icons/all-files/ri/RiBardFill"),require("@react-icons/all-files/ri/RiBold"),require("@react-icons/all-files/ri/RiBugLine"),require("@react-icons/all-files/ri/RiBuilding2Fill"),require("@react-icons/all-files/ri/RiCalendarEventFill"),require("@react-icons/all-files/ri/RiCalendarFill"),require("@react-icons/all-files/ri/RiCheckLine"),require("@react-icons/all-files/ri/RiCheckboxBlankFill"),require("@react-icons/all-files/ri/RiCircleFill"),require("@react-icons/all-files/ri/RiCircleLine"),require("@react-icons/all-files/ri/RiCloseLargeLine"),require("@react-icons/all-files/ri/RiCloseLine"),require("@react-icons/all-files/ri/RiColorFilterFill"),require("@react-icons/all-files/ri/RiCommunityLine"),require("@react-icons/all-files/ri/RiDeleteBin2Line"),require("@react-icons/all-files/ri/RiDeleteBin7Fill"),require("@react-icons/all-files/ri/RiDeleteBin7Line"),require("@react-icons/all-files/ri/RiDownload2Line"),require("@react-icons/all-files/ri/RiDraggable"),require("@react-icons/all-files/ri/RiEqualizerFill"),require("@react-icons/all-files/ri/RiEqualizerLine"),require("@react-icons/all-files/ri/RiErrorWarningLine"),require("@react-icons/all-files/ri/RiExpandDiagonalFill"),require("@react-icons/all-files/ri/RiExpandDiagonalLine"),require("@react-icons/all-files/ri/RiExportFill"),require("@react-icons/all-files/ri/RiExpandUpDownLine"),require("@react-icons/all-files/ri/RiExternalLinkFill"),require("@react-icons/all-files/ri/RiExternalLinkLine"),require("@react-icons/all-files/ri/RiFile3Fill"),require("@react-icons/all-files/ri/RiFileCopyFill"),require("@react-icons/all-files/ri/RiFileCopyLine"),require("@react-icons/all-files/ri/RiFileTextFill"),require("@react-icons/all-files/ri/RiFilter3Line"),require("@react-icons/all-files/ri/RiFunctionFill"),require("@react-icons/all-files/ri/RiHome2Line"),require("@react-icons/all-files/ri/RiHomeLine"),require("@react-icons/all-files/ri/RiImportFill"),require("@react-icons/all-files/ri/RiInformationLine"),require("@react-icons/all-files/ri/RiInstanceLine"),require("@react-icons/all-files/ri/RiLayoutColumnLine"),require("@react-icons/all-files/ri/RiLayoutLeftLine"),require("@react-icons/all-files/ri/RiLayoutRightLine"),require("@react-icons/all-files/ri/RiLink"),require("@react-icons/all-files/ri/RiLinkUnlink"),require("@react-icons/all-files/ri/RiLoginBoxLine"),require("@react-icons/all-files/ri/RiLogoutBoxLine"),require("@react-icons/all-files/ri/RiLoopLeftLine"),require("@react-icons/all-files/ri/RiMapPin5Fill"),require("@react-icons/all-files/ri/RiMarkupFill"),require("@react-icons/all-files/ri/RiMenuLine"),require("@react-icons/all-files/ri/RiMoonFill"),require("@react-icons/all-files/ri/RiMore2Fill"),require("@react-icons/all-files/ri/RiMoreFill"),require("@react-icons/all-files/ri/RiMusic2Fill"),require("@react-icons/all-files/ri/RiPencilFill"),require("@react-icons/all-files/ri/RiPencilLine"),require("@react-icons/all-files/ri/RiPlayFill"),require("@react-icons/all-files/ri/RiQuestionLine"),require("@react-icons/all-files/ri/RiQuestionMark"),require("@react-icons/all-files/ri/RiRoadMapFill"),require("@react-icons/all-files/ri/RiSearchLine"),require("@react-icons/all-files/ri/RiSettings2Line"),require("@react-icons/all-files/ri/RiSquareFill"),require("@react-icons/all-files/ri/RiSquareLine"),require("@react-icons/all-files/ri/RiStarLine"),require("@react-icons/all-files/ri/RiSubtractLine"),require("@react-icons/all-files/ri/RiSunFill"),require("@react-icons/all-files/ri/RiThumbDownFill"),require("@react-icons/all-files/ri/RiThumbDownLine"),require("@react-icons/all-files/ri/RiThumbUpFill"),require("@react-icons/all-files/ri/RiThumbUpLine"),require("@react-icons/all-files/ri/RiUploadLine"),require("@react-icons/all-files/ri/RiUser2Fill"),require("@react-icons/all-files/ri/RiUser3Fill"),require("@react-icons/all-files/ri/RiUserAddFill"),require("@react-icons/all-files/ri/RiUserLine"),require("@react-icons/all-files/ri/RiListUnordered"),require("@react-icons/all-files/ri/RiListCheck"),require("@react-icons/all-files/ri/RiListOrdered"),require("@react-icons/all-files/ri/RiTableView"),require("@react-icons/all-files/ri/RiRefreshLine"),require("@react-icons/all-files/ri/RiArrowDownSFill"),require("@react-icons/all-files/ri/RiItalic"),require("@react-icons/all-files/ri/RiStrikethrough"),require("@react-icons/all-files/ri/RiUnderline"),require("@react-icons/all-files/ri/RiQuoteText"),require("@react-icons/all-files/ri/RiFontColor"),require("@react-icons/all-files/ri/RiMarkPenFill"),require("@react-icons/all-files/ri/RiDragDropLine"),require("@react-icons/all-files/ri/RiNavigationFill"),require("@react-icons/all-files/ri/RiEyeOffFill"),require("@react-icons/all-files/ri/RiCloseCircleFill"),require("@react-icons/all-files/ri/RiDragMoveFill"),require("@react-icons/all-files/ri/RiMapPin2Fill"),require("@react-icons/all-files/ri/RiH1"),require("@react-icons/all-files/ri/RiH2"),require("@react-icons/all-files/ri/RiH3"),require("@react-icons/all-files/ri/RiSeparator"),require("@react-icons/all-files/ri/RiUserForbidFill"),require("@react-icons/all-files/ri/RiArrowGoBackLine"),require("@react-icons/all-files/ri/RiFileCopy2Line"),require("@react-icons/all-files/ri/RiArrowDropDownLine"),require("@react-icons/all-files/ri/RiTimeLine"),require("@react-icons/all-files/ri/RiFocus3Line"),require("@react-icons/all-files/ri/RiArrowUpSFill"),require("@react-icons/all-files/ri/RiRestartLine"),require("@radix-ui/react-dialog"),require("@radix-ui/react-collapsible"),require("@radix-ui/react-slot"),require("react-device-detect"),require("re-resizable"),require("react-transition-group"),require("react-dom"),require("@radix-ui/react-dismissable-layer"),require("@radix-ui/react-toggle-group"),require("@radix-ui/react-toolbar"),require("@radix-ui/react-toast"),require("@radix-ui/react-toggle"),require("react-error-boundary"),require("@floating-ui/react"),require("@table-library/react-table-library/table.js"),require("@table-library/react-table-library/theme.js"),require("@table-library/react-table-library/sort.js"),require("@table-library/react-table-library/select.js"),require("@table-library/react-table-library/pagination.js")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","@radix-ui/themes","react","react-responsive","@react-hook/resize-observer","@react-icons/all-files/ri/RiAccountBoxLine","@react-icons/all-files/ri/RiAddLine","@react-icons/all-files/ri/RiAlertLine","@react-icons/all-files/ri/RiArrowDownSLine","@react-icons/all-files/ri/RiArrowLeftDoubleLine","@react-icons/all-files/ri/RiArrowLeftLine","@react-icons/all-files/ri/RiArrowLeftSLine","@react-icons/all-files/ri/RiArrowRightDoubleLine","@react-icons/all-files/ri/RiArrowRightLine","@react-icons/all-files/ri/RiArrowRightSLine","@react-icons/all-files/ri/RiArrowUpLine","@react-icons/all-files/ri/RiArrowUpSLine","@react-icons/all-files/ri/RiArticleFill","@react-icons/all-files/ri/RiAttachment2","@react-icons/all-files/ri/RiBankCardFill","@react-icons/all-files/ri/RiBarChartFill","@react-icons/all-files/ri/RiBardFill","@react-icons/all-files/ri/RiBold","@react-icons/all-files/ri/RiBugLine","@react-icons/all-files/ri/RiBuilding2Fill","@react-icons/all-files/ri/RiCalendarEventFill","@react-icons/all-files/ri/RiCalendarFill","@react-icons/all-files/ri/RiCheckLine","@react-icons/all-files/ri/RiCheckboxBlankFill","@react-icons/all-files/ri/RiCircleFill","@react-icons/all-files/ri/RiCircleLine","@react-icons/all-files/ri/RiCloseLargeLine","@react-icons/all-files/ri/RiCloseLine","@react-icons/all-files/ri/RiColorFilterFill","@react-icons/all-files/ri/RiCommunityLine","@react-icons/all-files/ri/RiDeleteBin2Line","@react-icons/all-files/ri/RiDeleteBin7Fill","@react-icons/all-files/ri/RiDeleteBin7Line","@react-icons/all-files/ri/RiDownload2Line","@react-icons/all-files/ri/RiDraggable","@react-icons/all-files/ri/RiEqualizerFill","@react-icons/all-files/ri/RiEqualizerLine","@react-icons/all-files/ri/RiErrorWarningLine","@react-icons/all-files/ri/RiExpandDiagonalFill","@react-icons/all-files/ri/RiExpandDiagonalLine","@react-icons/all-files/ri/RiExportFill","@react-icons/all-files/ri/RiExpandUpDownLine","@react-icons/all-files/ri/RiExternalLinkFill","@react-icons/all-files/ri/RiExternalLinkLine","@react-icons/all-files/ri/RiFile3Fill","@react-icons/all-files/ri/RiFileCopyFill","@react-icons/all-files/ri/RiFileCopyLine","@react-icons/all-files/ri/RiFileTextFill","@react-icons/all-files/ri/RiFilter3Line","@react-icons/all-files/ri/RiFunctionFill","@react-icons/all-files/ri/RiHome2Line","@react-icons/all-files/ri/RiHomeLine","@react-icons/all-files/ri/RiImportFill","@react-icons/all-files/ri/RiInformationLine","@react-icons/all-files/ri/RiInstanceLine","@react-icons/all-files/ri/RiLayoutColumnLine","@react-icons/all-files/ri/RiLayoutLeftLine","@react-icons/all-files/ri/RiLayoutRightLine","@react-icons/all-files/ri/RiLink","@react-icons/all-files/ri/RiLinkUnlink","@react-icons/all-files/ri/RiLoginBoxLine","@react-icons/all-files/ri/RiLogoutBoxLine","@react-icons/all-files/ri/RiLoopLeftLine","@react-icons/all-files/ri/RiMapPin5Fill","@react-icons/all-files/ri/RiMarkupFill","@react-icons/all-files/ri/RiMenuLine","@react-icons/all-files/ri/RiMoonFill","@react-icons/all-files/ri/RiMore2Fill","@react-icons/all-files/ri/RiMoreFill","@react-icons/all-files/ri/RiMusic2Fill","@react-icons/all-files/ri/RiPencilFill","@react-icons/all-files/ri/RiPencilLine","@react-icons/all-files/ri/RiPlayFill","@react-icons/all-files/ri/RiQuestionLine","@react-icons/all-files/ri/RiQuestionMark","@react-icons/all-files/ri/RiRoadMapFill","@react-icons/all-files/ri/RiSearchLine","@react-icons/all-files/ri/RiSettings2Line","@react-icons/all-files/ri/RiSquareFill","@react-icons/all-files/ri/RiSquareLine","@react-icons/all-files/ri/RiStarLine","@react-icons/all-files/ri/RiSubtractLine","@react-icons/all-files/ri/RiSunFill","@react-icons/all-files/ri/RiThumbDownFill","@react-icons/all-files/ri/RiThumbDownLine","@react-icons/all-files/ri/RiThumbUpFill","@react-icons/all-files/ri/RiThumbUpLine","@react-icons/all-files/ri/RiUploadLine","@react-icons/all-files/ri/RiUser2Fill","@react-icons/all-files/ri/RiUser3Fill","@react-icons/all-files/ri/RiUserAddFill","@react-icons/all-files/ri/RiUserLine","@react-icons/all-files/ri/RiListUnordered","@react-icons/all-files/ri/RiListCheck","@react-icons/all-files/ri/RiListOrdered","@react-icons/all-files/ri/RiTableView","@react-icons/all-files/ri/RiRefreshLine","@react-icons/all-files/ri/RiArrowDownSFill","@react-icons/all-files/ri/RiItalic","@react-icons/all-files/ri/RiStrikethrough","@react-icons/all-files/ri/RiUnderline","@react-icons/all-files/ri/RiQuoteText","@react-icons/all-files/ri/RiFontColor","@react-icons/all-files/ri/RiMarkPenFill","@react-icons/all-files/ri/RiDragDropLine","@react-icons/all-files/ri/RiNavigationFill","@react-icons/all-files/ri/RiEyeOffFill","@react-icons/all-files/ri/RiCloseCircleFill","@react-icons/all-files/ri/RiDragMoveFill","@react-icons/all-files/ri/RiMapPin2Fill","@react-icons/all-files/ri/RiH1","@react-icons/all-files/ri/RiH2","@react-icons/all-files/ri/RiH3","@react-icons/all-files/ri/RiSeparator","@react-icons/all-files/ri/RiUserForbidFill","@react-icons/all-files/ri/RiArrowGoBackLine","@react-icons/all-files/ri/RiFileCopy2Line","@react-icons/all-files/ri/RiArrowDropDownLine","@react-icons/all-files/ri/RiTimeLine","@react-icons/all-files/ri/RiFocus3Line","@react-icons/all-files/ri/RiArrowUpSFill","@react-icons/all-files/ri/RiRestartLine","@radix-ui/react-dialog","@radix-ui/react-collapsible","@radix-ui/react-slot","react-device-detect","re-resizable","react-transition-group","react-dom","@radix-ui/react-dismissable-layer","@radix-ui/react-toggle-group","@radix-ui/react-toolbar","@radix-ui/react-toast","@radix-ui/react-toggle","react-error-boundary","@floating-ui/react","@table-library/react-table-library/table.js","@table-library/react-table-library/theme.js","@table-library/react-table-library/sort.js","@table-library/react-table-library/select.js","@table-library/react-table-library/pagination.js"],t):(d=typeof globalThis<"u"?globalThis:d||self,t(d.blocks={},d.jsxRuntime,d.themes,d.React,d.reactResponsive,d.useResizeObserver,d.RiAccountBoxLine,d.RiAddLine,d.RiAlertLine,d.RiArrowDownSLine,d.RiArrowLeftDoubleLine,d.RiArrowLeftLine,d.RiArrowLeftSLine,d.RiArrowRightDoubleLine,d.RiArrowRightLine,d.RiArrowRightSLine,d.RiArrowUpLine,d.RiArrowUpSLine,d.RiArticleFill,d.RiAttachment2,d.RiBankCardFill,d.RiBarChartFill,d.RiBardFill,d.RiBold,d.RiBugLine,d.RiBuilding2Fill,d.RiCalendarEventFill,d.RiCalendarFill,d.RiCheckLine,d.RiCheckboxBlankFill,d.RiCircleFill,d.RiCircleLine,d.RiCloseLargeLine,d.RiCloseLine,d.RiColorFilterFill,d.RiCommunityLine,d.RiDeleteBin2Line,d.RiDeleteBin7Fill,d.RiDeleteBin7Line,d.RiDownload2Line,d.RiDraggable,d.RiEqualizerFill,d.RiEqualizerLine,d.RiErrorWarningLine,d.RiExpandDiagonalFill,d.RiExpandDiagonalLine,d.RiExportFill,d.RiExpandUpDownLine,d.RiExternalLinkFill,d.RiExternalLinkLine,d.RiFile3Fill,d.RiFileCopyFill,d.RiFileCopyLine,d.RiFileTextFill,d.RiFilter3Line,d.RiFunctionFill,d.RiHome2Line,d.RiHomeLine,d.RiImportFill,d.RiInformationLine,d.RiInstanceLine,d.RiLayoutColumnLine,d.RiLayoutLeftLine,d.RiLayoutRightLine,d.RiLink,d.RiLinkUnlink,d.RiLoginBoxLine,d.RiLogoutBoxLine,d.RiLoopLeftLine,d.RiMapPin5Fill,d.RiMarkupFill,d.RiMenuLine,d.RiMoonFill,d.RiMore2Fill,d.RiMoreFill,d.RiMusic2Fill,d.RiPencilFill,d.RiPencilLine,d.RiPlayFill,d.RiQuestionLine,d.RiQuestionMark,d.RiRoadMapFill,d.RiSearchLine,d.RiSettings2Line,d.RiSquareFill,d.RiSquareLine,d.RiStarLine,d.RiSubtractLine,d.RiSunFill,d.RiThumbDownFill,d.RiThumbDownLine,d.RiThumbUpFill,d.RiThumbUpLine,d.RiUploadLine,d.RiUser2Fill,d.RiUser3Fill,d.RiUserAddFill,d.RiUserLine,d.RiListUnordered,d.RiListCheck,d.RiListOrdered,d.RiTableView,d.RiRefreshLine,d.RiArrowDownSFill,d.RiItalic,d.RiStrikethrough,d.RiUnderline,d.RiQuoteText,d.RiFontColor,d.RiMarkPenFill,d.RiDragDropLine,d.RiNavigationFill,d.RiEyeOffFill,d.RiCloseCircleFill,d.RiDragMoveFill,d.RiMapPin2Fill,d.RiH1,d.RiH2,d.RiH3,d.RiSeparator,d.RiUserForbidFill,d.RiArrowGoBackLine,d.RiFileCopy2Line,d.RiArrowDropDownLine,d.RiTimeLine,d.RiFocus3Line,d.RiArrowUpSFill,d.RiRestartLine,d.RadixDialogPrimitive,d.RadixPrimitiveCollapsible,d.reactSlot,d.reactDeviceDetect,d.reResizable,d.reactTransitionGroup,d.ReactDOM,d.reactDismissableLayer,d.reactToggleGroup,d.reactToolbar,d.RadixToast,d.Toggle,d.reactErrorBoundary,d.react,d.table_js,d.theme_js,d.sort_js,d.select_js,d.pagination_js))})(this,function(d,t,m,e,Pe,qt,zt,Ut,Ht,Vt,Wt,jt,Gt,Qt,Kt,Xt,Yt,Jt,Zt,en,tn,nn,rn,on,ln,sn,an,cn,dn,un,fn,hn,pn,gn,Cn,mn,vn,Ln,Sn,yn,xn,wn,bn,_n,Fn,kn,En,Tn,Dn,Pn,An,Mn,On,In,$n,Nn,Rn,Bn,qn,zn,Un,Hn,Vn,Wn,jn,Gn,Qn,Kn,Xn,Yn,Jn,Zn,er,ir,tr,nr,rr,or,lr,sr,ar,cr,dr,ur,fr,hr,pr,gr,Cr,mr,vr,Lr,Sr,yr,xr,wr,br,_r,Fr,kr,Er,Tr,Dr,Pr,Ar,Mr,Or,Ir,$r,Nr,Rr,Br,qr,zr,Ur,Hr,Vr,Wr,jr,Gr,Qr,Kr,Xr,Yr,Jr,Zr,eo,io,to,no,Ae,ye,Me,Re,_i,ro,Fi,oo,ii,lo,ki,k,oe,so,Ei,xe,ao){"use strict";function Be(i){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(i){for(const o in i)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(i,o);Object.defineProperty(n,o,r.get?r:{enumerable:!0,get:()=>i[o]})}}return n.default=i,Object.freeze(n)}const le=Be(to),Ti=Be(no),Oe=Be(ii),co=Be(lo);function uo(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Di={exports:{}};/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*/(function(i){(function(){var n={}.hasOwnProperty;function o(){for(var r=[],s=0;s<arguments.length;s++){var l=arguments[s];if(l){var c=typeof l;if(c==="string"||c==="number")r.push(l);else if(Array.isArray(l)){if(l.length){var a=o.apply(null,l);a&&r.push(a)}}else if(c==="object"){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){r.push(l.toString());continue}for(var u in l)n.call(l,u)&&l[u]&&r.push(u)}}}return r.join(" ")}i.exports?(o.default=o,i.exports=o):window.classNames=o})()})(Di);var fo=Di.exports;const F=uo(fo);function de(i,n){return e.useMemo(()=>{if(i!==void 0)if(typeof i=="object"){if(!("initial"in i))throw new Error("Expected initial property to be set in Responsive object");return Object.fromEntries(Object.entries(i).map(([o,r])=>[o,n[r]]))}else return n[i]},[n,i])}const ho={success:"green",danger:"red",warning:"amber",info:"gray"},Q=i=>{const n=m.useThemeContext();if(i)return i==="primary"?n.accentColor:ho[i]},Pi=()=>{const[i,n]=e.useState("initial"),[o,r]=e.useState("initial"),s=Pe.useMediaQuery({minWidth:"520px"}),l=Pe.useMediaQuery({minWidth:"768px"}),c=Pe.useMediaQuery({minWidth:"1024px"}),a=Pe.useMediaQuery({minWidth:"1280px"}),u=Pe.useMediaQuery({minWidth:"1640px"});return e.useLayoutEffect(()=>{r(f=>(n(f),u?"xl":a?"lg":c?"md":l?"sm":s?"xs":"initial"))},[a,c,l,u,s]),{size:o,prevSize:i,xs:s,sm:l,md:c,lg:a,xl:u}},ti=(i,n,o)=>{const[r,s]=e.useState([]),[l,c]=e.useState(!0),a=e.useCallback(p=>{const{repeat:h,key:C}=p;c(!0),!(h||r.includes(C))&&s(v=>[...v,C])},[r]),u=e.useCallback(p=>{const{key:h}=p;c(!1),r.includes(h)&&s(C=>{const v=[...C];return v.splice(C.indexOf(h),1),v})},[r]);e.useEffect(()=>(n||document.addEventListener("keydown",a,!0),()=>{document.removeEventListener("keydown",a,!0)}),[n,a]),e.useEffect(()=>(n||document.addEventListener("keyup",u,!0),()=>{document.removeEventListener("keyup",u,!0)}),[n,u]);const f=e.useMemo(()=>!n&&l&&r.length===i.length&&r.every(p=>i.includes(p)),[n,l,r,i]);return e.useEffect(()=>{f&&o()},[f,o]),f},po=i=>{const n=[];for(const o of e.Children.toArray(i))e.isValidElement(o)&&n.push(o);return n},go=()=>e.useCallback(i=>{i.stopPropagation()},[]);function Co(i,n){const[o,r]=e.useState([]),[s,l]=e.useState("");return e.useEffect(()=>{r(i.filter(c=>n(c,s)))},[n,s,i]),[o,s,l]}const mo=i=>{const[n,o]=e.useState();e.useLayoutEffect(()=>{var s;o((s=i.current)==null?void 0:s.getBoundingClientRect())},[i]);const r=e.useCallback(s=>{const l=s.contentRect;o(l)},[]);return qt(i,r),n},Ai=(i,n)=>{const o=i.indexOf(" ",n),r=o===-1?i:i.substring(0,o),s=o===-1?"":i.substring(o);return[r,s]},Mi=e.memo;function Oi(i){const{size:n}=Pi();if(i==null)return i;if(typeof i=="object")if("initial"in i)switch(n){case"xl":if(i.xl!==void 0)return i.xl;case"lg":if(i.lg!==void 0)return i.lg;case"md":if(i.md!==void 0)return i.md;case"sm":if(i.sm!==void 0)return i.sm;case"xs":if(i.xs!==void 0)return i.xs;case"initial":return i.initial}else throw new Error("Expected initial property to be set in Responsive object");return i}function ni(i){const{state:n,setState:o,initialState:r}=i,[s,l]=e.useState(r);return[n!==void 0?n:s,o!==void 0?o:l]}const vo=e.forwardRef(function({className:n,severity:o="primary",color:r,children:s,...l},c){const a=Q(o);return t.jsx(m.Badge,{className:F("overmap-badge",n),ref:c,color:r||a,...l,children:s})}),Lo=e.memo(vo),ri={zeroMinWidth:"_zeroMinWidth_curjh_1",zeroMinHeight:"_zeroMinHeight_curjh_5",radius:"_radius_curjh_9"},se=e.memo(e.forwardRef(({className:i,radius:n=!1,children:o,zeroMinWidth:r=!1,zeroMinHeight:s=!1,...l},c)=>t.jsx(m.Flex,{className:F(i,{[ri.radius]:n,[ri.zeroMinWidth]:r,[ri.zeroMinHeight]:s}),ref:c,...l,children:o}))),Ii=e.createContext({}),So=()=>e.useContext(Ii),yo=e.memo(e.forwardRef(({className:i,children:n,...o},r)=>{const{size:s,severity:l}=So(),c=Q(l);return t.jsx(m.Box,{className:F("overmap-breadcrumb-item",i),height:"max-content",width:"max-content",children:t.jsx(m.Link,{ref:r,size:s,color:c,...o,children:t.jsx(se,{height:"100%",width:"100%",align:"center",gap:"1",children:n})})})})),xo={Group:e.memo(e.forwardRef(({className:i,children:n,separator:o,severity:r="info",size:s,gap:l="2",...c},a)=>{const u=Q(r),f=po(n);return t.jsx(Ii.Provider,{value:{size:s,severity:r},children:t.jsx(se,{className:F("overmap-breadcrumb-group",i),ref:a,gap:l,role:"breadcrumb",height:"max-content",width:"max-content",...c,children:f.map((p,h)=>t.jsxs(t.Fragment,{children:[e.cloneElement(p,{key:h}),f.length-1!==h&&t.jsx(m.Text,{color:u,children:t.jsx(se,{height:"100%",width:"100%",align:"center",children:o})})]}))})})})),Item:yo},Ie={fluid:"_fluid_r73gr_1",hoverSpin90Clockwise:"_hoverSpin90Clockwise_r73gr_15",hoverSpin180Clockwise:"_hoverSpin180Clockwise_r73gr_25",hoverSpin360Clockwise:"_hoverSpin360Clockwise_r73gr_35"},$i={spin90Clockwise:Ie.hoverSpin90Clockwise,spin180Clockwise:Ie.hoverSpin180Clockwise,spin360Clockwise:Ie.hoverSpin360Clockwise},wo={role:"button",tabIndex:0,onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&i.currentTarget.click()}},we={small:"1",medium:"2",large:"3"},Ni=e.createContext({}),oi=()=>e.useContext(Ni),bo={spinner:"_spinner_1oknc_9",spin:"_spin_1oknc_9"},qe=e.memo(()=>t.jsx("div",{className:bo.spinner}));qe.displayName="Spinner";const _o=e.forwardRef(function(n,o){const r=oi(),{className:s,type:l="button",fluid:c=r.fluid??!1,size:a=r.size??"medium",severity:u=r.severity??"primary",hoverEffects:f=r.hoverEffects??[],variant:p=r.variant,highContrast:h=r.highContrast??!1,shortcut:C={keys:[],action:()=>{},disabled:!1},loading:v,children:L,disabled:x,...g}=n,w=Q(u),b=f.map(y=>$i[y]);return ti(C.keys,C.disabled||C.keys.length===0,C.action),t.jsx(m.Button,{ref:o,type:l,className:F(s,b,{[Ie.fluid]:c}),color:w,size:de(a,we),variant:p,disabled:v||x,highContrast:h,...g,children:v?t.jsx(qe,{}):L})}),be=e.memo(_o),Fo=e.forwardRef(function(n,o){const r=oi(),{className:s,children:l,type:c="button",fluid:a=r.fluid??!1,size:u=r.size??"medium",severity:f=r.severity??"primary",hoverEffects:p=r.hoverEffects??[],variant:h=r.variant,highContrast:C=r.highContrast??!1,shortcut:v={keys:[],action:()=>{},disabled:!1},...L}=n,x=Q(f),g=(p==null?void 0:p.map(w=>$i[w]))||[];return ti(v.keys,v.disabled||v.keys.length===0,v.action),t.jsx(m.IconButton,{className:F(s,g,{[Ie.fluid]:a}),ref:o,color:x,size:de(u,we),variant:h,type:c,highContrast:C,...L,children:l})}),K=e.memo(Fo),ko={merged:"_merged_wdgxo_1"},Eo={row:{small:"4",medium:"4",large:"5"},column:{small:"2",medium:"3",large:"4"}},To=e.forwardRef(function({className:n,merged:o=!1,children:r,gap:s,direction:l="row",severity:c,size:a="medium",variant:u,hoverEffects:f,fluid:p,highContrast:h,...C},v){const L=de(a,Eo[l]),x=u==="ghost"?L:"0";return t.jsx(m.Flex,{className:F("overmap-button-group",n,{[ko.merged]:o}),ref:v,gap:o?s??x:s??"2",direction:l,"data-direction":l,...C,children:t.jsx(Ni.Provider,{value:{size:a,severity:c,variant:u,hoverEffects:f,fluid:p,highContrast:h},children:r})})}),li=e.memo(To),Do={separators:"_separators_1f7v1_1"},Po=e.memo(e.forwardRef((i,n)=>{const{children:o,border:r,before:s,after:l,size:c}=i,a=r?"surface":"ghost",u=de(c,we),f=s&&l?t.jsx(m.Inset,{side:"x",pt:"current",pb:"current",children:o}):s?t.jsx(m.Inset,{side:"bottom",pt:"current",children:o}):l?t.jsx(m.Inset,{side:"top",pb:"current",children:o}):t.jsx(m.Inset,{children:o}),p=t.jsxs(m.Card,{ref:n,size:u,variant:a,children:[s,f,l]});return a==="ghost"?t.jsx(m.Box,{p:"3",children:p}):p})),Ao=e.memo(e.forwardRef((i,n)=>{const{children:o,variant:r="outline",size:s,className:l,...c}=i,a=r==="outline"||r==="surface",u=r==="outline"?"ghost":r==="surface"?"soft":r;return t.jsx(Po,{...c,border:a,size:s,children:t.jsx(li,{size:s,severity:"info",variant:u,className:F(l,Do.separators),merged:!0,gap:"0",direction:"column",ref:n,children:o})})})),Mo=e.memo(e.forwardRef((i,n)=>{const{variant:o}=oi(),r=t.jsx(be,{ref:n,...i,radius:"large",variant:o});return o==="ghost"?t.jsx(m.Box,{asChild:!0,my:"1",mx:"2",children:r}):r})),Oo={Root:Ao,Item:Mo},si={RiAccountBoxLine:zt.RiAccountBoxLine,RiAddLine:Ut.RiAddLine,RiAlertLine:Ht.RiAlertLine,RiArrowDownSFill:Pr.RiArrowDownSFill,RiArrowDownSLine:Vt.RiArrowDownSLine,RiArrowDropDownLine:Yr.RiArrowDropDownLine,RiArrowGoBackLine:Kr.RiArrowGoBackLine,RiArrowLeftDoubleLine:Wt.RiArrowLeftDoubleLine,RiArrowLeftLine:jt.RiArrowLeftLine,RiArrowLeftSLine:Gt.RiArrowLeftSLine,RiArrowRightDoubleLine:Qt.RiArrowRightDoubleLine,RiArrowRightLine:Kt.RiArrowRightLine,RiArrowRightSLine:Xt.RiArrowRightSLine,RiArrowUpLine:Yt.RiArrowUpLine,RiArrowUpSFill:eo.RiArrowUpSFill,RiArrowUpSLine:Jt.RiArrowUpSLine,RiArticleFill:Zt.RiArticleFill,RiAttachment2:en.RiAttachment2,RiBankCardFill:tn.RiBankCardFill,RiBarChartFill:nn.RiBarChartFill,RiBardFill:rn.RiBardFill,RiBold:on.RiBold,RiBugLine:ln.RiBugLine,RiBuilding2Fill:sn.RiBuilding2Fill,RiCalendarEventFill:an.RiCalendarEventFill,RiCalendarFill:cn.RiCalendarFill,RiCheckLine:dn.RiCheckLine,RiCheckboxBlankFill:un.RiCheckboxBlankFill,RiCircleFill:fn.RiCircleFill,RiCircleLine:hn.RiCircleLine,RiCloseCircleFill:zr.RiCloseCircleFill,RiCloseLargeLine:pn.RiCloseLargeLine,RiCloseLine:gn.RiCloseLine,RiColorFilterFill:Cn.RiColorFilterFill,RiCommunityLine:mn.RiCommunityLine,RiDeleteBin2Line:vn.RiDeleteBin2Line,RiDeleteBin7Fill:Ln.RiDeleteBin7Fill,RiDeleteBin7Line:Sn.RiDeleteBin7Line,RiDownload2Line:yn.RiDownload2Line,RiDragDropLine:Rr.RiDragDropLine,RiDragMoveFill:Ur.RiDragMoveFill,RiDraggable:xn.RiDraggable,RiEqualizerFill:wn.RiEqualizerFill,RiEqualizerLine:bn.RiEqualizerLine,RiErrorWarningLine:_n.RiErrorWarningLine,RiExpandDiagonalFill:Fn.RiExpandDiagonalFill,RiExpandDiagonalLine:kn.RiExpandDiagonalLine,RiExpandUpDownLine:Tn.RiExpandUpDownLine,RiExportFill:En.RiExportFill,RiExternalLinkFill:Dn.RiExternalLinkFill,RiExternalLinkLine:Pn.RiExternalLinkLine,RiEyeOffFill:qr.RiEyeOffFill,RiFile3Fill:An.RiFile3Fill,RiFileCopy2Line:Xr.RiFileCopy2Line,RiFileCopyFill:Mn.RiFileCopyFill,RiFileCopyLine:On.RiFileCopyLine,RiFileTextFill:In.RiFileTextFill,RiFilter3Line:$n.RiFilter3Line,RiFocus3Line:Zr.RiFocus3Line,RiFontColor:$r.RiFontColor,RiFunctionFill:Nn.RiFunctionFill,RiH1:Vr.RiH1,RiH2:Wr.RiH2,RiH3:jr.RiH3,RiHome2Line:Rn.RiHome2Line,RiHomeLine:Bn.RiHomeLine,RiImportFill:qn.RiImportFill,RiInformationLine:zn.RiInformationLine,RiInstanceLine:Un.RiInstanceLine,RiItalic:Ar.RiItalic,RiLayoutColumnLine:Hn.RiLayoutColumnLine,RiLayoutLeftLine:Vn.RiLayoutLeftLine,RiLayoutRightLine:Wn.RiLayoutRightLine,RiLink:jn.RiLink,RiLinkUnlink:Gn.RiLinkUnlink,RiListCheck:kr.RiListCheck,RiListOrdered:Er.RiListOrdered,RiListUnordered:Fr.RiListUnordered,RiLoginBoxLine:Qn.RiLoginBoxLine,RiLogoutBoxLine:Kn.RiLogoutBoxLine,RiLoopLeftLine:Xn.RiLoopLeftLine,RiMapPin2Fill:Hr.RiMapPin2Fill,RiMapPin5Fill:Yn.RiMapPin5Fill,RiMarkPenFill:Nr.RiMarkPenFill,RiMarkupFill:Jn.RiMarkupFill,RiMenuLine:Zn.RiMenuLine,RiMoonFill:er.RiMoonFill,RiMore2Fill:ir.RiMore2Fill,RiMoreFill:tr.RiMoreFill,RiMusic2Fill:nr.RiMusic2Fill,RiNavigationFill:Br.RiNavigationFill,RiPencilFill:rr.RiPencilFill,RiPencilLine:or.RiPencilLine,RiPlayFill:lr.RiPlayFill,RiQuestionLine:sr.RiQuestionLine,RiQuestionMark:ar.RiQuestionMark,RiQuoteText:Ir.RiQuoteText,RiRefreshLine:Dr.RiRefreshLine,RiRestartLine:io.RiRestartLine,RiRoadMapFill:cr.RiRoadMapFill,RiSearchLine:dr.RiSearchLine,RiSeparator:Gr.RiSeparator,RiSettings2Line:ur.RiSettings2Line,RiSquareFill:fr.RiSquareFill,RiSquareLine:hr.RiSquareLine,RiStarLine:pr.RiStarLine,RiStrikethrough:Mr.RiStrikethrough,RiSubtractLine:gr.RiSubtractLine,RiSunFill:Cr.RiSunFill,RiTableView:Tr.RiTableView,RiThumbDownFill:mr.RiThumbDownFill,RiThumbDownLine:vr.RiThumbDownLine,RiThumbUpFill:Lr.RiThumbUpFill,RiThumbUpLine:Sr.RiThumbUpLine,RiTimeLine:Jr.RiTimeLine,RiUnderline:Or.RiUnderline,RiUploadLine:yr.RiUploadLine,RiUser2Fill:xr.RiUser2Fill,RiUser3Fill:wr.RiUser3Fill,RiUserAddFill:br.RiUserAddFill,RiUserForbidFill:Qr.RiUserForbidFill,RiUserLine:_r.RiUserLine},Ri="15px",M=e.memo(i=>{const{size:n=Ri,icon:o,...r}=i;let s=i.icon;(!s||!si[s])&&(console.error(`You have specified an icon that is not in the list of used icons: ${s}`),s="RiQuestionMark");const l=si[s];return l||console.error(`You have specified an icon that is not in the list of used icons: ${s}`),t.jsx(l,{...r,size:n})});M.displayName="IconComponent";const Io=e.memo(function(n){const{title:o,description:r,content:s,closeDialog:l}=n;return t.jsxs(m.Flex,{direction:"column",gap:"2",grow:"1",children:[t.jsxs(m.Flex,{direction:"column",gap:"1",children:[t.jsxs(m.Flex,{justify:"between",children:[t.jsx(m.Dialog.Title,{mb:"0",children:o}),t.jsx(m.Dialog.Close,{children:t.jsx(m.IconButton,{color:"gray",variant:"ghost","aria-label":"Close",children:t.jsx(M,{icon:"RiCloseLargeLine"})})})]}),r&&t.jsx(m.Dialog.Description,{children:r})]}),s(l)]})}),$o=e.memo(e.forwardRef((i,n)=>{const{children:o,content:r,title:s,description:l,onOpen:c,onClose:a,defaultOpen:u,onCloseInterrupt:f,open:p,onOpenChange:h,...C}=i,[v,L]=e.useState(u??!1),x=p??v;if((f||c)&&h)throw new Error("Neither the `onCloseInterrupt` nor `onOpen` props can be used with `onOpenChange`.");if(p!==void 0&&h===void 0)throw new Error("The `open` prop requires the `onOpenChange` prop.");if(!o&&p===void 0)throw new Error("Either the `children` or `open` prop must be defined.");if(o&&p!==void 0)throw new Error("The `children` and `open` props cannot be used together.");const g=e.useCallback(b=>{if(h)return h(b);if(b&&c)c();else{if(!b&&f)return f(()=>{L(!1),a&&a()});!b&&a&&a()}L(b)},[h,c,a,f]),w=e.useCallback(b=>{if(b!=null&&b.force)return L(!1);g(!1)},[g]);return t.jsxs(m.Dialog.Root,{open:x,onOpenChange:g,children:[t.jsx(m.Dialog.Trigger,{children:o}),t.jsx(m.Dialog.Content,{ref:n,...C,children:t.jsx(Io,{closeDialog:w,content:r,title:s,description:l})})]})})),No=(i,n)=>e.useCallback((...o)=>r=>{i(...o),r(n)},[i,n]),Bi=i=>t.jsx(m.AlertDialog.Title,{mb:"0",...i}),Ro=i=>{const{title:n,description:o,actionText:r="Confirm",cancelText:s="Cancel",onAction:l,onCancel:c,severity:a}=i;return t.jsxs(m.Flex,{direction:"column",gap:"2",children:[t.jsxs(m.Flex,{direction:"column",gap:"1",children:[t.jsx(Bi,{children:n}),t.jsx(m.AlertDialog.Description,{children:o})]}),t.jsxs(m.Flex,{gap:"3",mt:"4",justify:"end",children:[t.jsx(m.AlertDialog.Cancel,{children:t.jsx(be,{variant:"soft",severity:"info",onClick:c,children:s})}),t.jsx(m.AlertDialog.Action,{children:t.jsx(be,{variant:"solid",severity:a,onClick:l,children:r})})]})]})},qi=e.memo(function(n){const{open:o,setOpen:r,children:s,...l}=n,c=e.useMemo(()=>({close:()=>r(!1),Title:Bi,Description:m.AlertDialog.Description}),[r]);return t.jsxs(m.AlertDialog.Root,{open:o,onOpenChange:r,children:[t.jsx(m.AlertDialog.Content,{children:"content"in l?l.content(c):t.jsx(Ro,{...l})}),s]})}),ai=e.createContext(()=>{throw new Error("No AlertDialogProvider found")}),Bo={content:()=>null},qo=e.memo(function({children:n}){const[o,r]=e.useState(!1),[s,l]=e.useState(Bo),c=e.useCallback(a=>{if(o)throw new Error("AlertDialog is already open");l(a),r(!0)},[o]);return t.jsx(qi,{open:o,setOpen:r,...s,children:t.jsx(ai.Provider,{value:c,children:n})})}),zi=()=>e.useContext(ai),zo=()=>{const i=zi();return e.useCallback(n=>i({title:"Discard changes?",description:"You have unsaved changes. Are you sure you want to discard them?",actionText:"Discard",severity:"danger",onAction:n.onDiscard,onCancel:n.onCancel}),[i])},Uo=e.memo(e.forwardRef((i,n)=>{const{children:o,defaultOpen:r=!1,onInterruptClose:s,content:l,onClose:c,open:a,onOpenChange:u,className:f,style:p,overlay:h=!1,overlayClass:C,overlayStyle:v}=i,[L,x]=e.useState(r??!1),g=e.useMemo(()=>a!==void 0?a:L,[a,L]),w=e.useCallback(y=>{u?u(y):!y&&s?s(()=>{x(!1),c&&c()}):y?x(y):(x(!1),c&&c())},[u,c,s]),b=e.useCallback(y=>{y!=null&&y.force?x(!1):w(!1)},[w]);return t.jsxs(le.Root,{open:g,onOpenChange:w,modal:h,children:[o!==void 0&&t.jsx(le.Trigger,{children:o}),t.jsx(le.Portal,{children:t.jsxs(t.Fragment,{children:[h&&t.jsx(m.Theme,{asChild:!0,children:t.jsx(le.Overlay,{className:C,style:v})}),t.jsx(m.Theme,{asChild:!0,children:t.jsx(le.Content,{className:f,style:p,ref:n,children:l(b)})})]})})]})})),Ui={OverlayContent:"_OverlayContent_1nr9w_1",OverlayOverlay:"_OverlayOverlay_1nr9w_6"},Ho=e.memo(e.forwardRef((i,n)=>{const{className:o,overlayClass:r,...s}=i;return t.jsx(Uo,{ref:n,overlayClass:F("overmap-overlay-overlay",Ui.OverlayOverlay,r),className:F("overmap-overlay-content",Ui.OverlayContent,o),...s})})),Hi=e.createContext({});function Vo(){return e.useContext(Hi)}const Wo={1:{gap:"1",px:"2",height:"5",fontSize:"var(--font-size-2)"},2:{gap:"2",px:"2",height:"6",fontSize:"var(--font-size-2)"},3:{gap:"2",px:"3",height:"7",fontSize:"var(--font-size-3)"},4:{gap:"2",px:"4",height:"8",fontSize:"var(--font-size-3)"},5:{gap:"3",px:"5",height:"9",fontSize:"var(--font-size-4)"}},Vi=e.createContext({}),Wi=()=>e.useContext(Vi),ze=e.memo(i=>{const{size:n,children:o,compact:r=!1}=i;return t.jsx(Vi.Provider,{value:{size:n,compact:r},children:o})});ze.displayName="OvermapItemGroup";const Ue=e.memo(e.forwardRef((i,n)=>{const o=Wi(),{leftSlot:r,compact:s=o.compact,rightSlot:l,children:c,size:a=o.size,style:u,...f}=i,p=Oi(a),{fontSize:h,...C}=Wo[p??"2"];return t.jsxs(m.Flex,{ref:n,align:"center",shrink:"0",style:{fontSize:h,...u},...C,...f,width:s?C.height:void 0,children:[!s&&r&&t.jsx(m.Flex,{width:"max-content",height:"max-content",align:"center",children:r}),t.jsx(m.Flex,{height:"max-content",align:"center",grow:"1",justify:s?"center":void 0,children:c}),!s&&l&&t.jsx(m.Flex,{width:"max-content",height:"max-content",align:"center",children:l})]})})),ji=Mi(function(i){const{meta:n,nodes:o,level:r=0,disabled:s}=i,[l,c]=e.useState(!1),{nodeRenderer:a,disabled:u,nodeGap:f,onNodeOpen:p,onNodeClose:h,onNodeClick:C,nodeStyles:v,nodeClassName:L,levelGap:x}=Vo(),g=s??u,w=e.useCallback(()=>{C&&C(n)},[n,C]),b=e.useCallback(()=>{c(!l),!l&&p&&p(n),l&&h&&h(n)},[n,h,p,l]),{children:y,leftSlot:E,rightSlot:A,style:P,className:T}=e.useMemo(()=>a({meta:n,toggleOpen:b,open:l,disabled:g}),[g,n,a,b,l]),V=e.useMemo(()=>({...v,...P}),[v,P]);return t.jsx(Ti.Root,{asChild:!0,open:l,disabled:g,children:t.jsxs(m.Flex,{width:"100%",direction:"column",children:[t.jsx(Ue,{onClick:w,disabled:s??u,className:F(L,T),style:V,leftSlot:E,rightSlot:A,"data-state":l?"open":"closed","data-disabled":g,children:y}),o&&o.length>0&&t.jsx(Ti.Content,{asChild:!0,children:t.jsx(m.Flex,{width:"100%",pl:x,height:"max-content",direction:"column",gap:f,pt:f,children:o.map((W,q)=>t.jsx(ji,{level:r+1,...W},`${r},${q}`))})})]})})}),jo=Mi(function(i){const{nodes:n,disabled:o=!1,nodeClassName:r,nodeStyles:s,size:l="2",nodeGap:c="0",levelGap:a="2",onNodeClick:u,onNodeClose:f,onNodeOpen:p,nodeRenderer:h,...C}=i;return t.jsx(Hi.Provider,{value:{nodeRenderer:h,nodeGap:c,levelGap:a,nodeClassName:r,nodeStyles:s,disabled:o,onNodeClick:u,onNodeClose:f,onNodeOpen:p},children:t.jsx(ze,{size:l,children:t.jsx(m.Flex,{width:"100%",height:"max-content",direction:"column",gap:c,...C,children:n.map((v,L)=>t.jsx(ji,{...v},`0,${L}`))})})})}),Gi=e.memo(i=>{const{children:n,file:o}=i,r=e.useRef(null),s=e.useMemo(()=>URL.createObjectURL(o),[o]),l=e.useCallback(()=>{r.current&&r.current.click()},[]);return t.jsxs(t.Fragment,{children:[t.jsx(Ae.Slot,{onClick:l,children:n}),t.jsx("a",{style:{display:"none"},href:s,target:"_blank",rel:"noreferrer",ref:r})]})});Gi.displayName="DownloadButtonUtility";const He=e.memo(function({children:n}){const[o,r]=e.useState(ye.isMobile),s=e.useCallback(()=>{r(!0)},[]),l=e.useCallback(()=>{r(ye.isMobile)},[]);return n({isHovered:o,onPointerEnter:s,onPointerLeave:l})}),Qi={fluid:"_fluid_7n1wr_1"},Go=e.forwardRef(function({className:n,fluid:o,size:r="medium",variant:s="surface",severity:l="primary",itemSeverity:c="info",placeholder:a="Select",side:u,items:f=[],value:p,id:h,...C},v){const L=de(r,we),x=Q(l),g=Q(c);return e.createElement(m.Select.Root,{size:L,...C,key:p===void 0?1:0,value:p},t.jsx(m.Select.Trigger,{className:F(n,{[Qi.fluid]:o}),id:h,ref:v,variant:s,placeholder:a,color:x}),t.jsx(m.Select.Content,{side:u,className:Qi.contentDefault,position:"popper",variant:s!=="surface"?"soft":"solid",color:g,children:f.map(({itemContent:w,value:b,...y})=>t.jsx(m.Select.Item,{className:"overmap-select-item",value:b,...y,children:w},b))}))}),Ki=e.memo(Go),Xi=e.memo(e.forwardRef((i,n)=>{const{checked:o,label:r,value:s,size:l="2"}=i;return t.jsx(m.Box,{asChild:!0,px:l,children:t.jsx(m.Select.Item,{value:s,ref:n,children:t.jsxs(m.Flex,{gap:l,align:"center",children:[t.jsx(m.Checkbox,{checked:o}),r]})})})})),Ve="__select_all__",Qo=e.memo(e.forwardRef((i,n)=>{const[o,r]=e.useState(!1),{placeholder:s,value:l,onValueChange:c,options:a,disabled:u,name:f,...p}=i,h=de(i.size,we),C=Q(i.severity),v=e.useMemo(()=>new Map(a.map(b=>[b.value,b.label])),[a]),L=l.length>4?`${l.length} options selected`:t.jsx("span",{children:l.flatMap(b=>[v.get(b),", "]).slice(0,-1)}),x=e.useCallback(()=>r(!1),[]),g=e.useCallback(b=>{b&&r(!0)},[]),w=e.useCallback(b=>{let y;b===Ve?y=l.length===a.length?[]:a.map(A=>A.value):y=l.includes(b)?l.filter(E=>E!==b):[...l,b],c(y)},[c,a,l]);return e.useEffect(()=>{if(a.some(({value:b})=>b===Ve))throw new Error(`Cannot have an option with the value "${Ve}"`)},[a]),t.jsxs(m.Select.Root,{open:o,value:"",onOpenChange:g,onValueChange:w,disabled:u,size:h,name:f,autoComplete:"off",children:[t.jsx(m.Select.Trigger,{ref:n,color:C,placeholder:l.length>0?L:s,"data-placeholder":l.length>0?void 0:!0,...p}),t.jsxs(m.Select.Content,{color:"gray",variant:"soft",position:"popper",onEscapeKeyDown:x,onPointerDownOutside:x,children:[t.jsx(Xi,{value:Ve,label:"Select all",checked:l.length===a.length,size:h}),a.map(b=>t.jsx(Xi,{...b,checked:l.includes(b.value),size:h},b.value))]})]})})),Ko={default:"_default_u936h_1"},Xo=e.forwardRef(function({className:n,severity:o="primary",icon:r,defaultChecked:s=!1,onCheckedChange:l,...c},a){const u=e.useRef(null),[f,p]=e.useState(c.checked?c.checked:s),[h,C]=e.useState(),v=Q(o);e.useLayoutEffect(()=>{var w;const g=a||u;"current"in g&&g.current&&C((w=g.current)==null?void 0:w.querySelector("span.rt-SwitchThumb"))},[a]);const L=e.useCallback(g=>{p(g),l&&l(g)},[l]),x=c.checked?c.checked:f;return t.jsxs(t.Fragment,{children:[t.jsx(m.Switch,{className:F("overmap-switch",n,Ko.default),ref:a||u,color:v,radius:"full",defaultChecked:s,onCheckedChange:L,...c}),t.jsx(m.Portal,{container:h,asChild:!0,children:r&&"checked"in r?x?r.checked:r.unchecked:r})]})}),Yo=e.memo(Xo),_e={sidebarContent:"_sidebarContent_1onyo_1",right:"_right_1onyo_7",resizeHandle:"_resizeHandle_1onyo_10",left:"_left_1onyo_13",overlay:"_overlay_1onyo_33"},Jo={width:"auto",height:"100%"},Zo=e.forwardRef(function({side:n="left",modal:o=!0,children:r,open:s,containerSelector:l,overlay:c=!0,resizable:a=!0,minWidth:u="300px",maxWidth:f="500px",...p},h){const C=n==="right",v=n==="left",[L,x]=e.useState();return e.useEffect(()=>{const g=l??'[data-is-root-theme="true"]',w=document.querySelector(g);if(w===void 0)throw new Error(`Could not find a container element using the following selector ${g}`);x(w)},[l]),t.jsx(le.Root,{open:s,modal:o,children:t.jsxs(le.Portal,{container:L,children:[c&&t.jsx(le.Overlay,{className:F(_e.overlay)}),t.jsx(le.Content,{className:F("overmap-sidebar","rt-DialogContent",_e.sidebarContent,{[_e.left]:v,[_e.right]:C}),ref:h,asChild:!0,...p,children:t.jsx(m.Box,{width:"auto",children:t.jsx(Me.Resizable,{minWidth:u,maxWidth:f,defaultSize:Jo,enable:{right:a&&v,left:a&&C},handleClasses:{left:_e.resizeHandle,right:_e.resizeHandle},handleComponent:{right:t.jsx(M,{icon:"RiDraggable"}),left:t.jsx(M,{icon:"RiDraggable"})},children:r})})})]})})}),el=e.memo(Zo),ci=e.createContext({}),Ce=()=>e.useContext(ci),Yi=e.memo(i=>{const{children:n,small:o=!1,hideLayout:r=!1}=i,[s,l]=e.useState(!1),[c,a]=e.useState(!1),u=e.useMemo(()=>({small:o,hideLayout:r,showLeftSlideOut:s,setShowLeftSlideOut:l,showRightSlideOut:c,setShowRightSlideOut:a}),[r,s,c,o]);return t.jsx(ci.Provider,{value:u,children:n})});Yi.displayName="Layout.Root";const il=e.memo(e.forwardRef((i,n)=>{const{children:o,style:r,grow:s="1",height:l="100%",position:c,...a}=i,{hideLayout:u=!1}=Ce();return!u&&t.jsx(m.Flex,{ref:n,grow:s,height:l,position:c,style:r,...a,children:o})})),tl=e.memo(e.forwardRef((i,n)=>{const{className:o,style:r,active:s,side:l,smallModeOnly:c=!1}=i,{small:a,hideLayout:u,showLeftSlideOut:f,showRightSlideOut:p}=Ce();return e.useMemo(()=>s!==void 0?s:u||c&&!a?!1:l==="left"?f:p,[s,u,f,p,l,a,c])&&t.jsx(m.Flex,{className:F("overmap-layout-overlay",o),style:{...r},ref:n,position:"absolute",inset:"0"})}));function nl(i,n=globalThis==null?void 0:globalThis.document.body){const o=ll(i),r=e.useRef(!1),s=e.useRef(()=>{});return e.useEffect(()=>{const l=a=>{if(a.target&&!r.current){const u={originalEvent:a},f=()=>{ol("pointerDownOutside",o,u,{discrete:!0})};a.pointerType==="touch"?(n.removeEventListener("click",s.current),s.current=f,n.addEventListener("click",s.current,{once:!0})):f()}else n.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{n.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),n.removeEventListener("pointerdown",l),n.removeEventListener("click",s.current)}},[n,o]),{onPointerDownCapture:()=>r.current=!0}}function rl(i,n){i&&_i.flushSync(()=>i.dispatchEvent(n))}function ol(i,n,o,{discrete:r}){const s=o.originalEvent.target,l=new CustomEvent(i,{bubbles:!1,cancelable:!0,detail:o});n&&s.addEventListener(i,n,{once:!0}),r?rl(s,l):s.dispatchEvent(l)}function ll(i){const n=e.useRef(i);return e.useEffect(()=>{n.current=i}),e.useMemo(()=>(...o)=>{var r;return(r=n.current)==null?void 0:r.call(n,...o)},[])}const ee={EnterRight:"_EnterRight_1jwyv_2",EnterActiveRight:"_EnterActiveRight_1jwyv_6",EnterDoneRight:"_EnterDoneRight_1jwyv_11",ExitRight:"_ExitRight_1jwyv_15",ExitActiveRight:"_ExitActiveRight_1jwyv_19",ExitDoneRight:"_ExitDoneRight_1jwyv_24",EnterLeft:"_EnterLeft_1jwyv_29",EnterActiveLeft:"_EnterActiveLeft_1jwyv_33",EnterDoneLeft:"_EnterDoneLeft_1jwyv_38",ExitLeft:"_ExitLeft_1jwyv_42",ExitActiveLeft:"_ExitActiveLeft_1jwyv_46",ExitDoneLeft:"_ExitDoneLeft_1jwyv_51",Overlay:"_Overlay_1jwyv_56"},sl=200,Ji=e.memo(e.forwardRef((i,n)=>{const{className:o,style:r,children:s,open:l,hide:c=!1,modal:a=!1,overlayComponent:u,resizeable:f=!0,side:p,position:h="relative",initialWidth:C,minWidth:v,maxWidth:L,onDismiss:x,onOpening:g,onClosed:w,content:b}=i,y=p==="left",[E,A]=e.useState(document.body),P=e.useRef(null),[T,V]=e.useState(C),W=e.useCallback((R,Z,J,Le)=>{V(J.clientWidth)},[]),q=e.useCallback(()=>{a&&x&&x()},[a,x]),j=e.useCallback(R=>{R&&A(R)},[]);e.useEffect(()=>{V(C)},[C]),e.useEffect(()=>{if(!P.current)return;const R=P.current.style.pointerEvents;return l&&a&&(P.current.style.pointerEvents="none"),()=>{P.current&&(P.current.style.pointerEvents=R)}},[a,l,E.style]);const{onPointerDownCapture:G}=nl(q,E),$=e.useMemo(()=>({enter:y?ee.EnterLeft:ee.EnterRight,enterActive:y?ee.EnterActiveLeft:ee.EnterActiveRight,enterDone:y?ee.EnterDoneLeft:ee.EnterDoneRight,exit:y?ee.ExitLeft:ee.ExitRight,exitActive:y?ee.ExitActiveLeft:ee.ExitActiveRight,exitDone:y?ee.ExitDoneLeft:ee.ExitDoneRight}),[y]),Y=e.useMemo(()=>({width:T,height:"100%"}),[T]),he=e.useMemo(()=>({position:h,"--slide-out-width":`${T}${typeof T=="number"?"px":""}`}),[h,T]),O=e.useMemo(()=>({left:f&&!y,right:f&&y}),[y,f]),N=e.useMemo(()=>t.jsx(Re.CSSTransition,{classNames:$,in:l,timeout:sl,unmountOnExit:!0,mountOnEnter:!0,onEntering:g,onExited:w,children:t.jsx(m.Flex,{className:o,top:"0",bottom:"0",left:y?"0":void 0,right:y?void 0:"0",position:h,asChild:!0,style:r,onPointerDownCapture:G,ref:n,children:t.jsx(Me.Resizable,{as:"div",onResize:W,size:Y,style:he,minWidth:v,maxWidth:L,enable:O,children:b})})}),[$,l,g,w,o,y,h,r,G,n,W,Y,he,v,L,O,b]);return t.jsxs(m.Flex,{ref:j,width:"100%",height:"100%",direction:"row",position:"relative",style:{overflow:"hidden",maxWidth:"100%",maxHeight:"100%"},children:[p==="left"&&!c&&t.jsxs(t.Fragment,{children:[l&&u," ",b&&N]}),t.jsx(m.Flex,{ref:P,grow:"1",height:"100%",style:{maxWidth:"100%",maxHeight:"100%",overflow:"hidden"},children:s}),p==="right"&&!c&&t.jsxs(t.Fragment,{children:[l&&u," ",b&&N]})]})})),al="30%",Zi=e.memo(e.forwardRef((i,n)=>{const{small:o,hideLayout:r}=Ce(),{className:s,showSlideOut:l,setShowSlideOut:c,defaultOpen:a,side:u,...f}=i;e.useEffect(()=>{o&&(a==null?void 0:a.small)!==void 0?c(a==null?void 0:a.small):!o&&(a==null?void 0:a.large)!==void 0&&c(a==null?void 0:a.large)},[a,c,o]);const p=e.useCallback(()=>{c(!1)},[c]),h=e.useMemo(()=>({open:l,initialWidth:al,modal:o,onDismiss:p,position:o?"absolute":"relative",...f}),[p,f,l,o]);return!r&&t.jsx(Ji,{className:F(`overmap-layout-slideOut-${u}`,s),side:u,ref:n,...h})})),cl=e.memo(e.forwardRef((i,n)=>{const{showLeftSlideOut:o,setShowLeftSlideOut:r}=Ce();return t.jsx(Zi,{side:"left",showSlideOut:o,setShowSlideOut:r,ref:n,...i})})),dl=e.memo(e.forwardRef((i,n)=>{const{showRightSlideOut:o,setShowRightSlideOut:r}=Ce();return t.jsx(Zi,{side:"right",showSlideOut:o,setShowSlideOut:r,ref:n,...i})}));function ul(i,n){switch(n){case"toggle":return!i;case"open":return!0;case"close":return!1}}const fl=e.memo(e.forwardRef((i,n)=>{const{side:o,type:r="toggle",children:s}=i,{setShowLeftSlideOut:l,setShowRightSlideOut:c}=Ce(),a=e.useCallback(()=>{(o==="left"?l:c)(f=>ul(f,r))},[l,c,o,r]);return t.jsx(Ae.Slot,{ref:n,onClick:a,children:s})})),hl={Root:Yi,Container:il,SlideOutOverlay:tl,LeftSlideOut:cl,RightSlideOut:dl,SlideOutTrigger:fl},ie={EnterRight:"_EnterRight_1jwyv_2",EnterActiveRight:"_EnterActiveRight_1jwyv_6",EnterDoneRight:"_EnterDoneRight_1jwyv_11",ExitRight:"_ExitRight_1jwyv_15",ExitActiveRight:"_ExitActiveRight_1jwyv_19",ExitDoneRight:"_ExitDoneRight_1jwyv_24",EnterLeft:"_EnterLeft_1jwyv_29",EnterActiveLeft:"_EnterActiveLeft_1jwyv_33",EnterDoneLeft:"_EnterDoneLeft_1jwyv_38",ExitLeft:"_ExitLeft_1jwyv_42",ExitActiveLeft:"_ExitActiveLeft_1jwyv_46",ExitDoneLeft:"_ExitDoneLeft_1jwyv_51",Overlay:"_Overlay_1jwyv_56"},pl=200,gl=e.memo(e.forwardRef((i,n)=>{const{className:o,style:r,children:s,open:l,modal:c=!1,resizeable:a=!0,side:u,position:f="relative",initialWidth:p,minWidth:h,maxWidth:C,onDismiss:v,onOpening:L,onClosed:x}=i,g=u==="left",[w,b]=e.useState(p),y=e.useCallback((P,T,V,W)=>{b(V.clientWidth)},[]),E=e.useCallback(P=>{c&&v&&v(P)},[c,v]);e.useEffect(()=>{b(p)},[p]);const A=e.useMemo(()=>({enter:g?ie.EnterLeft:ie.EnterRight,enterActive:g?ie.EnterActiveLeft:ie.EnterActiveRight,enterDone:g?ie.EnterDoneLeft:ie.EnterDoneRight,exit:g?ie.ExitLeft:ie.ExitRight,exitActive:g?ie.ExitActiveLeft:ie.ExitActiveRight,exitDone:g?ie.ExitDoneLeft:ie.ExitDoneRight}),[g]);return t.jsx(Re.CSSTransition,{classNames:A,in:l,timeout:pl,unmountOnExit:!0,mountOnEnter:!0,onEntering:L,onExited:x,children:t.jsx(ro.DismissableLayer,{disableOutsidePointerEvents:c,style:r,onInteractOutside:E,onEscapeKeyDown:E,asChild:!0,children:t.jsx(m.Flex,{className:o,ref:n,top:"0",bottom:"0",left:g?"0":void 0,right:g?void 0:"0",position:f,asChild:!0,children:t.jsx(Me.Resizable,{onResize:y,size:{width:w,height:"100%"},style:{position:f,"--slide-out-width":`${w}${typeof w=="number"?"px":""}`},minWidth:h,maxWidth:C,enable:{left:a&&!g,right:a&&g},children:s})})},c?"1":"0")})})),me={accommodateCharCount:"_accommodateCharCount_1octa_1",wrapper:"_wrapper_1octa_5",default:"_default_1octa_10",noLeftIcon:"_noLeftIcon_1octa_14",noRightIcon:"_noRightIcon_1octa_18",ghost:"_ghost_1octa_22",charCount:"_charCount_1octa_40"},Cl=e.forwardRef(function({className:n,leftSlot:o,rightSlot:r,size:s="medium",showInputLength:l,value:c,variant:a,severity:u="primary",...f},p){const h=de(s,we),C=Q(u),v=l||l===void 0&&f.maxLength!==void 0,L=c!==void 0?c.toString():void 0;return t.jsxs(m.TextField.Root,{className:F(me.wrapper,n,{[me.ghost]:a==="ghost",[me.accommodateCharCount]:v}),size:h,variant:a!=="ghost"?a:void 0,color:C,children:[o&&t.jsx(m.TextField.Slot,{children:o}),t.jsx(m.TextField.Input,{className:F(me.default,{[me.noLeftIcon]:!o,[me.noRightIcon]:!r}),ref:p,value:c,size:h,variant:a!=="ghost"?a:void 0,color:C,...f}),r&&t.jsx(m.TextField.Slot,{children:r}),v&&t.jsx(m.Text,{as:"p",className:me.charCount,size:"1",color:"gray",children:f.maxLength!==void 0?`${L==null?void 0:L.length}/${f.maxLength}`:`${L==null?void 0:L.length}`})]})}),di=e.memo(Cl),We={ItemStack:"_ItemStack_tj494_1",Row:"_Row_tj494_4",Column:"_Column_tj494_7",ItemStackItem:"_ItemStackItem_tj494_11"},ml=e.memo(e.forwardRef((i,n)=>{const{children:o}=i;return t.jsx("div",{ref:n,className:We.ItemStackItem,"data-item-stack":"",children:o})})),vl=e.memo(e.forwardRef((i,n)=>{const{children:o,direction:r,offset:s}=i,l=Oi(s);return t.jsx(m.Flex,{className:F(We.ItemStack,{[We.Row]:r==="row",[We.Column]:r==="column"}),ref:n,direction:r,width:"max-content",height:"max-content",position:"relative",style:{"--item-stack-offset":l??"0"},children:o})})),Ll={Item:ml,Group:vl},Sl=e.memo(function({color:n,severity:o,children:r}){const s=Q(o??"primary"),l=e.useMemo(()=>({"data-accent-color":o&&s?s:n||"gray",style:{color:"var(--accent-a9)"}}),[n,o,s]);return e.cloneElement(r,{...l})}),yl={wrapper:"_wrapper_tmtz0_1"},xl=e.forwardRef(function({className:n,trigger:o,open:r,onOpenChange:s,defaultOpen:l=!1,modal:c=!1,children:a,...u},f){return t.jsxs(m.Popover.Root,{defaultOpen:l,modal:c,open:r,onOpenChange:s,children:[t.jsx(m.Popover.Trigger,{children:o}),t.jsx(m.Popover.Content,{ref:f,className:F("overmap-popover",n,yl.wrapper),...u,children:a(m.Popover.Close)})]})}),et=e.memo(xl),te={wrapper:"_wrapper_1ssf2_1",panelContent:"_panelContent_1ssf2_6",left:"_left_1ssf2_14",right:"_right_1ssf2_18",resizable:"_resizable_1ssf2_23",resizeHandle:"_resizeHandle_1ssf2_28",panelMainContent:"_panelMainContent_1ssf2_48"},it=200,ue=150,wl=e.memo(function({children:n,showLeft:o,leftPanel:r,leftMinWidth:s=it,showRight:l,rightPanel:c,rightMinWidth:a=it,resizeable:u}){const f=e.useRef(null),p=e.useRef(null),[h,C]=e.useState(0),[v,L]=e.useState(),x=e.useRef(null),[g,w]=e.useState(0),[b,y]=e.useState(),E=e.useCallback((O,N,R)=>(Z,J,Le,Ee)=>{if(!f.current)return;const Te=O+Ee.width;R(f.current.clientWidth-Te),N(()=>Te)},[]),A=e.useCallback((O,N,R,Z)=>E(h,C,y)(O,N,R,Z),[E,h]),P=e.useCallback((O,N,R,Z)=>E(g,w,L)(O,N,R,Z),[E,g]),T=e.useCallback((O,N,R,Z,J,Le,Ee,Te)=>{if(!f.current)return;let De=O;if(De===0&&(De=N,R(De)),Le){const pe=f.current.clientWidth-De;Te(pe),J>pe&&(Ee(pe),Z(f.current.clientWidth-pe))}},[]),V=e.useCallback(()=>T(g,a,w,y,h,o,C,L),[T,h,a,g,o]),W=e.useCallback(()=>T(h,s,C,L,g,l,w,y),[T,s,h,g,l]),q=e.useCallback((O,N)=>{f.current&&O&&N(f.current.clientWidth)},[]),j=e.useCallback(()=>q(o,L),[q,o]),G=e.useCallback(()=>q(l,y),[q,l]),$=e.useCallback(()=>{var O,N,R,Z;f.current&&(L(f.current.clientWidth-(((O=x.current)==null?void 0:O.clientWidth)||0)),y(f.current.clientWidth-(((N=p.current)==null?void 0:N.clientWidth)||0)),C(((R=p.current)==null?void 0:R.clientWidth)||0),w(((Z=x.current)==null?void 0:Z.clientWidth)||0))},[]);e.useEffect(()=>{if(!f.current)return;const O=new ResizeObserver($);return O.observe(f.current),()=>{O.disconnect()}},[$]);const Y=e.useMemo(()=>({entering:{transform:`translateX(-${h}px)`,marginRight:`-${h}px`,transitionProperty:"transform, margin-right",transitionDuration:`${ue}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginRight:0,transitionProperty:"transform, margin-right",transitionDuration:`${ue}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(-${h}px)`,marginRight:`-${h}px`,transitionProperty:"transform, margin-right",transitionDuration:`${ue}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[h]),he=e.useMemo(()=>({entering:{transform:`translateX(${g}px)`,marginLeft:`${-g}px`,transitionProperty:"transform, margin-left",transitionDuration:`${ue}ms`,transitionTimingFunction:"linear"},entered:{transform:"translateX(0)",marginLeft:0,transitionProperty:"transform, margin-left",transitionDuration:`${ue}ms`,transitionTimingFunction:"linear"},exiting:{transform:`translateX(${g}px)`,marginLeft:`${-g}px`,transitionProperty:"transform, margin-left",transitionDuration:`${ue}ms`,transitionTimingFunction:"linear"},exited:{},unmounted:{}}),[g]);return t.jsxs(m.Flex,{className:te.wrapper,style:{minWidth:`${s+a}px`},ref:f,width:"100%",height:"100%",justify:"center",m:"0",p:"0",children:[t.jsx(Re.Transition,{nodeRef:p,timeout:o?0:ue,in:o,unmountOnExit:!0,onEntering:W,onExited:G,children:O=>t.jsx(m.Box,{ref:p,className:F(te.panelContent,te.left),style:Y[O],width:"auto",height:"100%",m:"0",p:"0",children:t.jsx(Me.Resizable,{className:te.resizable,size:{width:h,height:"100%"},onResizeStop:A,enable:{right:(u==null?void 0:u.left)!==void 0?u.left:!0},minWidth:s,maxWidth:v,handleClasses:{right:F(te.resizeHandle,te.left)},handleComponent:{right:t.jsx(M,{icon:"RiDraggable",height:"14px",width:"14px"})},children:r})})}),t.jsx("div",{className:te.panelMainContent,children:n}),t.jsx(Re.Transition,{nodeRef:x,timeout:l?0:ue,in:l,unmountOnExit:!0,onEntering:V,onExited:j,children:O=>t.jsx(m.Box,{ref:x,className:F(te.panelContent,te.right),style:he[O],width:"auto",height:"100%",m:"0",p:"0",children:t.jsx(Me.Resizable,{className:te.resizable,size:{width:g,height:"100%"},onResizeStop:P,enable:{left:(u==null?void 0:u.right)!==void 0?u.right:!0},minWidth:a,maxWidth:b,handleClasses:{left:F(te.resizeHandle,te.right)},handleComponent:{left:t.jsx(M,{icon:"RiDraggable",height:"14px",width:"14px"})},children:c})})})]})}),je={multiPagePopover:"_multiPagePopover_16xvh_1",pageTitle:"_pageTitle_16xvh_12",buttonContainer:"_buttonContainer_16xvh_16",optionsButtonContainer:"_optionsButtonContainer_16xvh_21",optionsButton:"_optionsButton_16xvh_21"};function tt(i,n,o,r=0){if(!i.options)return i.content||t.jsx(t.Fragment,{});const s=i.options.map((l,c)=>t.jsx(be,{className:F(je.optionsButton,l.buttonClassName),variant:"ghost",radius:"large",style:{width:o==="vertical"?"100%":"auto"},severity:"info",highContrast:!0,onClick:l.onClick||(()=>n(tt(l.page||{},n,o,r+1))),children:l.label},`${l.value}-page-${r}-button-${c}`));return t.jsxs(t.Fragment,{children:[i.title&&t.jsx(m.Text,{className:je.pageTitle,size:"3",children:i.title}),i.content,t.jsx("div",{className:F(je.optionsButtonContainer,i.buttonsContainerClassName),style:{flexDirection:o==="vertical"?"column":"row"},children:s})]})}const bl=e.forwardRef(function({page:n,className:o,direction:r="vertical",...s},l){const[c,a]=e.useState(void 0),u=e.useCallback(()=>{a(tt(n,a,r,0))},[r,n]),f=e.useCallback(p=>c,[c]);return t.jsx(et,{className:F(je.multiPagePopover,o),ref:l,onOpenAutoFocus:u,onCloseAutoFocus:u,...s,children:p=>f(p)})}),nt=e.memo(bl),rt={charCount:"_charCount_1lz28_1",ghost:"_ghost_1lz28_5"},_l=e.forwardRef(function({className:n,showInputLength:o,inputLengthTemplate:r,value:s,severity:l="primary",resize:c,variant:a,...u},f){const p=Q(l),h=Q("info"),C=o||o===void 0&&(u.maxLength!==void 0||u.minLength!==void 0),v=s!==void 0?s.toString():"",L=e.useMemo(()=>{if(r){let x=r.replace("{current}",v.length.toString());return u.minLength!==void 0&&(x=x.replace("{min}",u.minLength.toString())),u.maxLength!==void 0&&(x=x.replace("{max}",u.maxLength.toString())),x}return v.length},[r,u.maxLength,u.minLength,v.length]);return t.jsxs(t.Fragment,{children:[t.jsx(m.TextArea,{className:F("overmap-textarea",n,{[rt.ghost]:a==="ghost"}),style:{resize:c},variant:a!=="ghost"?a:void 0,ref:f,value:s,color:p,...u}),C&&t.jsx(m.Text,{as:"p",className:rt.charCount,color:h,align:"right",children:L})]})}),Fl=e.memo(_l),kl=e.forwardRef(function({loop:n,type:o,rovingFocus:r,value:s,onValueChange:l,defaultValue:c,disabled:a,items:u,className:f,direction:p="row",...h},C){return t.jsx(Fi.Root,{type:o,className:F("overmap-toggle-group",f),ref:C,value:s,onValueChange:l,disabled:a,orientation:p==="column"?"vertical":"horizontal",loop:n,rovingFocus:r,defaultValue:c,asChild:!0,children:t.jsx(li,{direction:p,...h,children:u.map(({children:v,...L})=>e.createElement(Fi.Item,{asChild:!0,...L,key:L.value},t.jsx(K,{className:F("overmap-toggle-group-button"),"aria-label":L.value,variant:L.value===s?"solid":"soft",children:v})))})})}),El=e.memo(kl),Tl={default:"_default_xqvoc_1"},Dl=e.memo(e.forwardRef(({className:i,minContentGap:n="2",children:o,...r},s)=>t.jsx(oo.Root,{className:F(i,"overmap-toolbar",Tl.default),ref:s,asChild:!0,...r,children:t.jsx(se,{grow:"1",width:"100%",height:"max-content",align:"center",gap:n,wrap:"nowrap",children:o})}))),Pl=e.memo(e.forwardRef(({children:i,gap:n="2"},o)=>t.jsx(se,{ref:o,grow:"1",width:"max-content",height:"100%",align:"center",gap:n,children:i}))),Al=e.memo(e.forwardRef(({children:i,gap:n},o)=>t.jsx(se,{ref:o,grow:"1",width:"max-content",direction:"row-reverse",height:"100%",align:"center",gap:n||"2",children:i}))),Ml={Root:Dl,LeftContent:Pl,RightContent:Al},ui={ToastViewport:"_ToastViewport_1i6bp_1",actionButton:"_actionButton_1i6bp_20",ToastRoot:"_ToastRoot_1i6bp_24",slideIn:"_slideIn_1i6bp_1",swipeOut:"_swipeOut_1i6bp_1"},Ol=e.forwardRef(function({title:n,description:o,icon:r,severity:s="primary",size:l,onClose:c,sensitivity:a,action:u,...f},p){const[h,C]=e.useState(!0),v=Q(s),L=e.useCallback(x=>{!x&&c&&c(),C(x)},[c]);return t.jsx(Oe.Root,{asChild:!0,ref:p,...f,open:h,type:a,onOpenChange:L,children:t.jsx(m.Callout.Root,{className:ui.ToastRoot,variant:"surface",color:v,size:l,children:t.jsxs(m.Flex,{width:"100%",align:"center",gap:"4",justify:"between",children:[t.jsxs(m.Flex,{align:"center",gap:"3",children:[t.jsx(m.Callout.Icon,{children:r}),t.jsxs(m.Flex,{direction:"column",gap:"2",children:[t.jsxs(m.Flex,{direction:"column",gap:"0",children:[t.jsx(Oe.Title,{asChild:!0,children:t.jsx(m.Callout.Text,{size:"3",weight:"medium",children:n})}),t.jsx(Oe.Description,{asChild:!0,children:t.jsx(m.Callout.Text,{children:o})})]}),u&&t.jsx(Oe.Action,{className:ui.actionButton,altText:u.altText,asChild:!0,children:u.content})]})]}),t.jsx(Oe.Close,{asChild:!0,children:t.jsx(K,{"aria-label":"Close",variant:"ghost",severity:s,children:t.jsx(M,{icon:"RiCloseLine"})})})]})})})}),ot=e.memo(Ol),fi=e.createContext({}),Il=()=>{const i=e.useContext(fi);if(!i)throw new Error("useToast must be used within a ToastProvider");return i},$l=240/60,lt=5e3,Nl=i=>{if(i.duration&&i.duration>=lt)return i.duration;const n=i.severity==="danger"?1.5:1,o=i.description.split(" ").length+i.title.split(" ").length;return(lt+o/$l)*n};d.unsafeShowToast=void 0;const Rl=e.memo(function({children:n,className:o,hotkey:r,...s}){const[l,c]=e.useState([]),a=e.useCallback((f,p,h)=>{c(C=>{const v=C.find(L=>L.id===f);return v&&p===0&&clearTimeout(v.timeout),C.filter(L=>L.id!==f)}),h&&h()},[]),u=e.useMemo(()=>{let f=0;const p=g=>{const w=Nl(g),b=f.toString();f+=1;const y=setTimeout(()=>a(b,1,g.onClose),w);c(E=>[...E,{...g,timeout:y,duration:w,id:b}])},h=g=>p({...g,severity:"primary"}),C=g=>p({...g,severity:"success"}),v=g=>p({...g,severity:"danger"}),L=g=>p({...g,severity:"info"}),x=g=>p({...g,severity:"warning"});return d.unsafeShowToast=p,{showToast:p,showPrimary:h,showSuccess:C,showError:v,showInfo:L,showWarning:x}},[a]);return e.useEffect(()=>()=>{for(const{timeout:f}of l)clearTimeout(f)},[]),t.jsx(fi.Provider,{value:u,children:t.jsxs(ii.ToastProvider,{...s,children:[n,t.jsx(ii.ToastViewport,{className:F(o,ui.ToastViewport),hotkey:r}),l.map(({id:f,onClose:p,...h})=>t.jsx(ot,{...h,onClose:()=>a(f,0,p)},f))]})})}),Bl={default:"_default_1odpt_1"},ql=e.memo(e.forwardRef(({className:i,children:n,content:o,...r},s)=>t.jsx(m.Tooltip,{className:F("overmap-tooltip",i,Bl.default),ref:s,content:t.jsx(m.Flex,{align:"center",gap:"1",width:"max-content",height:"max-content",justify:"center",children:o}),...r,children:n}))),zl={ToggleButton:"_ToggleButton_13aus_1"},Ul=e.memo(e.forwardRef((i,n)=>{const{children:o,className:r,severity:s,fluid:l,variant:c="solid",size:a,hoverEffects:u,...f}=i;return t.jsx(co.Root,{ref:n,asChild:!0,...f,children:t.jsx(K,{className:F(r,zl.ToggleButton),"aria-label":i["aria-label"],severity:s,fluid:l,variant:c,hoverEffects:u,size:a,"data-variant":c,children:o})})})),Hl={noWrap:"_noWrap_1wpa5_1"},Fe=e.memo(e.forwardRef(({className:i,noWrap:n,severity:o,as:r,...s},l)=>{const c=Q(o);return t.jsx(m.Text,{ref:l,as:r,className:F(i,{[Hl.noWrap]:n}),color:c,...s})})),vc="",Vl=e.memo(e.forwardRef((i,n)=>{const{panelBackground:o="solid",radius:r="full",...s}=i;return t.jsx(m.Theme,{panelBackground:o,radius:r,ref:n,...s})})),Ge={light:"_light_1u8fs_1",bold:"_bold_1u8fs_8",full:"_full_1u8fs_15",Text:"_Text_1u8fs_22"},Wl={1:"max-content",2:"max-content",3:"max-content",4:"100%"},jl=e.forwardRef(function({className:n,severity:o="info",textWeight:r="light",gap:s="1",text:l,orientation:c="horizontal",size:a,weight:u="medium",...f},p){const h=de(a,Wl),C=Q(o);return t.jsxs(m.Flex,{className:F("overmap-separator",n,{[Ge.light]:u==="light",[Ge.bold]:u==="bold",[Ge.full]:u==="full"}),ref:p,width:c==="horizontal"?h:"max-content",height:c==="vertical"?h:"max-content",direction:c==="vertical"?"column":"row",align:"center",gap:s,children:[t.jsx(m.Separator,{size:a,orientation:c,color:C,...f}),l&&t.jsxs(t.Fragment,{children:[t.jsx(m.Text,{className:Ge.Text,as:"span",size:"1",weight:r,color:C,children:l}),t.jsx(m.Separator,{size:a,orientation:c,color:C,...f})]})]})}),st=e.memo(jl),hi={placeSelf:"center"},at=e.memo(i=>{const{absoluteCentering:n,message:o="Something went wrong",onRetry:r}=i,{resetBoundary:s}=ki.useErrorBoundary(),l="20px",c=n?{position:"absolute",top:"50%",transform:"translateY(-50%)"}:void 0,a=e.useCallback(()=>{s(),r()},[r,s]);return t.jsxs(se,{gap:"2",direction:"row",width:"100%",style:c,children:[t.jsx("div",{style:{flexGrow:1}}),t.jsx(M,{icon:"RiAlertLine",size:l,style:hi}),t.jsx(Fe,{style:{lineHeight:l,...hi},children:o}),t.jsx(K,{"aria-label":"Try again",variant:"soft",onClick:a,style:hi,hoverEffects:["spin180Clockwise"],children:t.jsx(M,{icon:"RiLoopLeftLine",size:l})}),t.jsx("div",{style:{flexGrow:1}})]})});at.displayName="ErrorFallback";const ct=e.memo(i=>{const{absoluteCentering:n,message:o}=i,[r,s]=e.useState(0),l=e.useCallback((a,u)=>{console.error(a,u),s(f=>f+1)},[]),c=e.useCallback(()=>{s(a=>a+1)},[]);return t.jsx(ki.ErrorBoundary,{fallback:t.jsx(at,{absoluteCentering:n,message:o,onRetry:c}),onError:l,children:i.children},r)});ct.displayName="OvermapErrorBoundary";const Gl={OvermapInputItem:"_OvermapInputItem_1jgzv_1"},pi=e.memo(e.forwardRef((i,n)=>{const{size:o,className:r,style:s,leftSlot:l,rightSlot:c,...a}=i;return t.jsx(Ue,{className:r,style:s,size:o,leftSlot:l,rightSlot:c,compact:!1,children:t.jsx("input",{className:Gl.OvermapInputItem,ref:n,...a})})}));pi.displayName="OvermapInputItem";const dt=e.createContext({}),fe=()=>e.useContext(dt),Qe=20,ae=8,ut=250,Ql=5,ft=e.memo(i=>{const{children:n,side:o="bottom",align:r="center",offset:s,loop:l=!1,dialog:c=!1,modal:a=c,size:u=c?"3":"2",open:f,onOpenChange:p,defaultOpen:h}=i,[C,v]=ni({state:f,initialState:h??!1,setState:p}),[L,x]=e.useState(null),[g,w]=e.useState(null),b=e.useRef([]),y=k.useFloatingNodeId(),{refs:E,floatingStyles:A,context:P,middlewareData:T}=k.useFloating({nodeId:y,strategy:"fixed",placement:o+(r!=="center"?"-"+r:""),whileElementsMounted:k.autoUpdate,open:C,onOpenChange:v,middleware:[k.offset({mainAxis:s??Ql}),k.size({apply({availableHeight:he,elements:O}){c||(O.floating.style.maxHeight=`${Math.max(he,ut)}px`)},padding:Qe}),k.flip({fallbackStrategy:"initialPlacement"}),k.shift({padding:Qe}),k.hide()]}),V=k.useRole(P,{role:c?"dialog":"menu"}),W=k.useDismiss(P,{ancestorScroll:g==="context"||g==="virtual",outsidePressEvent:c?"mousedown":void 0}),q=k.useClick(P,{enabled:g==="click"}),j=k.useListNavigation(P,{listRef:b,activeIndex:L,onNavigate:x,loop:l}),{getFloatingProps:G,getItemProps:$,getReferenceProps:Y}=k.useInteractions([W,j,q,V]);return t.jsx(k.FloatingTree,{children:t.jsx(dt.Provider,{value:{size:u,open:C,setOpen:v,refs:E,context:P,floatingStyles:A,elementsRef:b,getFloatingProps:G,getItemProps:$,getReferenceProps:Y,nodeId:y,activeIndex:L,setActiveIndex:x,middlewareData:T,side:o,dialog:c,modal:a,setTriggerType:w},children:t.jsx(ze,{size:u,children:n})})})});ft.displayName="Root";const Kl=e.memo(e.forwardRef((i,n)=>{const{children:o,disabled:r=!1}=i,{getReferenceProps:s,refs:l,setTriggerType:c}=fe(),a=k.useMergeRefs([l.setReference,n]);return e.useEffect(()=>{c("click")},[c]),t.jsx(Ae.Slot,{ref:a,"aria-disabled":r,"data-disabled":r?"":void 0,...s({disabled:r}),children:o})})),Xl=e.memo(e.forwardRef((i,n)=>{const{children:o,disabled:r}=i,s=e.useRef(null),{setOpen:l,refs:c,setTriggerType:a}=fe(),u=k.useMergeRefs([n,s]);e.useEffect(()=>{a("context")},[a]);const f=e.useCallback(p=>{const{clientY:h,clientX:C}=p;!r&&s.current&&(p.preventDefault(),c.setPositionReference({getBoundingClientRect(){return{x:C,y:h,top:h,left:C,height:0,width:0,bottom:h,right:C}},contextElement:s.current}),l(!0))},[r,c,l]);return t.jsx(Ae.Slot,{ref:u,style:{WebkitTouchCallout:r?"none":"unset"},"aria-disabled":r,"data-disabled":r?"":void 0,onContextMenu:f,children:o})})),ht=e.memo(i=>{const{virtualElement:n,disabled:o}=i,{refs:r,setTriggerType:s,setOpen:l}=fe();return e.useEffect(()=>{s("virtual")},[s]),e.useEffect(()=>{!o&&n?(r.setPositionReference(n),l(!0)):(r.setPositionReference(null),l(!1))},[o,r,l,n]),null});ht.displayName="VirtualTrigger";const gi=e.createContext({}),Ci=()=>e.useContext(gi),H={MenuContent:"_MenuContent_t7a5i_41",Dialog:"_Dialog_t7a5i_51",MenuContentInner:"_MenuContentInner_t7a5i_56",slideDownAndFade:"_slideDownAndFade_t7a5i_1",slideLeftAndFade:"_slideLeftAndFade_t7a5i_1",slideUpAndFade:"_slideUpAndFade_t7a5i_1",slideRightAndFade:"_slideRightAndFade_t7a5i_1",MenuOverlay:"_MenuOverlay_t7a5i_83",Modal:"_Modal_t7a5i_90",MenuItem:"_MenuItem_t7a5i_94",MenuSeparator:"_MenuSeparator_t7a5i_121",paddingBottom:"_paddingBottom_t7a5i_121",paddingTop:"_paddingTop_t7a5i_124",extend:"_extend_t7a5i_127",MenuContentScrollArea:"_MenuContentScrollArea_t7a5i_131",MenuContentScrollAreaWrapper:"_MenuContentScrollAreaWrapper_t7a5i_140",ScrollAreaContent:"_ScrollAreaContent_t7a5i_148"},Ke=e.memo(i=>{const{children:n}=i;return t.jsx("div",{className:H.MenuContentScrollAreaWrapper,children:t.jsx(m.ScrollArea,{className:H.MenuContentScrollArea,scrollbars:"vertical",type:"scroll",children:t.jsx("div",{className:H.ScrollAreaContent,children:n})})})});Ke.displayName="Scroll";const Yl=e.memo(e.forwardRef((i,n)=>{var E;const{children:o,disableScroll:r=!1}=i,{refs:s,getFloatingProps:l,middlewareData:c,elementsRef:a,activeIndex:u,setActiveIndex:f,getItemProps:p,open:h,setOpen:C,nodeId:v,context:L,floatingStyles:x,dialog:g,modal:w,side:b}=fe(),y=e.useMemo(()=>{var A;return{...g?{}:x,visibility:(A=c.hide)!=null&&A.referenceHidden?"hidden":"visible"}},[g,x,(E=c.hide)==null?void 0:E.referenceHidden]);return t.jsx(k.FloatingNode,{id:v,children:h&&t.jsx(k.FloatingPortal,{children:t.jsx(k.FloatingOverlay,{className:F("overmap-menu-overlay",H.MenuOverlay,{[H.Modal]:w}),lockScroll:!0,children:t.jsx(k.FloatingFocusManager,{context:L,children:t.jsx(k.FloatingList,{elementsRef:a,children:t.jsx(gi.Provider,{value:{getItemProps:p,activeIndex:u,elementsRef:a,open:h,setOpen:C,refs:s,setActiveIndex:f},children:t.jsx(m.Theme,{asChild:!0,children:t.jsx("div",{className:F("overmap-menu-content",H.MenuContent,{[H.Dialog]:g}),ref:s.setFloating,tabIndex:-1,style:y,...l(),children:t.jsx("div",{ref:n,className:H.MenuContentInner,"data-side":b,children:r?o:t.jsx(Ke,{children:o})})})})})})})})})})})),pt=e.createContext({}),mi=()=>e.useContext(pt),Jl=(i,n)=>{switch(i){case"right":if(n==="start")return{mainAxis:ae+1,crossAxis:-ae};if(n==="end")return{mainAxis:ae+1,crossAxis:ae};break;case"left":if(n==="start")return{mainAxis:ae+1,crossAxis:-ae};if(n==="end")return{mainAxis:ae+1,crossAxis:ae};break}return{mainAxis:ae+1,crossAxis:0}},gt=e.memo(i=>{const{dialog:n}=fe(),{children:o,disabled:r=!1,side:s="right",align:l="start",closeRoot:c=!1,loop:a=!1,modal:u=n,open:f,onOpenChange:p,defaultOpen:h}=i,[C,v]=ni({initialState:h??!1,state:f,setState:p}),L=k.useFloatingNodeId(),{refs:x,floatingStyles:g,context:w}=k.useFloating({nodeId:L,strategy:"fixed",whileElementsMounted:k.autoUpdate,open:C,onOpenChange:(G,$,Y)=>{Y&&v(G)},placement:s+(l!=="center"?"-"+l:""),middleware:[k.offset({...Jl(s,l)}),k.size({padding:Qe,apply({availableHeight:G,elements:$}){n||($.floating.style.maxHeight=`${Math.max(G,ut)}px`)}}),k.flip(),k.shift({padding:Qe}),k.hide()]}),b=k.useDismiss(w,{bubbles:c,outsidePress:c}),y=k.useHover(w,{restMs:50,handleClose:k.safePolygon({blockPointerEvents:!0,requireIntent:!1}),enabled:!r&&!n}),E=k.useClick(w,{enabled:!r&&n}),A=e.useRef([]),[P,T]=e.useState(null),V=k.useListNavigation(w,{listRef:A,nested:!0,activeIndex:P,onNavigate:T,loop:a,rtl:s==="left"}),{getFloatingProps:W,getItemProps:q,getReferenceProps:j}=k.useInteractions([V,b,y,E]);return t.jsx(pt.Provider,{value:{open:C,setOpen:v,nodeId:L,refs:x,floatingStyles:g,context:w,elementsRef:A,activeIndex:P,setActiveIndex:T,getFloatingProps:W,getItemProps:q,getReferenceProps:j,disabled:r,side:s,closeRoot:c,modal:u},children:o})});gt.displayName="SubMenu";const Zl=["Enter"," "],$e=e.memo(e.forwardRef((i,n)=>{const o=fe(),{getItemProps:r,activeIndex:s,setOpen:l}=Ci(),{closeRoot:c}=mi(),{className:a,children:u,onSelect:f,onClick:p,onKeyDown:h,closeOnSelect:C=!0,size:v=o.size,leftSlot:L,rightSlot:x,disabled:g,...w}=i,{ref:b,index:y}=k.useListItem(),E=k.useMergeRefs([b,n]),A=e.useCallback(j=>{g||(p&&p(j),f&&f(),C&&l(!1),c&&o.setOpen(!1))},[C,c,g,o,p,f,l]),P=e.useCallback(j=>{g||(h&&h(j),Zl.includes(j.key)&&(f&&f(),C&&l(!1)))},[C,g,h,f,l]),T=e.useMemo(()=>y===s,[s,y]),V=e.useMemo(()=>typeof u=="function"?u({active:T,selected:!1}):u,[u,T]),W=e.useMemo(()=>typeof L=="function"?L({active:T,selected:!1}):L,[T,L]),q=e.useMemo(()=>typeof x=="function"?x({active:T,selected:!1}):x,[T,x]);return t.jsx(Ue,{className:F(a,H.MenuItem),ref:E,leftSlot:W,rightSlot:q,size:v,role:"menuitem",type:"button","data-disabled":g?"":void 0,"aria-disabled":g,"data-highlighted":T?"":void 0,...r({onClick:A,onKeyDown:P,tabIndex:T?0:-1,...w}),children:V})})),es=e.memo(e.forwardRef((i,n)=>{var P;const{children:o,disableScroll:r}=i,{middlewareData:s,dialog:l}=fe(),{open:c,nodeId:a,refs:u,context:f,getFloatingProps:p,getItemProps:h,activeIndex:C,setActiveIndex:v,elementsRef:L,floatingStyles:x,setOpen:g,side:w,modal:b}=mi(),y=e.useRef(null),E=k.useMergeRefs([u.setFloating,y]),A=e.useMemo(()=>{var T;return{...l?{}:x,visibility:(T=s.hide)!=null&&T.referenceHidden?"hidden":"visible"}},[l,x,(P=s.hide)==null?void 0:P.referenceHidden]);return t.jsx(k.FloatingNode,{id:a,children:c&&t.jsx(k.FloatingPortal,{children:t.jsx(k.FloatingOverlay,{className:F("overmap-menu-overlay",H.MenuOverlay,{[H.Modal]:b}),lockScroll:!0,children:t.jsx(k.FloatingFocusManager,{context:f,initialFocus:y,children:t.jsx(k.FloatingList,{elementsRef:L,children:t.jsx(gi.Provider,{value:{getItemProps:h,activeIndex:C,setActiveIndex:v,elementsRef:L,open:c,setOpen:g,refs:u},children:t.jsx(m.Theme,{asChild:!0,children:t.jsx("div",{className:F("overmap-menu-sub-content",H.MenuContent,{[H.Dialog]:l}),ref:E,style:A,"data-side":w,...p(),children:t.jsx("div",{ref:n,className:H.MenuContentInner,"data-side":w,children:r?o:t.jsx(Ke,{children:o})})})})})})})})})})})),is=e.memo(e.forwardRef((i,n)=>{const{size:o,children:r,...s}=i,{refs:l,getReferenceProps:c,open:a,disabled:u}=mi(),f=k.useMergeRefs([n,l.setReference]);return t.jsx($e,{ref:f,closeOnSelect:!1,"aria-haspopup":"menu","data-open":a,size:o,disabled:u,...c(s),children:r})})),vi=e.memo(e.forwardRef((i,n)=>{const{children:o}=i;return t.jsx(m.Flex,{ref:n,role:"group",width:"100%",height:"max-content",direction:"column",children:o})})),Ct=e.createContext({});function mt(){return e.useContext(Ct)}const Li=e.memo(i=>{const{type:n,children:o}=i,[r,s]=e.useState(n==="single"?(i==null?void 0:i.defaultValue)??null:null),[l,c]=e.useState(n==="multi"?(i==null?void 0:i.defaultValues)??[]:[]),a=e.useCallback(p=>{c(p),n==="multi"&&(i!=null&&i.onValuesChange)&&i.onValuesChange(p)},[i,n]),u=e.useCallback(p=>{s(p),n==="single"&&(i!=null&&i.onValueChange)&&i.onValueChange(p)},[i,n]),f=e.useMemo(()=>n==="multi"?{type:n,values:(i==null?void 0:i.values)??l,handleValuesChange:a}:{type:n,value:i.value??r,handleValueChange:u},[r,l,u,a,i,n]);return t.jsx(Ct.Provider,{value:f,children:o})});Li.displayName="SelectContextProvider";const ts=e.memo(e.forwardRef((i,n)=>{const{children:o,value:r,onValueChange:s}=i;return t.jsx(Li,{type:"single",value:r,onValueChange:s,children:t.jsx(vi,{ref:n,children:o})})})),ns=e.memo(e.forwardRef((i,n)=>{const{values:o,onValuesChange:r,...s}=i;return t.jsx(Li,{type:"multi",values:o,onValuesChange:r,children:t.jsx(vi,{ref:n,...s})})})),Si=e.createContext({}),rs=()=>e.useContext(Si),vt=e.memo(i=>{const{children:n}=i,{selected:o}=rs();return t.jsx(t.Fragment,{children:o?n:null})});vt.displayName="SelectedIndicator";const os=e.memo(e.forwardRef((i,n)=>{const{onSelect:o,children:r,closeOnSelect:s=!1,leftSlot:l,rightSlot:c,value:a,...u}=i,{values:f,handleValuesChange:p}=mt(),h=e.useMemo(()=>f.includes(a),[a,f]),C=e.useCallback(()=>{p(h?f.filter(g=>g!==a):[...f,a]),o&&o()},[p,o,h,a,f]),v=e.useMemo(()=>typeof r=="function"?({active:g})=>r({selected:h,active:g}):r,[r,h]),L=e.useMemo(()=>typeof l=="function"?({active:g})=>l({selected:h,active:g}):l,[l,h]),x=e.useMemo(()=>typeof c=="function"?({active:g})=>c({selected:h,active:g}):c,[c,h]);return t.jsx(Si.Provider,{value:{selected:h},children:t.jsx($e,{ref:n,role:"menuitemcheckbox",onSelect:C,leftSlot:L,rightSlot:x,closeOnSelect:s,...u,children:v})})})),ls=e.memo(e.forwardRef((i,n)=>{const{value:o,onSelect:r,children:s,closeOnSelect:l=!1,leftSlot:c,rightSlot:a,...u}=i,{value:f,handleValueChange:p}=mt(),h=e.useMemo(()=>o===f,[f,o]),C=e.useCallback(()=>{p(h?null:o),r&&r()},[p,r,h,o]),v=e.useMemo(()=>typeof s=="function"?({active:g})=>s({selected:h,active:g}):s,[s,h]),L=e.useMemo(()=>typeof c=="function"?({active:g})=>c({selected:h,active:g}):c,[c,h]),x=e.useMemo(()=>typeof a=="function"?({active:g})=>a({selected:h,active:g}):a,[a,h]);return t.jsx(Si.Provider,{value:{selected:h},children:t.jsx($e,{ref:n,role:"menuitemcheckbox",onSelect:C,rightSlot:x,leftSlot:L,closeOnSelect:l,...u,children:v})})})),Lt=e.createContext({}),St=()=>e.useContext(Lt),yt=e.memo(i=>{const{children:n,defaultPage:o,page:r,onPageChange:s}=i,[l,c]=ni({state:r,initialState:o??"",setState:s});return t.jsx(Lt.Provider,{value:{activePage:l,setActivePage:c},children:n})});yt.displayName="Pages";const xt=e.memo(i=>{const{page:n,children:o}=i,{activePage:r}=St();return t.jsx(t.Fragment,{children:r===n?o:null})});xt.displayName="PageContent";const ss=e.memo(e.forwardRef((i,n)=>{const{onSelect:o,page:r,...s}=i,{refs:l,setActiveIndex:c}=Ci(),{setActivePage:a}=St(),u=e.useCallback(()=>{var f;a(r),(f=l.floating.current)==null||f.focus(),c(null),o&&o()},[o,r,l.floating,c,a]);return t.jsx($e,{ref:n,onSelect:u,closeOnSelect:!1,...s})})),as=e.memo(e.forwardRef((i,n)=>{const{className:o,extend:r=!1,spacingBelow:s=!0,spacingAbove:l=!0,...c}=i;return t.jsx("div",{className:F(o,H.MenuSeparator,{[H.extend]:r,[H.paddingTop]:l,[H.paddingBottom]:s}),children:t.jsx(st,{ref:n,size:"4",weight:"light",...c})})})),cs=e.memo(e.forwardRef((i,n)=>{const{onValueChange:o,onChange:r}=i,{size:s}=fe(),{activeIndex:l,getItemProps:c}=Ci(),{index:a,ref:u}=k.useListItem(),f=k.useMergeRefs([u,n]),p=e.useCallback(h=>{r&&r(h),o&&o(h.target.value)},[r,o]);return e.useEffect(()=>()=>{o&&o("")},[]),t.jsx(pi,{ref:f,size:s,...c({...i,tabIndex:a===l?0:-1,onChange:p})})})),X={Root:ft,ClickTrigger:Kl,ContextTrigger:Xl,VirtualTrigger:ht,Content:Yl,Item:$e,Sub:gt,SubContent:es,SubTrigger:is,Group:vi,SelectGroup:ts,MultiSelectGroup:ns,MultiSelectItem:os,SelectItem:ls,SelectedIndicator:vt,PageContent:xt,Pages:yt,PageTrigger:ss,Separator:as,Input:cs,Scroll:Ke},wt=e.memo(i=>{const{trigger:n,disabled:o,items:r,...s}=i;return t.jsxs(X.Root,{...s,children:[t.jsx(X.ClickTrigger,{disabled:o,children:n}),t.jsx(X.Content,{children:r.map((l,c)=>t.jsx(X.Item,{...l},c))})]})});wt.displayName="DropdownMenu";const bt=e.memo(i=>{const{trigger:n,disabled:o,items:r,value:s,onValueChange:l,...c}=i;return t.jsxs(X.Root,{...c,children:[t.jsx(X.ClickTrigger,{disabled:o,children:n}),t.jsx(X.Content,{children:t.jsx(X.SelectGroup,{value:s,onValueChange:l,children:r.map((a,u)=>t.jsx(X.SelectItem,{...a},u))})})]})});bt.displayName="DropdownSelect";const _t=e.memo(i=>{const{trigger:n,disabled:o,items:r,values:s,onValuesChange:l,...c}=i;return t.jsxs(X.Root,{...c,children:[t.jsx(X.ClickTrigger,{disabled:o,children:n}),t.jsx(X.Content,{children:t.jsx(X.MultiSelectGroup,{values:s,onValuesChange:l,children:r.map((a,u)=>t.jsx(X.MultiSelectItem,{...a},u))})})]})});_t.displayName="DropdownMultiSelect";function ke(){return ke=Object.assign?Object.assign.bind():function(i){for(var n=1;n<arguments.length;n++){var o=arguments[n];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(i[r]=o[r])}return i},ke.apply(this,arguments)}function ds(i,n){typeof i=="function"?i(n):i!=null&&(i.current=n)}function us(...i){return n=>i.forEach(o=>ds(o,n))}function Ft(...i){return e.useCallback(us(...i),i)}function fs(i,n=[]){let o=[];function r(l,c){const a=e.createContext(c),u=o.length;o=[...o,c];function f(h){const{scope:C,children:v,...L}=h,x=(C==null?void 0:C[i][u])||a,g=e.useMemo(()=>L,Object.values(L));return e.createElement(x.Provider,{value:g},v)}function p(h,C){const v=(C==null?void 0:C[i][u])||a,L=e.useContext(v);if(L)return L;if(c!==void 0)return c;throw new Error(`\`${h}\` must be used within \`${l}\``)}return f.displayName=l+"Provider",[f,p]}const s=()=>{const l=o.map(c=>e.createContext(c));return function(a){const u=(a==null?void 0:a[i])||l;return e.useMemo(()=>({[`__scope${i}`]:{...a,[i]:u}}),[a,u])}};return s.scopeName=i,[r,hs(s,...n)]}function hs(...i){const n=i[0];if(i.length===1)return n;const o=()=>{const r=i.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=r.reduce((a,{useScope:u,scopeName:f})=>{const h=u(l)[`__scope${f}`];return{...a,...h}},{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:c}),[c])}};return o.scopeName=n.scopeName,o}function kt(i,n,{checkForDefaultPrevented:o=!0}={}){return function(s){if(i==null||i(s),o===!1||!s.defaultPrevented)return n==null?void 0:n(s)}}function Et(i){const n=e.useRef(i);return e.useEffect(()=>{n.current=i}),e.useMemo(()=>(...o)=>{var r;return(r=n.current)===null||r===void 0?void 0:r.call(n,...o)},[])}function ps({prop:i,defaultProp:n,onChange:o=()=>{}}){const[r,s]=gs({defaultProp:n,onChange:o}),l=i!==void 0,c=l?i:r,a=Et(o),u=e.useCallback(f=>{if(l){const h=typeof f=="function"?f(i):f;h!==i&&a(h)}else s(f)},[l,i,s,a]);return[c,u]}function gs({defaultProp:i,onChange:n}){const o=e.useState(i),[r]=o,s=e.useRef(r),l=Et(n);return e.useEffect(()=>{s.current!==r&&(l(r),s.current=r)},[r,s,l]),o}function Cs(i){const n=e.useRef({value:i,previous:i});return e.useMemo(()=>(n.current.value!==i&&(n.current.previous=n.current.value,n.current.value=i),n.current.previous),[i])}const yi=globalThis!=null&&globalThis.document?e.useLayoutEffect:()=>{};function ms(i){const[n,o]=e.useState(void 0);return yi(()=>{if(i){o({width:i.offsetWidth,height:i.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,a;if("borderBoxSize"in l){const u=l.borderBoxSize,f=Array.isArray(u)?u[0]:u;c=f.inlineSize,a=f.blockSize}else c=i.offsetWidth,a=i.offsetHeight;o({width:c,height:a})});return r.observe(i,{box:"border-box"}),()=>r.unobserve(i)}else o(void 0)},[i]),n}function vs(i,n){return e.useReducer((o,r)=>{const s=n[o][r];return s??o},i)}const Tt=i=>{const{present:n,children:o}=i,r=Ls(n),s=typeof o=="function"?o({present:r.isPresent}):e.Children.only(o),l=Ft(r.ref,s.ref);return typeof o=="function"||r.isPresent?e.cloneElement(s,{ref:l}):null};Tt.displayName="Presence";function Ls(i){const[n,o]=e.useState(),r=e.useRef({}),s=e.useRef(i),l=e.useRef("none"),c=i?"mounted":"unmounted",[a,u]=vs(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const f=Xe(r.current);l.current=a==="mounted"?f:"none"},[a]),yi(()=>{const f=r.current,p=s.current;if(p!==i){const C=l.current,v=Xe(f);i?u("MOUNT"):v==="none"||(f==null?void 0:f.display)==="none"?u("UNMOUNT"):u(p&&C!==v?"ANIMATION_OUT":"UNMOUNT"),s.current=i}},[i,u]),yi(()=>{if(n){const f=h=>{const v=Xe(r.current).includes(h.animationName);h.target===n&&v&&_i.flushSync(()=>u("ANIMATION_END"))},p=h=>{h.target===n&&(l.current=Xe(r.current))};return n.addEventListener("animationstart",p),n.addEventListener("animationcancel",f),n.addEventListener("animationend",f),()=>{n.removeEventListener("animationstart",p),n.removeEventListener("animationcancel",f),n.removeEventListener("animationend",f)}}else u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:e.useCallback(f=>{f&&(r.current=getComputedStyle(f)),o(f)},[])}}function Xe(i){return(i==null?void 0:i.animationName)||"none"}const Dt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((i,n)=>{const o=e.forwardRef((r,s)=>{const{asChild:l,...c}=r,a=l?Ae.Slot:n;return e.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),e.createElement(a,ke({},c,{ref:s}))});return o.displayName=`Primitive.${n}`,{...i,[n]:o}},{}),Pt="Checkbox",[Ss,Uc]=fs(Pt),[ys,xs]=Ss(Pt),ws=e.forwardRef((i,n)=>{const{__scopeCheckbox:o,name:r,checked:s,defaultChecked:l,required:c,disabled:a,value:u="on",onCheckedChange:f,...p}=i,[h,C]=e.useState(null),v=Ft(n,y=>C(y)),L=e.useRef(!1),x=h?!!h.closest("form"):!0,[g=!1,w]=ps({prop:s,defaultProp:l,onChange:f}),b=e.useRef(g);return e.useEffect(()=>{const y=h==null?void 0:h.form;if(y){const E=()=>w(b.current);return y.addEventListener("reset",E),()=>y.removeEventListener("reset",E)}},[h,w]),e.createElement(ys,{scope:o,state:g,disabled:a},e.createElement(Dt.button,ke({type:"button",role:"checkbox","aria-checked":ve(g)?"mixed":g,"aria-required":c,"data-state":At(g),"data-disabled":a?"":void 0,disabled:a,value:u},p,{ref:v,onKeyDown:kt(i.onKeyDown,y=>{y.key==="Enter"&&y.preventDefault()}),onClick:kt(i.onClick,y=>{w(E=>ve(E)?!0:!E),x&&(L.current=y.isPropagationStopped(),L.current||y.stopPropagation())})})),x&&e.createElement(Fs,{control:h,bubbles:!L.current,name:r,value:u,checked:g,required:c,disabled:a,style:{transform:"translateX(-100%)"}}))}),bs="CheckboxIndicator",_s=e.forwardRef((i,n)=>{const{__scopeCheckbox:o,forceMount:r,...s}=i,l=xs(bs,o);return e.createElement(Tt,{present:r||ve(l.state)||l.state===!0},e.createElement(Dt.span,ke({"data-state":At(l.state),"data-disabled":l.disabled?"":void 0},s,{ref:n,style:{pointerEvents:"none",...i.style}})))}),Fs=i=>{const{control:n,checked:o,bubbles:r=!0,...s}=i,l=e.useRef(null),c=Cs(o),a=ms(n);return e.useEffect(()=>{const u=l.current,f=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==o&&h){const C=new Event("click",{bubbles:r});u.indeterminate=ve(o),h.call(u,ve(o)?!1:o),u.dispatchEvent(C)}},[c,o,r]),e.createElement("input",ke({type:"checkbox","aria-hidden":!0,defaultChecked:ve(o)?!1:o},s,{tabIndex:-1,ref:l,style:{...i.style,...a,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function ve(i){return i==="indeterminate"}function At(i){return ve(i)?"indeterminate":i?"checked":"unchecked"}const ks=ws,Es=_s,Ne={checkbox:"_checkbox_yl8iy_5",checkboxIndicator:"_checkboxIndicator_yl8iy_22",checkboxLabel:"_checkboxLabel_yl8iy_33",noTextHighlight:"_noTextHighlight_yl8iy_37",checkboxHidden:"_checkboxHidden_yl8iy_46"},Ts=e.forwardRef(function({className:n,labelClassName:o,label:r,checked:s,onCheckedChange:l,checkboxPosition:c="center",alwaysShow:a=!0,...u},f){return t.jsx(He,{children:({isHovered:p,...h})=>t.jsxs(m.Flex,{align:c,...h,children:[t.jsx(ks,{className:F(Ne.checkbox,!a&&!p&&!s&&Ne.checkboxHidden,n),checked:s,onCheckedChange:C=>{l&&l(C)},ref:f,...u,children:t.jsx(Es,{className:Ne.checkboxIndicator,children:s==="indeterminate"?t.jsx(M,{icon:"RiSubtractLine"}):t.jsx(M,{icon:"RiCheckLine"})})}),r&&t.jsx("div",{className:F(Ne.checkboxLabel,o,Ne.noTextHighlight),onClick:()=>{l&&l(!s)},children:r})]})})}),Ye=e.memo(Ts);Ye.displayName="Checkbox";const Mt=e.memo(function({className:n,labelClassName:o,label:r,onCheckedChange:s,children:l,...c}){const[a,u]=e.useState(e.Children.toArray(l).every(v=>e.isValidElement(v)&&v.props.checked)?!0:e.Children.toArray(l).some(v=>e.isValidElement(v)&&v.props.checked)?"indeterminate":!1),[f,p]=e.useState(e.Children.map(l,v=>v.props.checked)),h=v=>{const L=a==="indeterminate"||!v;a==="indeterminate"&&(v=!1),p(f.map(x=>!L)),s&&s(v)};e.useEffect(()=>{const v=f.filter(L=>L).length;v===0?u(!1):v===l.length?u(!0):u("indeterminate")},[l,f]);const C=e.Children.map(l,(v,L)=>e.cloneElement(v,{...v.props,checked:f[L],onCheckedChange:x=>{const g=[...f];g[L]=x,p(g),v.props.onCheckedChange&&v.props.onCheckedChange(x)}}));return t.jsxs(t.Fragment,{children:[t.jsx(Ye,{className:n,labelClassName:o,label:r,checked:a,onCheckedChange:h,...c}),C]})}),B={disabled:"_disabled_5i91d_1",outerTableContainer:"_outerTableContainer_5i91d_5",headerContainer:"_headerContainer_5i91d_17",tableTopContainer:"_tableTopContainer_5i91d_21",tableContainer:"_tableContainer_5i91d_25",searchContainer:"_searchContainer_5i91d_30",columnFilterSelect:"_columnFilterSelect_5i91d_40",table:"_table_5i91d_21",tableHeaderCell:"_tableHeaderCell_5i91d_58",showSortIcon:"_showSortIcon_5i91d_74",tableRow:"_tableRow_5i91d_78",tableCell:"_tableCell_5i91d_93",noDataTextContainer:"_noDataTextContainer_5i91d_103",tableBottomContainer:"_tableBottomContainer_5i91d_109",rowsPerPageContainer:"_rowsPerPageContainer_5i91d_113",rowsPerPageText:"_rowsPerPageText_5i91d_123",pageText:"_pageText_5i91d_128",descriptionSecondLine:"_descriptionSecondLine_5i91d_132"},Ds=e.forwardRef(function(n,o){var Nt;const{columns:r,data:s,color:l="light",title:c="",description:a="",rowsPerPage:u=[10,20,30,40,50],fixHeader:f=!1,showSearchBar:p,searchBarPlaceholder:h,showSelect:C,showFilterButton:v,showContainer:L,showRowsPerPage:x,showPageNumber:g,showPageNavigation:w,showTopBar:b=!0,showBottomBar:y=!0,emptyMessage:E="There is no data",topBarComponents:A,children:P,containerClassName:T,className:V,columnClassName:W,rowClassName:q,cellClassName:j}=n,[G,$]=e.useState(""),[Y,he]=e.useState([]);if(!s.every(S=>Object.keys(S.columns).length===r.length&&Object.values(r).every(_=>Object.keys(S.columns).includes(_.id.toString()))))throw new Error("Columns in rows do not match ones declared in columns variable.");const N=n.defaultRowsPerPage||u[0]||10,R=e.useCallback(S=>r.filter(_=>_.filter).map(_=>({[_.id]:S})).reduce((_,D)=>Object.assign(_,D),{}),[r]),Z=e.useMemo(()=>R([]),[R]),[J,Le]=e.useState(Z),Ee=e.useMemo(()=>R(!1),[R]),[Te,De]=e.useState(Ee);u.includes(N)||u.push(N),u.sort((S,_)=>S-_);const[pe,Os]=e.useState(N||(u[0]??10)),xi=e.useMemo(()=>u.map(S=>({value:S.toString(),itemContent:S.toString()})),[u]),Is=s.some(S=>S.onClick),Ot=e.useCallback(S=>{var D,I;return(((D=S.searchValue)==null?void 0:D.toString())||((I=S.value)==null?void 0:I.toString())||"").toLowerCase().includes(G.toLowerCase())},[G]),$s=e.useCallback((S,_)=>{var U,ne,ge,Se;const D=((U=S.sortValue)==null?void 0:U.toString())||((ne=S.value)==null?void 0:ne.toString())||"",I=((ge=_.sortValue)==null?void 0:ge.toString())||((Se=_.value)==null?void 0:Se.toString())||"";return D.toLowerCase().localeCompare(I.toLowerCase(),void 0,{numeric:!0})},[]),It=e.useCallback((S,_)=>{var I,U,ne;const D=((I=S.filterValue)==null?void 0:I.toString())||((U=S.value)==null?void 0:U.toString())||"";return(ne=J[_.id])==null?void 0:ne.some(ge=>D.toString().toLowerCase()===ge.toString().toLowerCase())},[J]),Je=e.useMemo(()=>r.map(S=>({...S,sort:S.sort?{sortKey:S.id.toString().toUpperCase()}:!1})),[r]),wi=r.some(S=>{var _;return S.filter&&S.id in J&&((_=J[S.id])==null?void 0:_.length)!==0}),Ze=e.useMemo(()=>s.filter(S=>!G||r.some(_=>_.search&&Ot(S.columns[_.id]))).filter(S=>!wi||r.every(_=>{var D;return!_.filter||((D=J[_.id])==null?void 0:D.length)===0||It(S.columns[_.id],_)})).map(S=>{const _={...S.columns,...S,disabled:S.disabled},{columns:D,...I}=_;return I}),[It,J,r,s,wi,G,Ot]),[ce,Ns]=e.useState(Math.ceil(Ze.length/pe)),bi=e.useCallback(S=>S.filterValues?S.filterValues:[...new Set(s.map(D=>{var I,U;return((I=D.columns[S.id].filterValue)==null?void 0:I.toString())||((U=D.columns[S.id].value)==null?void 0:U.toString())||""}))].sort().map(D=>({value:D,label:D})),[s]),Rs=e.useMemo(()=>(C?"auto ":"")+Je.reduce((S,_)=>S+`${_.width?_.width:_.maxWidth?`minmax(auto, ${_.maxWidth})`:"auto"} `,""),[Je,C]),Bs=e.useCallback(S=>{$(S.target.value)},[]),ei={nodes:Ze},qs=xe.useRowSelect(ei,{onChange:(S,_)=>{he(_.ids)}},{rowSelect:xe.SelectTypes.MultiSelect,buttonSelect:xe.SelectTypes.MultiSelect,clickType:xe.SelectClickTypes.ButtonClick,isCarryForward:!1}),z=ao.usePagination(ei,{state:{page:0,size:N||u[0]}},{isServer:!1}),zs=Ei.useSort(ei,{onChange:(S,_)=>{De({...Ee,[_.sortKey.toLowerCase()]:!0})}},{sortIcon:{margin:"10px",size:"15px",iconDefault:t.jsx(M,{icon:"RiExpandUpDownLine"}),iconUp:t.jsx(M,{icon:"RiArrowUpLine"}),iconDown:t.jsx(M,{icon:"RiArrowUpLine"})},sortFns:Object.assign({},...Je.map(S=>({[S.id.toString().toUpperCase()]:_=>_.sort((D,I)=>$s(D[S.id],I[S.id]))})))}),Us=e.useMemo(()=>({title:"Filter by:",options:r.filter(S=>S.filter).map(S=>({label:S.label,value:S.id.toString(),page:{content:t.jsx(Mt,{label:"Select all",onCheckedChange:_=>{const D=JSON.parse(JSON.stringify(J));_===!0?D[S.id]=bi(S).map(I=>I.value):D[S.id]=[],Le(D)},children:bi(S).map((_,D)=>{var I,U;return t.jsx(Ye,{label:_.label,checked:(U=J[S.id])==null?void 0:U.includes(((I=_.value)==null?void 0:I.toString())||""),onCheckedChange:ne=>{Le(ge=>{var Bt;const Se={...ge},Rt=Se[S.id]||[];return ne?Se[S.id]=[...Rt,((Bt=_.value)==null?void 0:Bt.toString())||""]:Se[S.id]=Rt.filter(js=>js!==(_.value??"").toString()),Se})}},`checkbox-filter-${S.id}-${D}`)})},`select-all-checkbox-${S.id}`)}}))}),[J,r,bi]),Hs=Je.map(S=>{const _=S.sort?Ei.HeaderCellSort:oe.HeaderCell;let D=S.label,I;if(S.label&&typeof S.label=="string"){const[ne,ge]=Ai(S.label,31);D=ne,I=ge}return t.jsx(He,{children:({isHovered:U,...ne})=>t.jsxs(_,{className:F(B.tableHeaderCell,W,(Te[S.id]||U)&&B.showSortIcon,S.className),sortKey:S.sort?S.id.toString().toUpperCase():"",...ne,children:[D&&t.jsx("div",{children:D}),I&&t.jsxs("div",{className:B.descriptionSecondLine,children:[" ",I]})]})},S.id)}),$t=ye.isMobile?K:be,Vs=e.useMemo(()=>({custom:!0,...f&&{fixedHeader:!0}}),[f]),Ws=so.useTheme({Table:`
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
(function(global, factory) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@radix-ui/react-alert-dialog"), require("react/jsx-runtime"), require("class-variance-authority"), require("react"), require("@radix-ui/react-avatar"), require("@radix-ui/react-checkbox"), require("@radix-ui/react-collapsible"), require("@react-hook/resize-observer"), require("react-responsive"), require("@radix-ui/react-dialog"), require("react-icons/hi"), require("@radix-ui/react-hover-card"), require("@radix-ui/react-slot"), require("re-resizable"), require("react-transition-group"), require("react-dom"), require("react-error-boundary"), require("react-icons/ri"), require("@floating-ui/react"), require("@radix-ui/react-separator"), require("@radix-ui/react-popover"), require("@radix-ui/react-radio-group"), require("@radix-ui/react-dismissable-layer"), require("@radix-ui/react-toast"), require("@radix-ui/react-toggle"), require("@radix-ui/react-tooltip")) : typeof define === "function" && define.amd ? define(["exports", "@radix-ui/react-alert-dialog", "react/jsx-runtime", "class-variance-authority", "react", "@radix-ui/react-avatar", "@radix-ui/react-checkbox", "@radix-ui/react-collapsible", "@react-hook/resize-observer", "react-responsive", "@radix-ui/react-dialog", "react-icons/hi", "@radix-ui/react-hover-card", "@radix-ui/react-slot", "re-resizable", "react-transition-group", "react-dom", "react-error-boundary", "react-icons/ri", "@floating-ui/react", "@radix-ui/react-separator", "@radix-ui/react-popover", "@radix-ui/react-radio-group", "@radix-ui/react-dismissable-layer", "@radix-ui/react-toast", "@radix-ui/react-toggle", "@radix-ui/react-tooltip"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.blocks = {}, global.RadixAlertDialog, global.jsxRuntime, global.classVarianceAuthority, global.React, global.RadixAvatar, global.RadixCheckbox, global.RadixPrimitiveCollapsible, global.useResizeObserver, global.reactResponsive, global.RadixDialog, global.hi, global.RadixHoverCard, global.reactSlot, global.reResizable, global.reactTransitionGroup, global.ReactDOM, global.reactErrorBoundary, global.RiIcons, global.react, global.RadixSeparator, global.RadixPopover, global.RadixRadioGroup, global.reactDismissableLayer, global.RadixToast, global.Toggle, global.RadixTooltip));
|
|
3
|
+
})(this, function(exports2, RadixAlertDialog, jsxRuntime, classVarianceAuthority, React, RadixAvatar, RadixCheckbox, RadixPrimitiveCollapsible, useResizeObserver, reactResponsive, RadixDialog, hi, RadixHoverCard, reactSlot, reResizable, reactTransitionGroup, ReactDOM, reactErrorBoundary, RiIcons, react, RadixSeparator, RadixPopover, RadixRadioGroup, reactDismissableLayer, RadixToast, Toggle, RadixTooltip) {
|
|
4
|
+
"use strict";
|
|
5
|
+
function _interopNamespaceDefault(e) {
|
|
6
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
7
|
+
if (e) {
|
|
8
|
+
for (const k in e) {
|
|
9
|
+
if (k !== "default") {
|
|
10
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
11
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: () => e[k]
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
n.default = e;
|
|
19
|
+
return Object.freeze(n);
|
|
20
|
+
}
|
|
21
|
+
const RadixAlertDialog__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixAlertDialog);
|
|
22
|
+
const RadixAvatar__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixAvatar);
|
|
23
|
+
const RadixCheckbox__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixCheckbox);
|
|
24
|
+
const RadixPrimitiveCollapsible__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixPrimitiveCollapsible);
|
|
25
|
+
const RadixDialog__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixDialog);
|
|
26
|
+
const RadixHoverCard__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixHoverCard);
|
|
27
|
+
const RiIcons__namespace = /* @__PURE__ */ _interopNamespaceDefault(RiIcons);
|
|
28
|
+
const RadixSeparator__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixSeparator);
|
|
29
|
+
const RadixPopover__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixPopover);
|
|
30
|
+
const RadixRadioGroup__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixRadioGroup);
|
|
31
|
+
const RadixToast__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixToast);
|
|
32
|
+
const Toggle__namespace = /* @__PURE__ */ _interopNamespaceDefault(Toggle);
|
|
33
|
+
const RadixTooltip__namespace = /* @__PURE__ */ _interopNamespaceDefault(RadixTooltip);
|
|
34
|
+
const radiusCva = classVarianceAuthority.cva([], {
|
|
35
|
+
variants: {
|
|
36
|
+
maxLarge: {
|
|
37
|
+
true: [],
|
|
38
|
+
false: []
|
|
39
|
+
},
|
|
40
|
+
radius: {
|
|
41
|
+
none: ["rounded-none"],
|
|
42
|
+
xs: ["rounded-xs"],
|
|
43
|
+
sm: ["rounded-sm"],
|
|
44
|
+
md: ["rounded-md"],
|
|
45
|
+
lg: ["rounded-lg"],
|
|
46
|
+
xl: [],
|
|
47
|
+
full: []
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
compoundVariants: [
|
|
51
|
+
{
|
|
52
|
+
maxLarge: true,
|
|
53
|
+
radius: "xl",
|
|
54
|
+
className: ["rounded-lg"]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
maxLarge: true,
|
|
58
|
+
radius: "full",
|
|
59
|
+
className: ["rounded-lg"]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
maxLarge: false,
|
|
63
|
+
radius: "xl",
|
|
64
|
+
className: ["rounded-xl"]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
maxLarge: false,
|
|
68
|
+
radius: "full",
|
|
69
|
+
className: ["rounded-full"]
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
const ProviderContext = React.createContext({});
|
|
74
|
+
const useProvider = () => {
|
|
75
|
+
const context = React.useContext(ProviderContext);
|
|
76
|
+
if (!context) {
|
|
77
|
+
throw new Error("useProvider must be used within a Provider");
|
|
78
|
+
}
|
|
79
|
+
return context;
|
|
80
|
+
};
|
|
81
|
+
const Provider = (props) => {
|
|
82
|
+
const { accentColor, radius = "md", children } = props;
|
|
83
|
+
const contextValue = React.useMemo(
|
|
84
|
+
() => ({
|
|
85
|
+
accentColor,
|
|
86
|
+
radius
|
|
87
|
+
}),
|
|
88
|
+
[accentColor, radius]
|
|
89
|
+
);
|
|
90
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ProviderContext.Provider, { value: contextValue, children });
|
|
91
|
+
};
|
|
92
|
+
const dialogOverlay = classVarianceAuthority.cva([
|
|
93
|
+
"fixed",
|
|
94
|
+
"inset-0",
|
|
95
|
+
"duration-200",
|
|
96
|
+
"bg-(--black-a6)",
|
|
97
|
+
"dark:bg-(--black-a8)",
|
|
98
|
+
"data-[state='open']:animate-in",
|
|
99
|
+
"data-[state='open']:fade-in-0",
|
|
100
|
+
"data-[state='closed']:animate-out",
|
|
101
|
+
"data-[state='closed']:fade-out-0"
|
|
102
|
+
]);
|
|
103
|
+
const dialogContent = classVarianceAuthority.cva(
|
|
104
|
+
[
|
|
105
|
+
"flex",
|
|
106
|
+
"flex-col",
|
|
107
|
+
"h-max",
|
|
108
|
+
"[scrollbar-width:thin]",
|
|
109
|
+
"[scrollbar-color:var(--base-6)_transparent]",
|
|
110
|
+
"max-h-3/4",
|
|
111
|
+
"overflow-hidden",
|
|
112
|
+
"w-full",
|
|
113
|
+
"bg-(--base-2)",
|
|
114
|
+
"ring-1",
|
|
115
|
+
"ring-(--base-6)",
|
|
116
|
+
"fixed",
|
|
117
|
+
"left-[50%]",
|
|
118
|
+
"top-[50%]",
|
|
119
|
+
"translate-x-[-50%]",
|
|
120
|
+
"translate-y-[-50%]",
|
|
121
|
+
"duration-200",
|
|
122
|
+
"data-[state='open']:animate-in",
|
|
123
|
+
"data-[state='open']:fade-in-0",
|
|
124
|
+
"data-[state='open']:zoom-in-95",
|
|
125
|
+
"data-[state='closed']:animate-out",
|
|
126
|
+
"data-[state='closed']:fade-out-0",
|
|
127
|
+
"data-[state='closed']:zoom-out-95"
|
|
128
|
+
],
|
|
129
|
+
{
|
|
130
|
+
variants: {
|
|
131
|
+
size: {
|
|
132
|
+
xs: ["text-xs", "p-2", "max-w-xs"],
|
|
133
|
+
sm: ["text-sm", "p-3", "max-w-sm"],
|
|
134
|
+
md: ["text-md", "p-4", "max-w-md"],
|
|
135
|
+
lg: ["text-lg", "p-5", "max-w-lg"],
|
|
136
|
+
xl: ["text-xl", "p-6", "max-w-xl"]
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
defaultVariants: {
|
|
140
|
+
size: "md"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
const AlertDialogContent = React.forwardRef((props, ref) => {
|
|
145
|
+
const { radius } = useProvider();
|
|
146
|
+
const { className, size, container, ...rest } = props;
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixAlertDialog__namespace.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(RadixAlertDialog__namespace.Overlay, { className: dialogOverlay({}), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
148
|
+
RadixAlertDialog__namespace.Content,
|
|
149
|
+
{
|
|
150
|
+
className: classVarianceAuthority.cx(className, dialogContent({ size }), radiusCva({ radius, maxLarge: true })),
|
|
151
|
+
ref,
|
|
152
|
+
...rest
|
|
153
|
+
}
|
|
154
|
+
) }) });
|
|
155
|
+
});
|
|
156
|
+
AlertDialogContent.displayName = "AlertDialogContent";
|
|
157
|
+
const AlertDialogContext = React.createContext(() => {
|
|
158
|
+
throw new Error("No AlertDialogProvider found");
|
|
159
|
+
});
|
|
160
|
+
const useAlertDialog = () => {
|
|
161
|
+
const alertDialogContext = React.useContext(AlertDialogContext);
|
|
162
|
+
if (!alertDialogContext) {
|
|
163
|
+
throw new Error("No AlertDialogProvider found");
|
|
164
|
+
}
|
|
165
|
+
return alertDialogContext;
|
|
166
|
+
};
|
|
167
|
+
const ButtonGroupContext = React.createContext({});
|
|
168
|
+
const ButtonGroup = (props) => {
|
|
169
|
+
const providerContext = useProvider();
|
|
170
|
+
const { children, variant = "solid", size = "md", radius = providerContext.radius } = props;
|
|
171
|
+
const value = React.useMemo(
|
|
172
|
+
() => ({
|
|
173
|
+
variant,
|
|
174
|
+
size,
|
|
175
|
+
radius
|
|
176
|
+
}),
|
|
177
|
+
[radius, size, variant]
|
|
178
|
+
);
|
|
179
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ButtonGroupContext.Provider, { value, children });
|
|
180
|
+
};
|
|
181
|
+
ButtonGroup.displayName = "Buttons";
|
|
182
|
+
const useButtonGroup = () => React.useContext(ButtonGroupContext);
|
|
183
|
+
const button = classVarianceAuthority.cva(
|
|
184
|
+
[
|
|
185
|
+
"flex",
|
|
186
|
+
"items-center",
|
|
187
|
+
"justify-center",
|
|
188
|
+
"outline-none",
|
|
189
|
+
"transition-colors",
|
|
190
|
+
"disabled:opacity-50",
|
|
191
|
+
"disabled:pointer-events-none"
|
|
192
|
+
],
|
|
193
|
+
{
|
|
194
|
+
variants: {
|
|
195
|
+
variant: {
|
|
196
|
+
solid: [
|
|
197
|
+
"ring-(--accent-9)",
|
|
198
|
+
"bg-(--accent-9)",
|
|
199
|
+
"hover:bg-(--accent-10)",
|
|
200
|
+
"text-(--accent-contrast)",
|
|
201
|
+
"active:brightness-110",
|
|
202
|
+
"data-[state='open']:bg-(--accent-10)",
|
|
203
|
+
"focus-visible:outline-2",
|
|
204
|
+
"focus-visible:outline-(--accent-a8)",
|
|
205
|
+
"focus-visible:outline-offset-2"
|
|
206
|
+
],
|
|
207
|
+
soft: [
|
|
208
|
+
"bg-(--accent-a3)",
|
|
209
|
+
"hover:bg-(--accent-a4)",
|
|
210
|
+
"active:bg-(--accent-a5)",
|
|
211
|
+
"text-(--accent-a11)",
|
|
212
|
+
"data-[state='open']:bg-(--accent-a4)",
|
|
213
|
+
"focus-visible:ring-2",
|
|
214
|
+
"focus-visible:ring-(--accent-a8)"
|
|
215
|
+
],
|
|
216
|
+
ghost: [
|
|
217
|
+
"bg-transparent",
|
|
218
|
+
"hover:bg-(--accent-a3)",
|
|
219
|
+
"active:bg-(--accent-a4)",
|
|
220
|
+
"text-(--accent-a11)",
|
|
221
|
+
"data-[state='open']:bg-(--accent-a3)",
|
|
222
|
+
"focus-visible:ring-2",
|
|
223
|
+
"focus-visible:ring-(--accent-a8)"
|
|
224
|
+
],
|
|
225
|
+
surface: [
|
|
226
|
+
"bg-(--accent-surface)",
|
|
227
|
+
"hover:ring-(--accent-a8)",
|
|
228
|
+
"active:bg-(--accent-a3)",
|
|
229
|
+
"ring-1",
|
|
230
|
+
"ring-(--accent-a7)",
|
|
231
|
+
"text-(--accent-a11)",
|
|
232
|
+
"data-[state='open']:bg-(--accent-a4)",
|
|
233
|
+
"focus-visible:ring-2",
|
|
234
|
+
"focus-visible:ring-(--accent-a8)"
|
|
235
|
+
],
|
|
236
|
+
outline: [
|
|
237
|
+
"bg-transparent",
|
|
238
|
+
"ring-1",
|
|
239
|
+
"ring-(--accent-a7)",
|
|
240
|
+
"hover:ring-(--accent-a8)",
|
|
241
|
+
"hover:bg-(--accent-a3)",
|
|
242
|
+
"active:bg-(--accent-a4)",
|
|
243
|
+
"text-(--accent-a11)",
|
|
244
|
+
"data-[state='open']:ring-(--accent-a8)",
|
|
245
|
+
"data-[state='open']:bg-(--accent-a3)",
|
|
246
|
+
"focus-visible:ring-2",
|
|
247
|
+
"focus-visible:ring-(--accent-a8)"
|
|
248
|
+
]
|
|
249
|
+
},
|
|
250
|
+
icon: {
|
|
251
|
+
true: [],
|
|
252
|
+
false: []
|
|
253
|
+
},
|
|
254
|
+
size: {
|
|
255
|
+
xs: ["h-5", "text-xs", "gap-0.25"],
|
|
256
|
+
sm: ["h-6", "text-sm", "gap-0.5"],
|
|
257
|
+
md: ["h-7", "text-base", "gap-1"],
|
|
258
|
+
lg: ["h-8", "text-lg", "gap-1.5"],
|
|
259
|
+
xl: ["h-9", "text-xl", "gap-2"]
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
compoundVariants: [
|
|
263
|
+
{
|
|
264
|
+
icon: true,
|
|
265
|
+
size: "xs",
|
|
266
|
+
class: "w-5"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
icon: false,
|
|
270
|
+
size: "xs",
|
|
271
|
+
class: "px-2"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
icon: true,
|
|
275
|
+
size: "sm",
|
|
276
|
+
class: "w-6"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
icon: false,
|
|
280
|
+
size: "sm",
|
|
281
|
+
class: "px-2"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
icon: true,
|
|
285
|
+
size: "md",
|
|
286
|
+
class: "w-7"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
icon: false,
|
|
290
|
+
size: "md",
|
|
291
|
+
class: "px-3"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
icon: true,
|
|
295
|
+
size: "lg",
|
|
296
|
+
class: "w-8"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
icon: false,
|
|
300
|
+
size: "lg",
|
|
301
|
+
class: "px-4"
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
icon: true,
|
|
305
|
+
size: "xl",
|
|
306
|
+
class: "w-9"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
icon: false,
|
|
310
|
+
size: "xl",
|
|
311
|
+
class: "px-5"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
defaultVariants: {
|
|
315
|
+
size: "md",
|
|
316
|
+
icon: false,
|
|
317
|
+
variant: "solid"
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
);
|
|
321
|
+
const Button = React.memo(
|
|
322
|
+
React.forwardRef((props, ref) => {
|
|
323
|
+
const providerContext = useProvider();
|
|
324
|
+
const buttonsContext = useButtonGroup();
|
|
325
|
+
const {
|
|
326
|
+
children,
|
|
327
|
+
className,
|
|
328
|
+
variant = buttonsContext.variant,
|
|
329
|
+
size = buttonsContext.size,
|
|
330
|
+
radius = buttonsContext.radius ?? providerContext.radius,
|
|
331
|
+
accentColor = providerContext.accentColor,
|
|
332
|
+
...rest
|
|
333
|
+
} = props;
|
|
334
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
335
|
+
"button",
|
|
336
|
+
{
|
|
337
|
+
className: classVarianceAuthority.cx(
|
|
338
|
+
className,
|
|
339
|
+
button({ size, icon: false, variant }),
|
|
340
|
+
radiusCva({ radius, maxLarge: false })
|
|
341
|
+
),
|
|
342
|
+
ref,
|
|
343
|
+
"data-accent-color": accentColor,
|
|
344
|
+
...rest,
|
|
345
|
+
children
|
|
346
|
+
}
|
|
347
|
+
);
|
|
348
|
+
})
|
|
349
|
+
);
|
|
350
|
+
const IconButton = React.memo(
|
|
351
|
+
React.forwardRef((props, ref) => {
|
|
352
|
+
const providerContext = useProvider();
|
|
353
|
+
const buttonsContext = useButtonGroup();
|
|
354
|
+
const {
|
|
355
|
+
children,
|
|
356
|
+
className,
|
|
357
|
+
variant = buttonsContext.variant,
|
|
358
|
+
size = buttonsContext.size,
|
|
359
|
+
radius = buttonsContext.radius ?? providerContext.radius,
|
|
360
|
+
accentColor = providerContext.accentColor,
|
|
361
|
+
...rest
|
|
362
|
+
} = props;
|
|
363
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
364
|
+
"button",
|
|
365
|
+
{
|
|
366
|
+
className: classVarianceAuthority.cx(className, button({ size, icon: true, variant }), radiusCva({ radius, maxLarge: false })),
|
|
367
|
+
ref,
|
|
368
|
+
"data-accent-color": accentColor,
|
|
369
|
+
...rest,
|
|
370
|
+
children
|
|
371
|
+
}
|
|
372
|
+
);
|
|
373
|
+
})
|
|
374
|
+
);
|
|
375
|
+
const AlertDialogProvider = (props) => {
|
|
376
|
+
const { children } = props;
|
|
377
|
+
const [open, setOpen] = React.useState(false);
|
|
378
|
+
const [options, setOptions] = React.useState(null);
|
|
379
|
+
const handleOpenChange = React.useCallback(
|
|
380
|
+
(open2) => {
|
|
381
|
+
var _a;
|
|
382
|
+
setOpen(open2);
|
|
383
|
+
if (open2) return;
|
|
384
|
+
(_a = options == null ? void 0 : options.onClose) == null ? void 0 : _a.call(options);
|
|
385
|
+
},
|
|
386
|
+
[options]
|
|
387
|
+
);
|
|
388
|
+
const openAlertDialog = React.useCallback(
|
|
389
|
+
(config) => {
|
|
390
|
+
if (open) throw new Error("AlertDialog is already open");
|
|
391
|
+
setOpen(true);
|
|
392
|
+
setOptions({
|
|
393
|
+
size: "md",
|
|
394
|
+
action: "Confirm",
|
|
395
|
+
cancel: "Cancel",
|
|
396
|
+
...config
|
|
397
|
+
});
|
|
398
|
+
},
|
|
399
|
+
[open]
|
|
400
|
+
);
|
|
401
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(AlertDialogContext.Provider, { value: openAlertDialog, children: [
|
|
402
|
+
children,
|
|
403
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixAlertDialog__namespace.Root, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsx(AlertDialogContent, { size: options == null ? void 0 : options.size, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4", children: [
|
|
404
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
405
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixAlertDialog__namespace.Title, { className: "font-medium", children: options == null ? void 0 : options.title }),
|
|
406
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixAlertDialog__namespace.Description, { children: options == null ? void 0 : options.description })
|
|
407
|
+
] }),
|
|
408
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
409
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixAlertDialog__namespace.Cancel, { onClick: options == null ? void 0 : options.onCancel, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "soft", size: options == null ? void 0 : options.size, accentColor: "base", children: options == null ? void 0 : options.cancel }) }),
|
|
410
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixAlertDialog__namespace.Action, { onClick: options == null ? void 0 : options.onAction, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "solid", size: options == null ? void 0 : options.size, children: options == null ? void 0 : options.action }) })
|
|
411
|
+
] })
|
|
412
|
+
] }) }) })
|
|
413
|
+
] });
|
|
414
|
+
};
|
|
415
|
+
const AlertDialog = {
|
|
416
|
+
Content: AlertDialogContent,
|
|
417
|
+
Trigger: RadixAlertDialog__namespace.Trigger,
|
|
418
|
+
Root: RadixAlertDialog__namespace.Root,
|
|
419
|
+
Title: RadixAlertDialog__namespace.Title,
|
|
420
|
+
Description: RadixAlertDialog__namespace.Description,
|
|
421
|
+
Action: RadixAlertDialog__namespace.Action,
|
|
422
|
+
Cancel: RadixAlertDialog__namespace.Cancel
|
|
423
|
+
};
|
|
424
|
+
const AvatarContext = React.createContext({});
|
|
425
|
+
const avatar = classVarianceAuthority.cva([], {
|
|
426
|
+
variants: {
|
|
427
|
+
size: {
|
|
428
|
+
xs: ["h-5", "w-5", "text-xs"],
|
|
429
|
+
sm: ["h-6", "w-6", "text-sm"],
|
|
430
|
+
md: ["h-7", "w-7", "text-base"],
|
|
431
|
+
lg: ["h-8", "w-8", "text-lg"],
|
|
432
|
+
xl: ["h-9", "w-9", "text-xl"]
|
|
433
|
+
}
|
|
434
|
+
},
|
|
435
|
+
defaultVariants: {
|
|
436
|
+
size: "md"
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
const avatarFallback = classVarianceAuthority.cva(
|
|
440
|
+
["select-none", "flex", "items-center", "justify-center", "w-full", "h-full", "rounded-[inherit]"],
|
|
441
|
+
{
|
|
442
|
+
variants: {
|
|
443
|
+
variant: {
|
|
444
|
+
solid: ["bg-(--accent-9)", "text-(--accent-contrast)"],
|
|
445
|
+
soft: ["bg-(--accent-a3)", "text-(--accent-a11)"],
|
|
446
|
+
outline: ["bg-transparent", "ring-1", "ring-inset", "ring-(--accent-a7)", "text-(--accent-a11)"],
|
|
447
|
+
surface: ["bg-(--accent-surface)", "ring-1", "ring-inset", "ring-(--accent-a7)", "text-(--accent-a11)"]
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
defaultVariants: {
|
|
451
|
+
variant: "solid"
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
);
|
|
455
|
+
const AvatarFallback = React.forwardRef((props, ref) => {
|
|
456
|
+
const { className, ...rest } = props;
|
|
457
|
+
const { variant } = React.useContext(AvatarContext);
|
|
458
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixAvatar__namespace.AvatarFallback, { className: classVarianceAuthority.cx(className, avatarFallback({ variant })), ref, ...rest });
|
|
459
|
+
});
|
|
460
|
+
AvatarFallback.displayName = "AvatarFallback";
|
|
461
|
+
const AvatarImage = React.forwardRef((props, ref) => {
|
|
462
|
+
const { className, ...rest } = props;
|
|
463
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
464
|
+
RadixAvatar__namespace.Image,
|
|
465
|
+
{
|
|
466
|
+
className: classVarianceAuthority.cx(className, "object-cover", "rounded-[inherit]", "w-full", "h-full"),
|
|
467
|
+
ref,
|
|
468
|
+
...rest
|
|
469
|
+
}
|
|
470
|
+
);
|
|
471
|
+
});
|
|
472
|
+
AvatarImage.displayName = "AvatarImage";
|
|
473
|
+
const AvatarRoot = React.forwardRef((props, ref) => {
|
|
474
|
+
const providerContext = useProvider();
|
|
475
|
+
const {
|
|
476
|
+
className,
|
|
477
|
+
size,
|
|
478
|
+
variant = "solid",
|
|
479
|
+
accentColor = providerContext.accentColor,
|
|
480
|
+
radius = providerContext.radius,
|
|
481
|
+
children,
|
|
482
|
+
...rest
|
|
483
|
+
} = props;
|
|
484
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
485
|
+
RadixAvatar__namespace.Root,
|
|
486
|
+
{
|
|
487
|
+
className: classVarianceAuthority.cx(className, avatar({ size }), radiusCva({ radius, maxLarge: false })),
|
|
488
|
+
ref,
|
|
489
|
+
"data-accent-color": accentColor,
|
|
490
|
+
...rest,
|
|
491
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(AvatarContext.Provider, { value: { variant }, children })
|
|
492
|
+
}
|
|
493
|
+
);
|
|
494
|
+
});
|
|
495
|
+
AvatarRoot.displayName = "AvatarRoot";
|
|
496
|
+
const Avatar = {
|
|
497
|
+
Fallback: AvatarFallback,
|
|
498
|
+
Image: AvatarImage,
|
|
499
|
+
Root: AvatarRoot
|
|
500
|
+
};
|
|
501
|
+
const badge = classVarianceAuthority.cva(["flex", "items-center"], {
|
|
502
|
+
variants: {
|
|
503
|
+
icon: {
|
|
504
|
+
true: ["justify-center"],
|
|
505
|
+
false: []
|
|
506
|
+
},
|
|
507
|
+
size: {
|
|
508
|
+
xs: ["h-5", "text-xs", "gap-0.25"],
|
|
509
|
+
sm: ["h-6", "text-sm", "gap-0.5"],
|
|
510
|
+
md: ["h-7", "text-base", "gap-1"],
|
|
511
|
+
lg: ["h-8", "text-lg", "gap-1.5"],
|
|
512
|
+
xl: ["h-9", "text-xl", "gap-2"]
|
|
513
|
+
},
|
|
514
|
+
variant: {
|
|
515
|
+
solid: ["bg-(--accent-9)", "text-(--accent-contrast)"],
|
|
516
|
+
soft: ["bg-(--accent-a3)", "text-(--accent-a11)"],
|
|
517
|
+
outline: ["bg-transparent", "ring-1", "ring-(--accent-a7)", "text-(--accent-a11)"],
|
|
518
|
+
surface: ["bg-(--accent-surface)", "ring-1", "ring-(--accent-a7)", "text-(--accent-a11)"]
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
compoundVariants: [
|
|
522
|
+
{
|
|
523
|
+
icon: true,
|
|
524
|
+
size: "xs",
|
|
525
|
+
class: "w-5"
|
|
526
|
+
},
|
|
527
|
+
{
|
|
528
|
+
icon: false,
|
|
529
|
+
size: "xs",
|
|
530
|
+
class: "px-2"
|
|
531
|
+
},
|
|
532
|
+
{
|
|
533
|
+
icon: true,
|
|
534
|
+
size: "sm",
|
|
535
|
+
class: "w-6"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
icon: false,
|
|
539
|
+
size: "sm",
|
|
540
|
+
class: "px-2"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
icon: true,
|
|
544
|
+
size: "md",
|
|
545
|
+
class: "w-7"
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
icon: false,
|
|
549
|
+
size: "md",
|
|
550
|
+
class: "px-3"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
icon: true,
|
|
554
|
+
size: "lg",
|
|
555
|
+
class: "w-8"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
icon: false,
|
|
559
|
+
size: "lg",
|
|
560
|
+
class: "px-4"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
icon: true,
|
|
564
|
+
size: "xl",
|
|
565
|
+
class: "w-9"
|
|
566
|
+
},
|
|
567
|
+
{
|
|
568
|
+
icon: false,
|
|
569
|
+
size: "xl",
|
|
570
|
+
class: "px-5"
|
|
571
|
+
}
|
|
572
|
+
],
|
|
573
|
+
defaultVariants: {
|
|
574
|
+
size: "md",
|
|
575
|
+
variant: "solid",
|
|
576
|
+
icon: false
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
const Badge = React.forwardRef((props, ref) => {
|
|
580
|
+
const providerContext = useProvider();
|
|
581
|
+
const {
|
|
582
|
+
children,
|
|
583
|
+
className,
|
|
584
|
+
accentColor = providerContext.accentColor,
|
|
585
|
+
radius = providerContext.radius,
|
|
586
|
+
variant,
|
|
587
|
+
size,
|
|
588
|
+
icon,
|
|
589
|
+
...rest
|
|
590
|
+
} = props;
|
|
591
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
592
|
+
"span",
|
|
593
|
+
{
|
|
594
|
+
className: classVarianceAuthority.cx(className, badge({ variant, size, icon }), radiusCva({ radius, maxLarge: false })),
|
|
595
|
+
ref,
|
|
596
|
+
"data-accent-color": accentColor,
|
|
597
|
+
...rest,
|
|
598
|
+
children
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
});
|
|
602
|
+
Badge.displayName = "Badge";
|
|
603
|
+
const CheckboxIndicator = React.forwardRef((props, ref) => {
|
|
604
|
+
const { className, ...rest } = props;
|
|
605
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
606
|
+
RadixCheckbox__namespace.CheckboxIndicator,
|
|
607
|
+
{
|
|
608
|
+
className: classVarianceAuthority.cx(className, "flex items-center justify-center"),
|
|
609
|
+
ref,
|
|
610
|
+
...rest
|
|
611
|
+
}
|
|
612
|
+
);
|
|
613
|
+
});
|
|
614
|
+
CheckboxIndicator.displayName = "CheckboxIndicator";
|
|
615
|
+
const checkbox = classVarianceAuthority.cva(
|
|
616
|
+
[
|
|
617
|
+
"outline-0",
|
|
618
|
+
"transition-colors",
|
|
619
|
+
"focus-visible:ring-2",
|
|
620
|
+
"ring-(--accent-a8)",
|
|
621
|
+
"disabled:opacity-50",
|
|
622
|
+
"disabled:pointer-events-none"
|
|
623
|
+
],
|
|
624
|
+
{
|
|
625
|
+
variants: {
|
|
626
|
+
variant: {
|
|
627
|
+
surface: [
|
|
628
|
+
"ring-1",
|
|
629
|
+
"ring-inset",
|
|
630
|
+
"ring-(--base-a7)",
|
|
631
|
+
"bg-(--base-surface)",
|
|
632
|
+
"data-[state='checked']:bg-(--accent-indicator)",
|
|
633
|
+
"data-[state='checked']:ring-(--accent-indicator)",
|
|
634
|
+
"text-(--accent-contrast)"
|
|
635
|
+
],
|
|
636
|
+
soft: ["bg-(--accent-a5)", "text-(--accent-a11)"],
|
|
637
|
+
outline: ["bg-transparent", "ring-1", "ring-(--accent-a7)", "text-(--accent-a11)"]
|
|
638
|
+
},
|
|
639
|
+
size: {
|
|
640
|
+
xs: ["h-4", "w-4", "text-xs"],
|
|
641
|
+
sm: ["h-5", "w-5", "text-sm"],
|
|
642
|
+
md: ["h-6", "w-6", "text-base"],
|
|
643
|
+
lg: ["h-7", "w-7", "text-lg"],
|
|
644
|
+
xl: ["h-8", "w-8", "text-xl"]
|
|
645
|
+
}
|
|
646
|
+
},
|
|
647
|
+
defaultVariants: {
|
|
648
|
+
variant: "surface",
|
|
649
|
+
size: "md"
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
);
|
|
653
|
+
const CheckboxRoot = React.forwardRef((props, ref) => {
|
|
654
|
+
const providerContext = useProvider();
|
|
655
|
+
const {
|
|
656
|
+
className,
|
|
657
|
+
variant,
|
|
658
|
+
size,
|
|
659
|
+
radius = providerContext.radius,
|
|
660
|
+
accentColor = providerContext.accentColor,
|
|
661
|
+
...rest
|
|
662
|
+
} = props;
|
|
663
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
664
|
+
RadixCheckbox__namespace.Root,
|
|
665
|
+
{
|
|
666
|
+
className: classVarianceAuthority.cx(className, checkbox({ variant, size }), radiusCva({ radius, maxLarge: true })),
|
|
667
|
+
ref,
|
|
668
|
+
"data-accent-color": accentColor,
|
|
669
|
+
...rest
|
|
670
|
+
}
|
|
671
|
+
);
|
|
672
|
+
});
|
|
673
|
+
CheckboxRoot.displayName = "CheckboxRoot";
|
|
674
|
+
const Checkbox = {
|
|
675
|
+
Root: CheckboxRoot,
|
|
676
|
+
Indicator: CheckboxIndicator
|
|
677
|
+
};
|
|
678
|
+
const useViewportSize = () => {
|
|
679
|
+
const [prevSize, setPrevSize] = React.useState("initial");
|
|
680
|
+
const [size, setSize] = React.useState("initial");
|
|
681
|
+
const xs = reactResponsive.useMediaQuery({ minWidth: "520px" });
|
|
682
|
+
const sm = reactResponsive.useMediaQuery({ minWidth: "768px" });
|
|
683
|
+
const md = reactResponsive.useMediaQuery({ minWidth: "1024px" });
|
|
684
|
+
const lg = reactResponsive.useMediaQuery({ minWidth: "1280px" });
|
|
685
|
+
const xl = reactResponsive.useMediaQuery({ minWidth: "1640px" });
|
|
686
|
+
React.useLayoutEffect(() => {
|
|
687
|
+
setSize((prev) => {
|
|
688
|
+
setPrevSize(prev);
|
|
689
|
+
return xl ? "xl" : lg ? "lg" : md ? "md" : sm ? "sm" : xs ? "xs" : "initial";
|
|
690
|
+
});
|
|
691
|
+
}, [lg, md, sm, xl, xs]);
|
|
692
|
+
return { size, prevSize, xs, sm, md, lg, xl };
|
|
693
|
+
};
|
|
694
|
+
const useStopEventPropagation = () => {
|
|
695
|
+
return React.useCallback((event) => {
|
|
696
|
+
event.stopPropagation();
|
|
697
|
+
}, []);
|
|
698
|
+
};
|
|
699
|
+
function useTextFilter(values, filterFunction) {
|
|
700
|
+
const [filteredOptions, setFilteredOptions] = React.useState([]);
|
|
701
|
+
const [filterValue, setFilterValue] = React.useState("");
|
|
702
|
+
React.useEffect(() => {
|
|
703
|
+
setFilteredOptions(values.filter((value) => filterFunction(value, filterValue)));
|
|
704
|
+
}, [filterFunction, filterValue, values]);
|
|
705
|
+
return [filteredOptions, filterValue, setFilterValue];
|
|
706
|
+
}
|
|
707
|
+
const useSize = (target) => {
|
|
708
|
+
const [size, setSize] = React.useState();
|
|
709
|
+
React.useLayoutEffect(() => {
|
|
710
|
+
var _a;
|
|
711
|
+
setSize((_a = target.current) == null ? void 0 : _a.getBoundingClientRect());
|
|
712
|
+
}, [target]);
|
|
713
|
+
const handleResize = React.useCallback((entry) => {
|
|
714
|
+
const rect = entry.contentRect;
|
|
715
|
+
setSize(rect);
|
|
716
|
+
}, []);
|
|
717
|
+
useResizeObserver(target, handleResize);
|
|
718
|
+
return size;
|
|
719
|
+
};
|
|
720
|
+
const splitTextForEllipsisAndExpansion = (text, numChars) => {
|
|
721
|
+
const indexOfSpace = text.indexOf(" ", numChars);
|
|
722
|
+
const firstLine = indexOfSpace === -1 ? text : text.substring(0, indexOfSpace);
|
|
723
|
+
const secondLine = indexOfSpace === -1 ? "" : text.substring(indexOfSpace);
|
|
724
|
+
return [firstLine, secondLine];
|
|
725
|
+
};
|
|
726
|
+
const genericMemo = React.memo;
|
|
727
|
+
function useControlledState(args) {
|
|
728
|
+
const { state, setState, initialState } = args;
|
|
729
|
+
const [uncontrolledState, setUncontrolledState] = React.useState(initialState);
|
|
730
|
+
return [state !== void 0 ? state : uncontrolledState, setState !== void 0 ? setState : setUncontrolledState];
|
|
731
|
+
}
|
|
732
|
+
const CollapsibleTreeContext = React.createContext(
|
|
733
|
+
{}
|
|
734
|
+
);
|
|
735
|
+
function useCollapsibleTreeContext() {
|
|
736
|
+
return React.useContext(CollapsibleTreeContext);
|
|
737
|
+
}
|
|
738
|
+
const CollapsibleNode = genericMemo(function(props) {
|
|
739
|
+
const { meta, nodes, level = 0, disabled } = props;
|
|
740
|
+
const [controlledOpenState, setControlledOpenState] = React.useState(false);
|
|
741
|
+
const {
|
|
742
|
+
nodeRenderer,
|
|
743
|
+
disabled: disabledFromContext,
|
|
744
|
+
onNodeOpen,
|
|
745
|
+
onNodeClose,
|
|
746
|
+
onNodeClick,
|
|
747
|
+
nodeStyles,
|
|
748
|
+
nodeClassName
|
|
749
|
+
} = useCollapsibleTreeContext();
|
|
750
|
+
const isDisabled = disabled ?? disabledFromContext;
|
|
751
|
+
const handleClick = React.useCallback(() => {
|
|
752
|
+
if (onNodeClick) onNodeClick(meta);
|
|
753
|
+
}, [meta, onNodeClick]);
|
|
754
|
+
const toggleOpenState = React.useCallback(() => {
|
|
755
|
+
setControlledOpenState(!controlledOpenState);
|
|
756
|
+
if (!controlledOpenState && onNodeOpen) onNodeOpen(meta);
|
|
757
|
+
if (controlledOpenState && onNodeClose) onNodeClose(meta);
|
|
758
|
+
}, [meta, onNodeClose, onNodeOpen, controlledOpenState]);
|
|
759
|
+
const { children, style, className } = React.useMemo(() => {
|
|
760
|
+
return nodeRenderer({
|
|
761
|
+
meta,
|
|
762
|
+
toggleOpen: toggleOpenState,
|
|
763
|
+
open: controlledOpenState,
|
|
764
|
+
disabled: isDisabled
|
|
765
|
+
});
|
|
766
|
+
}, [isDisabled, meta, nodeRenderer, toggleOpenState, controlledOpenState]);
|
|
767
|
+
const combinedStyles = React.useMemo(
|
|
768
|
+
() => ({
|
|
769
|
+
// want node specific styles to overwrite and global node styles
|
|
770
|
+
...nodeStyles,
|
|
771
|
+
...style
|
|
772
|
+
}),
|
|
773
|
+
[nodeStyles, style]
|
|
774
|
+
);
|
|
775
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixPrimitiveCollapsible__namespace.Root, { asChild: true, open: controlledOpenState, disabled: isDisabled, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col w-full", children: [
|
|
776
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
777
|
+
"div",
|
|
778
|
+
{
|
|
779
|
+
onClick: handleClick,
|
|
780
|
+
className: classVarianceAuthority.cx(nodeClassName, className, "w-full flex items-center shrink-0"),
|
|
781
|
+
style: combinedStyles,
|
|
782
|
+
"data-state": controlledOpenState ? "open" : "closed",
|
|
783
|
+
"data-disabled": isDisabled,
|
|
784
|
+
children
|
|
785
|
+
}
|
|
786
|
+
),
|
|
787
|
+
nodes && nodes.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(RadixPrimitiveCollapsible__namespace.Content, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full flex flex-col h-max pl-2", children: nodes.map((treeNodeProps, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
788
|
+
CollapsibleNode,
|
|
789
|
+
{
|
|
790
|
+
level: level + 1,
|
|
791
|
+
...treeNodeProps
|
|
792
|
+
},
|
|
793
|
+
`${level},${index}`
|
|
794
|
+
)) }) })
|
|
795
|
+
] }) });
|
|
796
|
+
});
|
|
797
|
+
const CollapsibleTree = genericMemo(function(props) {
|
|
798
|
+
const {
|
|
799
|
+
nodes,
|
|
800
|
+
disabled = false,
|
|
801
|
+
nodeClassName,
|
|
802
|
+
nodeStyles,
|
|
803
|
+
onNodeClick,
|
|
804
|
+
onNodeClose,
|
|
805
|
+
onNodeOpen,
|
|
806
|
+
nodeRenderer,
|
|
807
|
+
...rest
|
|
808
|
+
} = props;
|
|
809
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
810
|
+
CollapsibleTreeContext.Provider,
|
|
811
|
+
{
|
|
812
|
+
value: {
|
|
813
|
+
nodeRenderer,
|
|
814
|
+
nodeClassName,
|
|
815
|
+
nodeStyles,
|
|
816
|
+
disabled,
|
|
817
|
+
onNodeClick,
|
|
818
|
+
onNodeClose,
|
|
819
|
+
onNodeOpen
|
|
820
|
+
},
|
|
821
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col w-full h-max", ...rest, children: nodes.map((treeNodeProps, index) => /* @__PURE__ */ jsxRuntime.jsx(CollapsibleNode, { ...treeNodeProps }, `${0},${index}`)) })
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
});
|
|
825
|
+
const CloseDialogContext = React.createContext({});
|
|
826
|
+
const useCloseDialog = () => {
|
|
827
|
+
const dialogContext = React.useContext(CloseDialogContext);
|
|
828
|
+
if (!dialogContext) {
|
|
829
|
+
throw new Error("useDialog must be used within a DialogRoot");
|
|
830
|
+
}
|
|
831
|
+
return dialogContext;
|
|
832
|
+
};
|
|
833
|
+
const DialogContent = React.forwardRef((props, ref) => {
|
|
834
|
+
const { radius } = useProvider();
|
|
835
|
+
const close = useCloseDialog();
|
|
836
|
+
const { children, title, container, className, size, ...rest } = props;
|
|
837
|
+
const computedChildren = React.useMemo(() => {
|
|
838
|
+
return typeof children === "function" ? children(close) : children;
|
|
839
|
+
}, [children, close]);
|
|
840
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Overlay, { className: dialogOverlay({}), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
841
|
+
RadixDialog__namespace.Content,
|
|
842
|
+
{
|
|
843
|
+
className: classVarianceAuthority.cx(className, dialogContent({ size }), radiusCva({ radius, maxLarge: true })),
|
|
844
|
+
ref,
|
|
845
|
+
...rest,
|
|
846
|
+
children: [
|
|
847
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between w-full h-max", children: [
|
|
848
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Title, { className: "font-medium", children: title }),
|
|
849
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { accentColor: "base", size, variant: "ghost", children: /* @__PURE__ */ jsxRuntime.jsx(hi.HiX, {}) }) })
|
|
850
|
+
] }),
|
|
851
|
+
computedChildren
|
|
852
|
+
]
|
|
853
|
+
}
|
|
854
|
+
) }) });
|
|
855
|
+
});
|
|
856
|
+
DialogContent.displayName = "DialogContent";
|
|
857
|
+
const DialogRoot = (props) => {
|
|
858
|
+
const {
|
|
859
|
+
children,
|
|
860
|
+
onOpen,
|
|
861
|
+
onClose,
|
|
862
|
+
defaultOpen,
|
|
863
|
+
onCloseInterrupt,
|
|
864
|
+
open: externalOpen,
|
|
865
|
+
onOpenChange: externalOpenChange
|
|
866
|
+
} = props;
|
|
867
|
+
const [innerOpen, setInnerOpen] = React.useState(defaultOpen ?? false);
|
|
868
|
+
const open = externalOpen ?? innerOpen;
|
|
869
|
+
if ((!!onCloseInterrupt || !!onOpen) && !!externalOpenChange) {
|
|
870
|
+
throw new Error("Neither the `onCloseInterrupt` nor `onOpen` props can be used with `onOpenChange`.");
|
|
871
|
+
}
|
|
872
|
+
if (externalOpen !== void 0 && externalOpenChange === void 0) {
|
|
873
|
+
throw new Error("The `open` prop requires the `onOpenChange` prop.");
|
|
874
|
+
}
|
|
875
|
+
if (!children && externalOpen === void 0) {
|
|
876
|
+
throw new Error("Either the `children` or `open` prop must be defined.");
|
|
877
|
+
} else if (children && externalOpen !== void 0) {
|
|
878
|
+
throw new Error("The `children` and `open` props cannot be used together.");
|
|
879
|
+
}
|
|
880
|
+
const handleOpenChange = React.useCallback(
|
|
881
|
+
(next) => {
|
|
882
|
+
if (externalOpenChange) return externalOpenChange(next);
|
|
883
|
+
if (next && onOpen) {
|
|
884
|
+
onOpen();
|
|
885
|
+
} else if (!next && onCloseInterrupt) {
|
|
886
|
+
const confirmClose = () => {
|
|
887
|
+
setInnerOpen(false);
|
|
888
|
+
if (onClose) onClose();
|
|
889
|
+
};
|
|
890
|
+
return onCloseInterrupt(confirmClose);
|
|
891
|
+
} else if (!next && onClose) {
|
|
892
|
+
onClose();
|
|
893
|
+
}
|
|
894
|
+
setInnerOpen(next);
|
|
895
|
+
},
|
|
896
|
+
[externalOpenChange, onOpen, onClose, onCloseInterrupt]
|
|
897
|
+
);
|
|
898
|
+
const closeDialog = React.useCallback(
|
|
899
|
+
(options) => {
|
|
900
|
+
if (options == null ? void 0 : options.force) {
|
|
901
|
+
return setInnerOpen(false);
|
|
902
|
+
}
|
|
903
|
+
handleOpenChange(false);
|
|
904
|
+
},
|
|
905
|
+
[handleOpenChange]
|
|
906
|
+
);
|
|
907
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixDialog__namespace.Root, { open, onOpenChange: handleOpenChange, children: /* @__PURE__ */ jsxRuntime.jsx(CloseDialogContext.Provider, { value: closeDialog, children }) });
|
|
908
|
+
};
|
|
909
|
+
const Dialog = {
|
|
910
|
+
Root: DialogRoot,
|
|
911
|
+
Content: DialogContent,
|
|
912
|
+
Trigger: RadixDialog__namespace.Trigger,
|
|
913
|
+
Close: RadixDialog__namespace.Close
|
|
914
|
+
};
|
|
915
|
+
const HoverCardArrow = React.forwardRef((props, ref) => {
|
|
916
|
+
const { className, ...rest } = props;
|
|
917
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixHoverCard__namespace.Arrow, { className: classVarianceAuthority.cx(className, "fill-(--base-6)"), ref, ...rest });
|
|
918
|
+
});
|
|
919
|
+
HoverCardArrow.displayName = "HoverCardArrow";
|
|
920
|
+
const floating = classVarianceAuthority.cva(
|
|
921
|
+
[
|
|
922
|
+
"data-[state=open]:animate-in",
|
|
923
|
+
"data-[state=open]:fade-in-0",
|
|
924
|
+
"data-[state=open]:zoom-in-95",
|
|
925
|
+
"data-[state=closed]:animate-out",
|
|
926
|
+
"data-[state=closed]:fade-out-0",
|
|
927
|
+
"data-[state=closed]:zoom-out-95"
|
|
928
|
+
],
|
|
929
|
+
{
|
|
930
|
+
variants: {
|
|
931
|
+
shadow: {
|
|
932
|
+
"1": ["shadow-xs"],
|
|
933
|
+
"2": ["shadow-sm"],
|
|
934
|
+
"3": ["shadow-md"],
|
|
935
|
+
"4": ["shadow-lg"],
|
|
936
|
+
"5": ["shadow-xl"]
|
|
937
|
+
},
|
|
938
|
+
side: {
|
|
939
|
+
top: ["data-[side=top]:slide-in-from-bottom-2"],
|
|
940
|
+
right: ["data-[side=right]:slide-in-from-left-2"],
|
|
941
|
+
bottom: ["data-[side=bottom]:slide-in-from-top-2"],
|
|
942
|
+
left: ["data-[side=left]:slide-in-from-right-2"]
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
);
|
|
947
|
+
const hoverCardContent = classVarianceAuthority.cva(["bg-(--base-1)", "ring-1", "ring-(--base-6)"], {
|
|
948
|
+
variants: {
|
|
949
|
+
size: {
|
|
950
|
+
xs: ["text-xs", "p-2"],
|
|
951
|
+
sm: ["text-sm", "p-3"],
|
|
952
|
+
md: ["text-base", "p-4"],
|
|
953
|
+
lg: ["text-lg", "p-5"],
|
|
954
|
+
xl: ["text-xl", "p-6"]
|
|
955
|
+
}
|
|
956
|
+
},
|
|
957
|
+
defaultVariants: {
|
|
958
|
+
size: "md"
|
|
959
|
+
}
|
|
960
|
+
});
|
|
961
|
+
const HoverCardContent = React.forwardRef((props, ref) => {
|
|
962
|
+
const providerContext = useProvider();
|
|
963
|
+
const {
|
|
964
|
+
className,
|
|
965
|
+
size,
|
|
966
|
+
side,
|
|
967
|
+
radius = providerContext.radius,
|
|
968
|
+
accentColor = providerContext.accentColor,
|
|
969
|
+
sideOffset = 4,
|
|
970
|
+
container,
|
|
971
|
+
...rest
|
|
972
|
+
} = props;
|
|
973
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixHoverCard__namespace.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
974
|
+
RadixHoverCard__namespace.Content,
|
|
975
|
+
{
|
|
976
|
+
className: classVarianceAuthority.cx(
|
|
977
|
+
className,
|
|
978
|
+
hoverCardContent({ size }),
|
|
979
|
+
floating({ side, shadow: "3" }),
|
|
980
|
+
radiusCva({ radius, maxLarge: true })
|
|
981
|
+
),
|
|
982
|
+
ref,
|
|
983
|
+
side,
|
|
984
|
+
"data-accent-color": accentColor,
|
|
985
|
+
sideOffset,
|
|
986
|
+
...rest
|
|
987
|
+
}
|
|
988
|
+
) });
|
|
989
|
+
});
|
|
990
|
+
HoverCardContent.displayName = "HoverCardContent";
|
|
991
|
+
const HoverCard = {
|
|
992
|
+
Arrow: HoverCardArrow,
|
|
993
|
+
Content: HoverCardContent,
|
|
994
|
+
Root: RadixHoverCard__namespace.Root,
|
|
995
|
+
Trigger: RadixHoverCard__namespace.Trigger
|
|
996
|
+
};
|
|
997
|
+
const HoverUtility = React.memo(function Root2({ children, forceHover }) {
|
|
998
|
+
const [isHovered, setIsHovered] = React.useState(false);
|
|
999
|
+
const handlePointerEnter = React.useCallback(() => {
|
|
1000
|
+
setIsHovered(true);
|
|
1001
|
+
}, []);
|
|
1002
|
+
const handlePointerLeave = React.useCallback(() => {
|
|
1003
|
+
setIsHovered(false);
|
|
1004
|
+
}, []);
|
|
1005
|
+
return children({
|
|
1006
|
+
isHovered: forceHover !== void 0 ? forceHover : isHovered,
|
|
1007
|
+
onPointerEnter: handlePointerEnter,
|
|
1008
|
+
onPointerLeave: handlePointerLeave
|
|
1009
|
+
});
|
|
1010
|
+
});
|
|
1011
|
+
const InputContext = React.createContext({});
|
|
1012
|
+
const inputRoot$1 = classVarianceAuthority.cva(
|
|
1013
|
+
[
|
|
1014
|
+
"flex",
|
|
1015
|
+
"items-stretch",
|
|
1016
|
+
"transition-colors",
|
|
1017
|
+
"has-[:focus]:ring-2",
|
|
1018
|
+
"has-[:focus]:ring-(--accent-a8)",
|
|
1019
|
+
"has-[:disabled]:opacity-50",
|
|
1020
|
+
"has-[:disabled]:pointer-events-none"
|
|
1021
|
+
],
|
|
1022
|
+
{
|
|
1023
|
+
variants: {
|
|
1024
|
+
variant: {
|
|
1025
|
+
surface: ["ring-1", "ring-(--accent-a7)", "bg-(--accent-surface)", "text-(--accent-a12)"],
|
|
1026
|
+
soft: ["bg-(--accent-a3)", "text-(--accent-12)"],
|
|
1027
|
+
outline: ["ring-1", "ring-(--base-a7)", "bg-transparent", "text-(--base-12)"]
|
|
1028
|
+
},
|
|
1029
|
+
size: {
|
|
1030
|
+
xs: ["h-5", "text-xs"],
|
|
1031
|
+
sm: ["h-6", "text-sm"],
|
|
1032
|
+
md: ["h-7", "text-base"],
|
|
1033
|
+
lg: ["h-8", "text-lg"],
|
|
1034
|
+
xl: ["h-9", "text-xl"]
|
|
1035
|
+
}
|
|
1036
|
+
},
|
|
1037
|
+
defaultVariants: {
|
|
1038
|
+
size: "md",
|
|
1039
|
+
variant: "surface"
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
);
|
|
1043
|
+
const inputField = classVarianceAuthority.cva(["peer-[.slot]/slot:indent-0"], {
|
|
1044
|
+
variants: {
|
|
1045
|
+
variant: {
|
|
1046
|
+
surface: ["placeholder-(--accent-12)", "placeholder:opacity-60", "selection:bg-(--accent-a5)"],
|
|
1047
|
+
soft: ["placeholder-(--accent-12)", "placeholder:opacity-60", "selection:bg-(--accent-a5)"],
|
|
1048
|
+
outline: ["placeholder-(--base-a9)", "selection:bg-(--accent-a5)"]
|
|
1049
|
+
},
|
|
1050
|
+
size: {
|
|
1051
|
+
xs: ["indent-1"],
|
|
1052
|
+
sm: ["indent-1.5"],
|
|
1053
|
+
md: ["indent-2"],
|
|
1054
|
+
lg: ["indent-2.5"],
|
|
1055
|
+
xl: ["indent-3"]
|
|
1056
|
+
}
|
|
1057
|
+
},
|
|
1058
|
+
defaultVariants: {
|
|
1059
|
+
size: "md",
|
|
1060
|
+
variant: "surface"
|
|
1061
|
+
}
|
|
1062
|
+
});
|
|
1063
|
+
const inputSlot = classVarianceAuthority.cva(["peer/slot", "slot"], {
|
|
1064
|
+
variants: {
|
|
1065
|
+
size: {
|
|
1066
|
+
xs: ["px-1"],
|
|
1067
|
+
sm: ["px-1.5"],
|
|
1068
|
+
md: ["px-2"],
|
|
1069
|
+
lg: ["px-2.5"],
|
|
1070
|
+
xl: ["px-3"]
|
|
1071
|
+
},
|
|
1072
|
+
variant: {
|
|
1073
|
+
surface: ["text-(--accent-12)"],
|
|
1074
|
+
soft: ["text-(--accent-12)"],
|
|
1075
|
+
outline: ["text-(--base-a11)"]
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
defaultVariants: {
|
|
1079
|
+
size: "md"
|
|
1080
|
+
}
|
|
1081
|
+
});
|
|
1082
|
+
const InputField = React.forwardRef((props, ref) => {
|
|
1083
|
+
const { className, ...rest } = props;
|
|
1084
|
+
const { size, variant } = React.useContext(InputContext);
|
|
1085
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1086
|
+
"input",
|
|
1087
|
+
{
|
|
1088
|
+
className: classVarianceAuthority.cx(className, inputField({ size, variant }), "bg-transparent outline-0 grow"),
|
|
1089
|
+
ref,
|
|
1090
|
+
...rest
|
|
1091
|
+
}
|
|
1092
|
+
);
|
|
1093
|
+
});
|
|
1094
|
+
InputField.displayName = "InputField";
|
|
1095
|
+
const InputRoot = React.forwardRef((props, ref) => {
|
|
1096
|
+
const providerContext = useProvider();
|
|
1097
|
+
const {
|
|
1098
|
+
className,
|
|
1099
|
+
variant = "surface",
|
|
1100
|
+
size = "md",
|
|
1101
|
+
accentColor = providerContext.accentColor,
|
|
1102
|
+
radius = providerContext.radius,
|
|
1103
|
+
...rest
|
|
1104
|
+
} = props;
|
|
1105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(InputContext.Provider, { value: { size, variant }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1106
|
+
"div",
|
|
1107
|
+
{
|
|
1108
|
+
className: classVarianceAuthority.cx(className, inputRoot$1({ variant, size }), radiusCva({ radius, maxLarge: false })),
|
|
1109
|
+
ref,
|
|
1110
|
+
"data-accent-color": accentColor,
|
|
1111
|
+
...rest
|
|
1112
|
+
}
|
|
1113
|
+
) });
|
|
1114
|
+
});
|
|
1115
|
+
InputRoot.displayName = "InputRoot";
|
|
1116
|
+
const InputSlot = React.forwardRef((props, ref) => {
|
|
1117
|
+
const { className, ...rest } = props;
|
|
1118
|
+
const { size, variant } = React.useContext(InputContext);
|
|
1119
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classVarianceAuthority.cx(className, inputSlot({ size, variant }), "flex items-center"), ref, ...rest });
|
|
1120
|
+
});
|
|
1121
|
+
InputSlot.displayName = "InputSlot";
|
|
1122
|
+
const Input = {
|
|
1123
|
+
Field: InputField,
|
|
1124
|
+
Root: InputRoot,
|
|
1125
|
+
Slot: InputSlot
|
|
1126
|
+
};
|
|
1127
|
+
const LayoutContext = React.createContext({});
|
|
1128
|
+
const useLayoutContext = () => React.useContext(LayoutContext);
|
|
1129
|
+
const Container = React.memo(
|
|
1130
|
+
React.forwardRef((props, ref) => {
|
|
1131
|
+
const { children, className, ...rest } = props;
|
|
1132
|
+
const { hideLayout = false } = useLayoutContext();
|
|
1133
|
+
return !hideLayout && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classVarianceAuthority.cx(className, "flex grow h-full"), ref, ...rest, children });
|
|
1134
|
+
})
|
|
1135
|
+
);
|
|
1136
|
+
const Root$1 = React.memo((props) => {
|
|
1137
|
+
const { children, small = false, hideLayout = false } = props;
|
|
1138
|
+
const [showLeftSlideOut, setShowLeftSlideOut] = React.useState(false);
|
|
1139
|
+
const [showRightSlideOut, setShowRightSlideOut] = React.useState(false);
|
|
1140
|
+
const contextValue = React.useMemo(
|
|
1141
|
+
() => ({
|
|
1142
|
+
small,
|
|
1143
|
+
hideLayout,
|
|
1144
|
+
showLeftSlideOut,
|
|
1145
|
+
setShowLeftSlideOut,
|
|
1146
|
+
showRightSlideOut,
|
|
1147
|
+
setShowRightSlideOut
|
|
1148
|
+
}),
|
|
1149
|
+
[hideLayout, showLeftSlideOut, showRightSlideOut, small]
|
|
1150
|
+
);
|
|
1151
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LayoutContext.Provider, { value: contextValue, children });
|
|
1152
|
+
});
|
|
1153
|
+
Root$1.displayName = "Layout.Root";
|
|
1154
|
+
function usePointerDownOutside(onPointerDownOutside, ownerElement = globalThis == null ? void 0 : globalThis.document.body) {
|
|
1155
|
+
const handlePointerDownOutside = useCallbackRef(onPointerDownOutside);
|
|
1156
|
+
const isPointerInsideReactTreeRef = React.useRef(false);
|
|
1157
|
+
const handleClickRef = React.useRef(() => {
|
|
1158
|
+
});
|
|
1159
|
+
React.useEffect(() => {
|
|
1160
|
+
const handlePointerDown = (event) => {
|
|
1161
|
+
if (event.target && !isPointerInsideReactTreeRef.current) {
|
|
1162
|
+
const eventDetail = { originalEvent: event };
|
|
1163
|
+
const handleAndDispatchPointerDownOutsideEvent = () => {
|
|
1164
|
+
handleAndDispatchCustomEvent("pointerDownOutside", handlePointerDownOutside, eventDetail, {
|
|
1165
|
+
discrete: true
|
|
1166
|
+
});
|
|
1167
|
+
};
|
|
1168
|
+
if (event.pointerType === "touch") {
|
|
1169
|
+
ownerElement.removeEventListener("click", handleClickRef.current);
|
|
1170
|
+
handleClickRef.current = handleAndDispatchPointerDownOutsideEvent;
|
|
1171
|
+
ownerElement.addEventListener("click", handleClickRef.current, { once: true });
|
|
1172
|
+
} else {
|
|
1173
|
+
handleAndDispatchPointerDownOutsideEvent();
|
|
1174
|
+
}
|
|
1175
|
+
} else {
|
|
1176
|
+
ownerElement.removeEventListener("click", handleClickRef.current);
|
|
1177
|
+
}
|
|
1178
|
+
isPointerInsideReactTreeRef.current = false;
|
|
1179
|
+
};
|
|
1180
|
+
const timerId = window.setTimeout(() => {
|
|
1181
|
+
ownerElement.addEventListener("pointerdown", handlePointerDown);
|
|
1182
|
+
}, 0);
|
|
1183
|
+
return () => {
|
|
1184
|
+
window.clearTimeout(timerId);
|
|
1185
|
+
ownerElement.removeEventListener("pointerdown", handlePointerDown);
|
|
1186
|
+
ownerElement.removeEventListener("click", handleClickRef.current);
|
|
1187
|
+
};
|
|
1188
|
+
}, [ownerElement, handlePointerDownOutside]);
|
|
1189
|
+
return {
|
|
1190
|
+
// ensures we check React component tree (not just DOM tree)
|
|
1191
|
+
onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
1195
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
1196
|
+
}
|
|
1197
|
+
function handleAndDispatchCustomEvent(name, handler, detail, { discrete }) {
|
|
1198
|
+
const target = detail.originalEvent.target;
|
|
1199
|
+
const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail });
|
|
1200
|
+
if (handler) target.addEventListener(name, handler, { once: true });
|
|
1201
|
+
if (discrete) {
|
|
1202
|
+
dispatchDiscreteCustomEvent(target, event);
|
|
1203
|
+
} else {
|
|
1204
|
+
target.dispatchEvent(event);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
function useCallbackRef(callback) {
|
|
1208
|
+
const callbackRef = React.useRef(callback);
|
|
1209
|
+
React.useEffect(() => {
|
|
1210
|
+
callbackRef.current = callback;
|
|
1211
|
+
});
|
|
1212
|
+
return React.useMemo(() => (...args) => {
|
|
1213
|
+
var _a;
|
|
1214
|
+
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
1215
|
+
}, []);
|
|
1216
|
+
}
|
|
1217
|
+
const TIMEOUT_DURATION$1 = 3e3;
|
|
1218
|
+
const SlideOutV3 = React.memo(
|
|
1219
|
+
React.forwardRef((props, ref) => {
|
|
1220
|
+
const {
|
|
1221
|
+
className,
|
|
1222
|
+
style,
|
|
1223
|
+
children,
|
|
1224
|
+
open,
|
|
1225
|
+
hide = false,
|
|
1226
|
+
modal = false,
|
|
1227
|
+
overlayComponent,
|
|
1228
|
+
resizeable = true,
|
|
1229
|
+
side,
|
|
1230
|
+
position = "relative",
|
|
1231
|
+
initialWidth,
|
|
1232
|
+
minWidth,
|
|
1233
|
+
maxWidth,
|
|
1234
|
+
onDismiss,
|
|
1235
|
+
onOpening,
|
|
1236
|
+
onClosed,
|
|
1237
|
+
content
|
|
1238
|
+
} = props;
|
|
1239
|
+
const isLeft = side === "left";
|
|
1240
|
+
const [parentContainer, setParentContainer] = React.useState(document.body);
|
|
1241
|
+
const childrenContainerRef = React.useRef(null);
|
|
1242
|
+
const [slideOutWidth, setSlideOutWidth] = React.useState(initialWidth);
|
|
1243
|
+
const handleResize = React.useCallback(
|
|
1244
|
+
(_event, _dir, ref2, _delta) => {
|
|
1245
|
+
setSlideOutWidth(ref2.clientWidth);
|
|
1246
|
+
},
|
|
1247
|
+
[]
|
|
1248
|
+
);
|
|
1249
|
+
const handleDismiss = React.useCallback(() => {
|
|
1250
|
+
if (modal && onDismiss) {
|
|
1251
|
+
onDismiss();
|
|
1252
|
+
}
|
|
1253
|
+
}, [modal, onDismiss]);
|
|
1254
|
+
const handleAssignParentContainer = React.useCallback((element) => {
|
|
1255
|
+
if (element) {
|
|
1256
|
+
setParentContainer(element);
|
|
1257
|
+
}
|
|
1258
|
+
}, []);
|
|
1259
|
+
React.useEffect(() => {
|
|
1260
|
+
setSlideOutWidth(initialWidth);
|
|
1261
|
+
}, [initialWidth]);
|
|
1262
|
+
React.useEffect(() => {
|
|
1263
|
+
if (!childrenContainerRef.current) return;
|
|
1264
|
+
const originalParentPointerEvents = childrenContainerRef.current.style.pointerEvents;
|
|
1265
|
+
if (open && modal) {
|
|
1266
|
+
childrenContainerRef.current.style.pointerEvents = "none";
|
|
1267
|
+
}
|
|
1268
|
+
return () => {
|
|
1269
|
+
if (childrenContainerRef.current) {
|
|
1270
|
+
childrenContainerRef.current.style.pointerEvents = originalParentPointerEvents;
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
}, [modal, open, parentContainer.style]);
|
|
1274
|
+
const { onPointerDownCapture: handlePointerDownCapture } = usePointerDownOutside(handleDismiss, parentContainer);
|
|
1275
|
+
const CSSTransitionClassNames = React.useMemo(
|
|
1276
|
+
() => ({
|
|
1277
|
+
enter: isLeft ? "-ml-(--slide-out-width)" : "-mr-(--slide-out-width)",
|
|
1278
|
+
enterActive: isLeft ? "ease-linear duration-200 transition-[margin-left] ml-0" : "ease-linear duration-200 transition-[margin-right] mr-0",
|
|
1279
|
+
enterDone: isLeft ? "ml-0" : "mr-0",
|
|
1280
|
+
exitActive: isLeft ? "ease-linear duration-200 transition-[margin-left] -ml-(--slide-out-width)" : "ease-linear duration-200 transition-[margin-right] -mr-(--slide-out-width)",
|
|
1281
|
+
exitDone: isLeft ? "-ml-(--slide-out-width)" : "-mr-(--slide-out-width)"
|
|
1282
|
+
}),
|
|
1283
|
+
[isLeft]
|
|
1284
|
+
);
|
|
1285
|
+
const resizableSize = React.useMemo(
|
|
1286
|
+
() => (
|
|
1287
|
+
// prettier-ignore
|
|
1288
|
+
{ width: slideOutWidth, height: "100%" }
|
|
1289
|
+
),
|
|
1290
|
+
[slideOutWidth]
|
|
1291
|
+
);
|
|
1292
|
+
const resizableStyle = React.useMemo(
|
|
1293
|
+
() => ({
|
|
1294
|
+
position,
|
|
1295
|
+
"--slide-out-width": `${slideOutWidth}${typeof slideOutWidth === "number" ? "px" : ""}`
|
|
1296
|
+
}),
|
|
1297
|
+
[position, slideOutWidth]
|
|
1298
|
+
);
|
|
1299
|
+
const resizableEnable = React.useMemo(
|
|
1300
|
+
() => ({ left: resizeable && !isLeft, right: resizeable && isLeft }),
|
|
1301
|
+
[isLeft, resizeable]
|
|
1302
|
+
);
|
|
1303
|
+
const SlideOut2 = React.useMemo(
|
|
1304
|
+
() => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1305
|
+
reactTransitionGroup.CSSTransition,
|
|
1306
|
+
{
|
|
1307
|
+
classNames: CSSTransitionClassNames,
|
|
1308
|
+
in: open,
|
|
1309
|
+
timeout: TIMEOUT_DURATION$1,
|
|
1310
|
+
unmountOnExit: true,
|
|
1311
|
+
mountOnEnter: true,
|
|
1312
|
+
onEntering: onOpening,
|
|
1313
|
+
onExited: onClosed,
|
|
1314
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1315
|
+
reactSlot.Slot,
|
|
1316
|
+
{
|
|
1317
|
+
className: classVarianceAuthority.cx(className, "top-0", "bottom-0", {
|
|
1318
|
+
"left-0": isLeft,
|
|
1319
|
+
"right-0": !isLeft,
|
|
1320
|
+
absolute: position === "absolute",
|
|
1321
|
+
relative: position === "relative"
|
|
1322
|
+
}),
|
|
1323
|
+
style,
|
|
1324
|
+
onPointerDownCapture: handlePointerDownCapture,
|
|
1325
|
+
ref,
|
|
1326
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1327
|
+
reResizable.Resizable,
|
|
1328
|
+
{
|
|
1329
|
+
as: "div",
|
|
1330
|
+
onResize: handleResize,
|
|
1331
|
+
size: resizableSize,
|
|
1332
|
+
style: resizableStyle,
|
|
1333
|
+
minWidth,
|
|
1334
|
+
maxWidth,
|
|
1335
|
+
enable: resizableEnable,
|
|
1336
|
+
children: content
|
|
1337
|
+
}
|
|
1338
|
+
)
|
|
1339
|
+
}
|
|
1340
|
+
)
|
|
1341
|
+
}
|
|
1342
|
+
),
|
|
1343
|
+
[
|
|
1344
|
+
CSSTransitionClassNames,
|
|
1345
|
+
open,
|
|
1346
|
+
onOpening,
|
|
1347
|
+
onClosed,
|
|
1348
|
+
className,
|
|
1349
|
+
isLeft,
|
|
1350
|
+
position,
|
|
1351
|
+
style,
|
|
1352
|
+
handlePointerDownCapture,
|
|
1353
|
+
ref,
|
|
1354
|
+
handleResize,
|
|
1355
|
+
resizableSize,
|
|
1356
|
+
resizableStyle,
|
|
1357
|
+
minWidth,
|
|
1358
|
+
maxWidth,
|
|
1359
|
+
resizableEnable,
|
|
1360
|
+
content
|
|
1361
|
+
]
|
|
1362
|
+
);
|
|
1363
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1364
|
+
"div",
|
|
1365
|
+
{
|
|
1366
|
+
className: "w-full h-full flex relative overflow-hidden max-w-full max-h-full",
|
|
1367
|
+
ref: handleAssignParentContainer,
|
|
1368
|
+
children: [
|
|
1369
|
+
side === "left" && !hide && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1370
|
+
open && overlayComponent,
|
|
1371
|
+
" ",
|
|
1372
|
+
content && SlideOut2
|
|
1373
|
+
] }),
|
|
1374
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full grow flex max-w-full max-w-full overflow-hidden", ref: childrenContainerRef, children }),
|
|
1375
|
+
side === "right" && !hide && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1376
|
+
open && overlayComponent,
|
|
1377
|
+
" ",
|
|
1378
|
+
content && SlideOut2
|
|
1379
|
+
] })
|
|
1380
|
+
]
|
|
1381
|
+
}
|
|
1382
|
+
);
|
|
1383
|
+
})
|
|
1384
|
+
);
|
|
1385
|
+
const DEFAULT_INITIAL_WIDTH = "30%";
|
|
1386
|
+
const SlideOut = React.memo(
|
|
1387
|
+
React.forwardRef((props, ref) => {
|
|
1388
|
+
const { small, hideLayout } = useLayoutContext();
|
|
1389
|
+
const { className, showSlideOut, setShowSlideOut, defaultOpen, side, ...rest } = props;
|
|
1390
|
+
React.useEffect(() => {
|
|
1391
|
+
if (small && (defaultOpen == null ? void 0 : defaultOpen.small) !== void 0) {
|
|
1392
|
+
setShowSlideOut(defaultOpen == null ? void 0 : defaultOpen.small);
|
|
1393
|
+
} else if (!small && (defaultOpen == null ? void 0 : defaultOpen.large) !== void 0) {
|
|
1394
|
+
setShowSlideOut(defaultOpen == null ? void 0 : defaultOpen.large);
|
|
1395
|
+
}
|
|
1396
|
+
}, [defaultOpen, setShowSlideOut, small]);
|
|
1397
|
+
const handleDismiss = React.useCallback(() => {
|
|
1398
|
+
setShowSlideOut(false);
|
|
1399
|
+
}, [setShowSlideOut]);
|
|
1400
|
+
const mergedProps = React.useMemo(
|
|
1401
|
+
() => ({
|
|
1402
|
+
// controlled props
|
|
1403
|
+
...{
|
|
1404
|
+
open: showSlideOut,
|
|
1405
|
+
initialWidth: DEFAULT_INITIAL_WIDTH,
|
|
1406
|
+
modal: small,
|
|
1407
|
+
onDismiss: handleDismiss,
|
|
1408
|
+
position: small ? "absolute" : "relative"
|
|
1409
|
+
},
|
|
1410
|
+
// uncontrolled props
|
|
1411
|
+
...rest
|
|
1412
|
+
}),
|
|
1413
|
+
[handleDismiss, rest, showSlideOut, small]
|
|
1414
|
+
);
|
|
1415
|
+
return !hideLayout && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1416
|
+
SlideOutV3,
|
|
1417
|
+
{
|
|
1418
|
+
className: classVarianceAuthority.cx(`overmap-layout-slideOut-${side}`, className),
|
|
1419
|
+
side,
|
|
1420
|
+
ref,
|
|
1421
|
+
...mergedProps
|
|
1422
|
+
}
|
|
1423
|
+
);
|
|
1424
|
+
})
|
|
1425
|
+
);
|
|
1426
|
+
const LeftSlideOut = React.memo(
|
|
1427
|
+
React.forwardRef((props, ref) => {
|
|
1428
|
+
const { showLeftSlideOut, setShowLeftSlideOut } = useLayoutContext();
|
|
1429
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1430
|
+
SlideOut,
|
|
1431
|
+
{
|
|
1432
|
+
side: "left",
|
|
1433
|
+
showSlideOut: showLeftSlideOut,
|
|
1434
|
+
setShowSlideOut: setShowLeftSlideOut,
|
|
1435
|
+
ref,
|
|
1436
|
+
...props
|
|
1437
|
+
}
|
|
1438
|
+
);
|
|
1439
|
+
})
|
|
1440
|
+
);
|
|
1441
|
+
const RightSlideOut = React.memo(
|
|
1442
|
+
React.forwardRef((props, ref) => {
|
|
1443
|
+
const { showRightSlideOut, setShowRightSlideOut } = useLayoutContext();
|
|
1444
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1445
|
+
SlideOut,
|
|
1446
|
+
{
|
|
1447
|
+
side: "right",
|
|
1448
|
+
showSlideOut: showRightSlideOut,
|
|
1449
|
+
setShowSlideOut: setShowRightSlideOut,
|
|
1450
|
+
ref,
|
|
1451
|
+
...props
|
|
1452
|
+
}
|
|
1453
|
+
);
|
|
1454
|
+
})
|
|
1455
|
+
);
|
|
1456
|
+
const SlideOutOverlay = React.memo(
|
|
1457
|
+
React.forwardRef((props, ref) => {
|
|
1458
|
+
const { className, active, side, smallModeOnly = false, ...rest } = props;
|
|
1459
|
+
const { small, hideLayout, showLeftSlideOut, showRightSlideOut } = useLayoutContext();
|
|
1460
|
+
const showOverlay = React.useMemo(() => {
|
|
1461
|
+
if (active !== void 0) return active;
|
|
1462
|
+
if (hideLayout) return false;
|
|
1463
|
+
if (smallModeOnly && !small) return false;
|
|
1464
|
+
return side === "left" ? showLeftSlideOut : showRightSlideOut;
|
|
1465
|
+
}, [active, hideLayout, showLeftSlideOut, showRightSlideOut, side, small, smallModeOnly]);
|
|
1466
|
+
return showOverlay && /* @__PURE__ */ jsxRuntime.jsx("div", { className: classVarianceAuthority.cx("overmap-layout-overlay", className, "inset-0 fixed"), ref, ...rest });
|
|
1467
|
+
})
|
|
1468
|
+
);
|
|
1469
|
+
function nextStateBasedOnType(prevState, type) {
|
|
1470
|
+
switch (type) {
|
|
1471
|
+
case "toggle":
|
|
1472
|
+
return !prevState;
|
|
1473
|
+
case "open":
|
|
1474
|
+
return true;
|
|
1475
|
+
case "close":
|
|
1476
|
+
return false;
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
const SlideOutTrigger = React.memo(
|
|
1480
|
+
React.forwardRef((props, ref) => {
|
|
1481
|
+
const { side, type = "toggle", children } = props;
|
|
1482
|
+
const { setShowLeftSlideOut, setShowRightSlideOut } = useLayoutContext();
|
|
1483
|
+
const handleClick = React.useCallback(() => {
|
|
1484
|
+
const setShowSlideOut = side === "left" ? setShowLeftSlideOut : setShowRightSlideOut;
|
|
1485
|
+
setShowSlideOut((prevState) => nextStateBasedOnType(prevState, type));
|
|
1486
|
+
}, [setShowLeftSlideOut, setShowRightSlideOut, side, type]);
|
|
1487
|
+
return /* @__PURE__ */ jsxRuntime.jsx(reactSlot.Slot, { ref, onClick: handleClick, children });
|
|
1488
|
+
})
|
|
1489
|
+
);
|
|
1490
|
+
const Layout = {
|
|
1491
|
+
Root: Root$1,
|
|
1492
|
+
Container,
|
|
1493
|
+
SlideOutOverlay,
|
|
1494
|
+
LeftSlideOut,
|
|
1495
|
+
RightSlideOut,
|
|
1496
|
+
SlideOutTrigger
|
|
1497
|
+
};
|
|
1498
|
+
const DEFAULT_ICON_SIZE = "15px";
|
|
1499
|
+
const RiIcon = React.memo((props) => {
|
|
1500
|
+
const { icon, size = DEFAULT_ICON_SIZE, color, ...rest } = props;
|
|
1501
|
+
const Icon = RiIcons__namespace[icon];
|
|
1502
|
+
if (!Icon) console.error(`Icon ${icon} not found`);
|
|
1503
|
+
return Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size, color, ...rest }) : /* @__PURE__ */ jsxRuntime.jsx(RiIcons.RiQuestionMark, {});
|
|
1504
|
+
});
|
|
1505
|
+
RiIcon.displayName = "IconComponent";
|
|
1506
|
+
const centerStyles = { placeSelf: "center" };
|
|
1507
|
+
const ErrorFallback = React.memo((props) => {
|
|
1508
|
+
const { absoluteCentering, message = "Something went wrong", onRetry } = props;
|
|
1509
|
+
const { resetBoundary } = reactErrorBoundary.useErrorBoundary();
|
|
1510
|
+
const height = "20px";
|
|
1511
|
+
const outerFlexStyles = absoluteCentering ? { position: "absolute", top: "50%", transform: "translateY(-50%)" } : void 0;
|
|
1512
|
+
const handleRetry = React.useCallback(() => {
|
|
1513
|
+
resetBoundary();
|
|
1514
|
+
onRetry();
|
|
1515
|
+
}, [onRetry, resetBoundary]);
|
|
1516
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 w-full", style: outerFlexStyles, children: [
|
|
1517
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flexGrow: 1 } }),
|
|
1518
|
+
/* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiAlertLine", size: height, style: centerStyles }),
|
|
1519
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { lineHeight: height, ...centerStyles }, children: message }),
|
|
1520
|
+
/* @__PURE__ */ jsxRuntime.jsx(IconButton, { "aria-label": "Try again", variant: "soft", onClick: handleRetry, style: centerStyles, children: /* @__PURE__ */ jsxRuntime.jsx(RiIcon, { icon: "RiLoopLeftLine", size: height }) }),
|
|
1521
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flexGrow: 1 } })
|
|
1522
|
+
] });
|
|
1523
|
+
});
|
|
1524
|
+
ErrorFallback.displayName = "ErrorFallback";
|
|
1525
|
+
const OvermapErrorBoundary = React.memo((props) => {
|
|
1526
|
+
const { absoluteCentering, message } = props;
|
|
1527
|
+
const [attempt, setAttempt] = React.useState(0);
|
|
1528
|
+
const logError = React.useCallback((error, info) => {
|
|
1529
|
+
console.error(error, info);
|
|
1530
|
+
setAttempt((prev) => prev + 1);
|
|
1531
|
+
}, []);
|
|
1532
|
+
const handleRetry = React.useCallback(() => {
|
|
1533
|
+
setAttempt((prev) => prev + 1);
|
|
1534
|
+
}, []);
|
|
1535
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1536
|
+
reactErrorBoundary.ErrorBoundary,
|
|
1537
|
+
{
|
|
1538
|
+
fallback: /* @__PURE__ */ jsxRuntime.jsx(ErrorFallback, { absoluteCentering, message, onRetry: handleRetry }),
|
|
1539
|
+
onError: logError,
|
|
1540
|
+
children: props.children
|
|
1541
|
+
},
|
|
1542
|
+
attempt
|
|
1543
|
+
);
|
|
1544
|
+
});
|
|
1545
|
+
OvermapErrorBoundary.displayName = "OvermapErrorBoundary";
|
|
1546
|
+
const MenuContext = React.createContext({});
|
|
1547
|
+
const useMenuContext = () => React.useContext(MenuContext);
|
|
1548
|
+
const MENU_OVERFLOW_PADDING = 20;
|
|
1549
|
+
const MENU_CONTENT_PADDING = 8;
|
|
1550
|
+
const MENU_MINIMUM_MAX_HEIGHT = 250;
|
|
1551
|
+
const DEFAULT_OFFSET = 5;
|
|
1552
|
+
const Root = React.memo((props) => {
|
|
1553
|
+
const {
|
|
1554
|
+
children,
|
|
1555
|
+
side = "bottom",
|
|
1556
|
+
align = "center",
|
|
1557
|
+
offset,
|
|
1558
|
+
loop = false,
|
|
1559
|
+
modal = false,
|
|
1560
|
+
// open state related props
|
|
1561
|
+
open: controlledOpen,
|
|
1562
|
+
onOpenChange,
|
|
1563
|
+
defaultOpen
|
|
1564
|
+
} = props;
|
|
1565
|
+
const [open, setOpen] = useControlledState({
|
|
1566
|
+
state: controlledOpen,
|
|
1567
|
+
initialState: defaultOpen ?? false,
|
|
1568
|
+
setState: onOpenChange
|
|
1569
|
+
});
|
|
1570
|
+
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
1571
|
+
const [triggerType, setTriggerType] = React.useState(null);
|
|
1572
|
+
const elementsRef = React.useRef([]);
|
|
1573
|
+
const nodeId = react.useFloatingNodeId();
|
|
1574
|
+
const { refs, floatingStyles, context, middlewareData } = react.useFloating({
|
|
1575
|
+
nodeId,
|
|
1576
|
+
strategy: "fixed",
|
|
1577
|
+
placement: side + (align !== "center" ? "-" + align : ""),
|
|
1578
|
+
whileElementsMounted: react.autoUpdate,
|
|
1579
|
+
open,
|
|
1580
|
+
onOpenChange: setOpen,
|
|
1581
|
+
middleware: [
|
|
1582
|
+
react.offset({ mainAxis: offset ?? DEFAULT_OFFSET }),
|
|
1583
|
+
react.size({
|
|
1584
|
+
apply({ availableHeight, elements }) {
|
|
1585
|
+
elements.floating.style.setProperty(
|
|
1586
|
+
"--overmap-menu-available-height",
|
|
1587
|
+
`${Math.max(availableHeight, MENU_MINIMUM_MAX_HEIGHT)}px`
|
|
1588
|
+
);
|
|
1589
|
+
},
|
|
1590
|
+
padding: MENU_OVERFLOW_PADDING
|
|
1591
|
+
}),
|
|
1592
|
+
react.flip({ fallbackStrategy: "initialPlacement" }),
|
|
1593
|
+
react.shift({ padding: MENU_OVERFLOW_PADDING }),
|
|
1594
|
+
react.hide()
|
|
1595
|
+
]
|
|
1596
|
+
});
|
|
1597
|
+
const role = react.useRole(context, {
|
|
1598
|
+
role: "menu"
|
|
1599
|
+
});
|
|
1600
|
+
const dismiss = react.useDismiss(context, {
|
|
1601
|
+
ancestorScroll: triggerType === "context" || triggerType === "virtual"
|
|
1602
|
+
});
|
|
1603
|
+
const click = react.useClick(context, {
|
|
1604
|
+
enabled: triggerType === "click"
|
|
1605
|
+
});
|
|
1606
|
+
const listNavigation = react.useListNavigation(context, {
|
|
1607
|
+
listRef: elementsRef,
|
|
1608
|
+
activeIndex,
|
|
1609
|
+
onNavigate: setActiveIndex,
|
|
1610
|
+
loop
|
|
1611
|
+
});
|
|
1612
|
+
const { getFloatingProps, getItemProps, getReferenceProps } = react.useInteractions([
|
|
1613
|
+
dismiss,
|
|
1614
|
+
listNavigation,
|
|
1615
|
+
click,
|
|
1616
|
+
role
|
|
1617
|
+
]);
|
|
1618
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.FloatingTree, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1619
|
+
MenuContext.Provider,
|
|
1620
|
+
{
|
|
1621
|
+
value: {
|
|
1622
|
+
open,
|
|
1623
|
+
setOpen,
|
|
1624
|
+
refs,
|
|
1625
|
+
context,
|
|
1626
|
+
floatingStyles,
|
|
1627
|
+
elementsRef,
|
|
1628
|
+
getFloatingProps,
|
|
1629
|
+
getItemProps,
|
|
1630
|
+
getReferenceProps,
|
|
1631
|
+
nodeId,
|
|
1632
|
+
activeIndex,
|
|
1633
|
+
setActiveIndex,
|
|
1634
|
+
middlewareData,
|
|
1635
|
+
side,
|
|
1636
|
+
modal,
|
|
1637
|
+
setTriggerType
|
|
1638
|
+
},
|
|
1639
|
+
children
|
|
1640
|
+
}
|
|
1641
|
+
) });
|
|
1642
|
+
});
|
|
1643
|
+
Root.displayName = "Root";
|
|
1644
|
+
const ClickTrigger = React.memo(
|
|
1645
|
+
React.forwardRef((props, forwardedRef) => {
|
|
1646
|
+
const { children, disabled = false } = props;
|
|
1647
|
+
const { getReferenceProps, refs, setTriggerType } = useMenuContext();
|
|
1648
|
+
const mergedRefs = react.useMergeRefs([refs.setReference, forwardedRef]);
|
|
1649
|
+
React.useEffect(() => {
|
|
1650
|
+
setTriggerType("click");
|
|
1651
|
+
}, [setTriggerType]);
|
|
1652
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1653
|
+
reactSlot.Slot,
|
|
1654
|
+
{
|
|
1655
|
+
ref: mergedRefs,
|
|
1656
|
+
"aria-disabled": disabled,
|
|
1657
|
+
"data-disabled": disabled ? "" : void 0,
|
|
1658
|
+
...getReferenceProps({ disabled }),
|
|
1659
|
+
children
|
|
1660
|
+
}
|
|
1661
|
+
);
|
|
1662
|
+
})
|
|
1663
|
+
);
|
|
1664
|
+
const menuItem = classVarianceAuthority.cva(
|
|
1665
|
+
["select-none", "relative", "flex", "items-center", "rounded", "outline-none", "data-disabled:text-(--base-a8)"],
|
|
1666
|
+
{
|
|
1667
|
+
variants: {
|
|
1668
|
+
size: {
|
|
1669
|
+
xs: ["h-5", "text-xs", "gap-1", "px-1"],
|
|
1670
|
+
sm: ["h-6", "text-sm", "gap-1.5", "px-1.5"],
|
|
1671
|
+
md: ["h-7", "text-base", "gap-2", "px-2"],
|
|
1672
|
+
lg: ["h-8", "text-lg", "gap-2.5", "px-2.5"],
|
|
1673
|
+
xl: ["h-9", "text-xl", "gap-3", "px-3"]
|
|
1674
|
+
},
|
|
1675
|
+
variant: {
|
|
1676
|
+
solid: [
|
|
1677
|
+
"text-(--base-12)",
|
|
1678
|
+
"data-highlighted:not-data-disabled:text-(--accent-contrast)",
|
|
1679
|
+
"data-highlighted:not-data-disabled:bg-(--accent-a9)"
|
|
1680
|
+
],
|
|
1681
|
+
soft: ["text-(--base-12)", "data-highlighted:not-data-disabled:bg-(--accent-a4)"]
|
|
1682
|
+
}
|
|
1683
|
+
},
|
|
1684
|
+
defaultVariants: {
|
|
1685
|
+
size: "md",
|
|
1686
|
+
variant: "solid"
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
);
|
|
1690
|
+
const menuSeparator = classVarianceAuthority.cva(["h-px", "bg-(--base-a6)", "w-auto"], {
|
|
1691
|
+
variants: {
|
|
1692
|
+
size: {
|
|
1693
|
+
xs: ["-mx-1", "my-1"],
|
|
1694
|
+
sm: ["-mx-1.5", "my-1.5"],
|
|
1695
|
+
md: ["-mx-2", "my-2"],
|
|
1696
|
+
lg: ["-mx-2.5", "my-2.5"],
|
|
1697
|
+
xl: ["-mx-3", "my-3"]
|
|
1698
|
+
}
|
|
1699
|
+
},
|
|
1700
|
+
defaultVariants: {
|
|
1701
|
+
size: "md"
|
|
1702
|
+
}
|
|
1703
|
+
});
|
|
1704
|
+
const menuSelectedIndicator = classVarianceAuthority.cva(["flex", "items-center", "justify-center"], {
|
|
1705
|
+
variants: {
|
|
1706
|
+
size: {
|
|
1707
|
+
xs: ["w-4", "h-4"],
|
|
1708
|
+
sm: ["w-5", "h-5"],
|
|
1709
|
+
md: ["w-6", "h-6"],
|
|
1710
|
+
lg: ["w-7", "h-7"],
|
|
1711
|
+
xl: ["w-8", "h-8"]
|
|
1712
|
+
}
|
|
1713
|
+
},
|
|
1714
|
+
defaultVariants: {
|
|
1715
|
+
size: "md"
|
|
1716
|
+
}
|
|
1717
|
+
});
|
|
1718
|
+
const menuContent = classVarianceAuthority.cva(
|
|
1719
|
+
[
|
|
1720
|
+
"w-max",
|
|
1721
|
+
"outline-none",
|
|
1722
|
+
"pointer-events-auto",
|
|
1723
|
+
"bg-(--base-1)",
|
|
1724
|
+
"ring-1",
|
|
1725
|
+
"ring-(--base-6)",
|
|
1726
|
+
"rounded",
|
|
1727
|
+
"overflow-y-auto",
|
|
1728
|
+
"[scrollbar-width:thin]",
|
|
1729
|
+
"[scrollbar-color:var(--base-6)_transparent]"
|
|
1730
|
+
],
|
|
1731
|
+
{
|
|
1732
|
+
variants: {
|
|
1733
|
+
size: {
|
|
1734
|
+
xs: ["p-1"],
|
|
1735
|
+
sm: ["p-1.5"],
|
|
1736
|
+
md: ["p-2"],
|
|
1737
|
+
lg: ["p-2.5"],
|
|
1738
|
+
xl: ["p-3"]
|
|
1739
|
+
},
|
|
1740
|
+
radius: {
|
|
1741
|
+
none: ["rounded-none"],
|
|
1742
|
+
xs: ["rounded-xs"],
|
|
1743
|
+
sm: ["rounded-sm"],
|
|
1744
|
+
md: ["rounded-md"],
|
|
1745
|
+
lg: ["rounded-lg"],
|
|
1746
|
+
xl: ["rounded-lg"],
|
|
1747
|
+
full: ["rounded-lg"]
|
|
1748
|
+
}
|
|
1749
|
+
},
|
|
1750
|
+
defaultVariants: {
|
|
1751
|
+
size: "md"
|
|
1752
|
+
}
|
|
1753
|
+
}
|
|
1754
|
+
);
|
|
1755
|
+
const menuOverlay = classVarianceAuthority.cva(["overflow-hidden"], {
|
|
1756
|
+
variants: {
|
|
1757
|
+
modal: {
|
|
1758
|
+
true: ["pointer-events-auto"],
|
|
1759
|
+
false: ["pointer-events-none"]
|
|
1760
|
+
}
|
|
1761
|
+
},
|
|
1762
|
+
defaultVariants: {
|
|
1763
|
+
modal: false
|
|
1764
|
+
}
|
|
1765
|
+
});
|
|
1766
|
+
const inputRoot = classVarianceAuthority.cva(
|
|
1767
|
+
[
|
|
1768
|
+
"flex",
|
|
1769
|
+
"items-stretch",
|
|
1770
|
+
"transition-colors",
|
|
1771
|
+
"has-[:disabled]:opacity-50",
|
|
1772
|
+
"has-[:disabled]:pointer-events-none",
|
|
1773
|
+
"box-border",
|
|
1774
|
+
"bg-transparent",
|
|
1775
|
+
"text-(--base-12)"
|
|
1776
|
+
],
|
|
1777
|
+
{
|
|
1778
|
+
variants: {
|
|
1779
|
+
size: {
|
|
1780
|
+
xs: ["h-5", "text-xs", "px-1", "gap-1"],
|
|
1781
|
+
sm: ["h-6", "text-sm", "px-1.5", "gap-1.5"],
|
|
1782
|
+
md: ["h-7", "text-base", "px-2", "gap-2"],
|
|
1783
|
+
lg: ["h-8", "text-lg", "px-2.5", "gap-2.5"],
|
|
1784
|
+
xl: ["h-9", "text-xl", "px-3", "gap-3"]
|
|
1785
|
+
}
|
|
1786
|
+
},
|
|
1787
|
+
defaultVariants: {
|
|
1788
|
+
size: "md"
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
);
|
|
1792
|
+
const MenuContentContext = React.createContext({});
|
|
1793
|
+
const useMenuContentContext = () => React.useContext(MenuContentContext);
|
|
1794
|
+
const Content = React.memo(
|
|
1795
|
+
React.forwardRef((props, forwardedRef) => {
|
|
1796
|
+
var _a;
|
|
1797
|
+
const providerContext = useProvider();
|
|
1798
|
+
const {
|
|
1799
|
+
children,
|
|
1800
|
+
size = "md",
|
|
1801
|
+
variant = "solid",
|
|
1802
|
+
radius = providerContext.radius,
|
|
1803
|
+
accentColor = providerContext.accentColor,
|
|
1804
|
+
...rest
|
|
1805
|
+
} = props;
|
|
1806
|
+
const {
|
|
1807
|
+
refs,
|
|
1808
|
+
getFloatingProps,
|
|
1809
|
+
middlewareData,
|
|
1810
|
+
elementsRef,
|
|
1811
|
+
activeIndex,
|
|
1812
|
+
setActiveIndex,
|
|
1813
|
+
getItemProps,
|
|
1814
|
+
open,
|
|
1815
|
+
setOpen,
|
|
1816
|
+
nodeId,
|
|
1817
|
+
context,
|
|
1818
|
+
floatingStyles,
|
|
1819
|
+
modal,
|
|
1820
|
+
side
|
|
1821
|
+
} = useMenuContext();
|
|
1822
|
+
const computedFloatingStyles = React.useMemo(() => {
|
|
1823
|
+
var _a2;
|
|
1824
|
+
return {
|
|
1825
|
+
...floatingStyles,
|
|
1826
|
+
visibility: ((_a2 = middlewareData.hide) == null ? void 0 : _a2.referenceHidden) ? "hidden" : "visible"
|
|
1827
|
+
};
|
|
1828
|
+
}, [floatingStyles, (_a = middlewareData.hide) == null ? void 0 : _a.referenceHidden]);
|
|
1829
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.FloatingNode, { id: nodeId, children: open && /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.FloatingOverlay, { className: classVarianceAuthority.cx("overmap-menu-overlay", menuOverlay({ modal })), lockScroll: true, children: /* @__PURE__ */ jsxRuntime.jsx(react.FloatingFocusManager, { context, children: /* @__PURE__ */ jsxRuntime.jsx(react.FloatingList, { elementsRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1830
|
+
MenuContentContext.Provider,
|
|
1831
|
+
{
|
|
1832
|
+
value: {
|
|
1833
|
+
getItemProps,
|
|
1834
|
+
activeIndex,
|
|
1835
|
+
elementsRef,
|
|
1836
|
+
open,
|
|
1837
|
+
setOpen,
|
|
1838
|
+
refs,
|
|
1839
|
+
setActiveIndex,
|
|
1840
|
+
size,
|
|
1841
|
+
variant,
|
|
1842
|
+
accentColor,
|
|
1843
|
+
radius
|
|
1844
|
+
},
|
|
1845
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1846
|
+
"div",
|
|
1847
|
+
{
|
|
1848
|
+
className: "outline-none w-max border-box",
|
|
1849
|
+
ref: refs.setFloating,
|
|
1850
|
+
tabIndex: -1,
|
|
1851
|
+
style: computedFloatingStyles,
|
|
1852
|
+
...getFloatingProps(),
|
|
1853
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1854
|
+
"div",
|
|
1855
|
+
{
|
|
1856
|
+
className: classVarianceAuthority.cx(
|
|
1857
|
+
"overmap-menu-content",
|
|
1858
|
+
menuContent({ size }),
|
|
1859
|
+
floating({ side, shadow: "3" }),
|
|
1860
|
+
radiusCva({ radius, maxLarge: true }),
|
|
1861
|
+
"max-h-(--overmap-menu-available-height)"
|
|
1862
|
+
),
|
|
1863
|
+
ref: forwardedRef,
|
|
1864
|
+
"data-state": open ? "open" : "closed",
|
|
1865
|
+
"data-side": side,
|
|
1866
|
+
"data-accent-color": accentColor,
|
|
1867
|
+
...rest,
|
|
1868
|
+
children
|
|
1869
|
+
}
|
|
1870
|
+
)
|
|
1871
|
+
}
|
|
1872
|
+
)
|
|
1873
|
+
}
|
|
1874
|
+
) }) }) }) }) });
|
|
1875
|
+
})
|
|
1876
|
+
);
|
|
1877
|
+
const ContextTrigger = React.memo(
|
|
1878
|
+
React.forwardRef((props, forwardedRef) => {
|
|
1879
|
+
const { children, disabled } = props;
|
|
1880
|
+
const ref = React.useRef(null);
|
|
1881
|
+
const { setOpen, refs, setTriggerType } = useMenuContext();
|
|
1882
|
+
const mergedRefs = react.useMergeRefs([forwardedRef, ref]);
|
|
1883
|
+
React.useEffect(() => {
|
|
1884
|
+
setTriggerType("context");
|
|
1885
|
+
}, [setTriggerType]);
|
|
1886
|
+
const handleContextMenu = React.useCallback(
|
|
1887
|
+
(e) => {
|
|
1888
|
+
const { clientY, clientX } = e;
|
|
1889
|
+
if (!disabled && ref.current) {
|
|
1890
|
+
e.preventDefault();
|
|
1891
|
+
refs.setPositionReference({
|
|
1892
|
+
getBoundingClientRect() {
|
|
1893
|
+
return {
|
|
1894
|
+
x: clientX,
|
|
1895
|
+
y: clientY,
|
|
1896
|
+
top: clientY,
|
|
1897
|
+
left: clientX,
|
|
1898
|
+
height: 0,
|
|
1899
|
+
width: 0,
|
|
1900
|
+
bottom: clientY,
|
|
1901
|
+
right: clientX
|
|
1902
|
+
};
|
|
1903
|
+
},
|
|
1904
|
+
contextElement: ref.current
|
|
1905
|
+
});
|
|
1906
|
+
setOpen(true);
|
|
1907
|
+
}
|
|
1908
|
+
},
|
|
1909
|
+
[disabled, refs, setOpen]
|
|
1910
|
+
);
|
|
1911
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1912
|
+
reactSlot.Slot,
|
|
1913
|
+
{
|
|
1914
|
+
ref: mergedRefs,
|
|
1915
|
+
style: { WebkitTouchCallout: disabled ? "none" : "unset" },
|
|
1916
|
+
"aria-disabled": disabled,
|
|
1917
|
+
"data-disabled": disabled ? "" : void 0,
|
|
1918
|
+
onContextMenu: handleContextMenu,
|
|
1919
|
+
children
|
|
1920
|
+
}
|
|
1921
|
+
);
|
|
1922
|
+
})
|
|
1923
|
+
);
|
|
1924
|
+
const Group = React.memo(
|
|
1925
|
+
React.forwardRef((props, ref) => {
|
|
1926
|
+
const { children, ...rest } = props;
|
|
1927
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, role: "group", ...rest, children });
|
|
1928
|
+
})
|
|
1929
|
+
);
|
|
1930
|
+
const MenuInputField = React.memo(
|
|
1931
|
+
React.forwardRef((props, forwardedRef) => {
|
|
1932
|
+
const { className, onValueChange, onChange, ...rest } = props;
|
|
1933
|
+
const { activeIndex, getItemProps } = useMenuContentContext();
|
|
1934
|
+
const { index, ref } = react.useListItem();
|
|
1935
|
+
const mergedRefs = react.useMergeRefs([ref, forwardedRef]);
|
|
1936
|
+
const handleChange = React.useCallback(
|
|
1937
|
+
(e) => {
|
|
1938
|
+
if (onChange) onChange(e);
|
|
1939
|
+
if (onValueChange) onValueChange(e.target.value);
|
|
1940
|
+
},
|
|
1941
|
+
[onChange, onValueChange]
|
|
1942
|
+
);
|
|
1943
|
+
React.useEffect(() => {
|
|
1944
|
+
return () => {
|
|
1945
|
+
if (onValueChange) onValueChange("");
|
|
1946
|
+
};
|
|
1947
|
+
}, []);
|
|
1948
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1949
|
+
"input",
|
|
1950
|
+
{
|
|
1951
|
+
className: classVarianceAuthority.cx(className, "placeholder-(--base-a9)", "selection:bg-(--accent-a5)", "outline-none"),
|
|
1952
|
+
ref: mergedRefs,
|
|
1953
|
+
...getItemProps({
|
|
1954
|
+
...rest,
|
|
1955
|
+
tabIndex: index === activeIndex ? 0 : -1,
|
|
1956
|
+
onChange: handleChange
|
|
1957
|
+
})
|
|
1958
|
+
}
|
|
1959
|
+
);
|
|
1960
|
+
})
|
|
1961
|
+
);
|
|
1962
|
+
const MenuInputRoot = React.memo(
|
|
1963
|
+
React.forwardRef((props, ref) => {
|
|
1964
|
+
const { className, ...rest } = props;
|
|
1965
|
+
const { size } = useMenuContentContext();
|
|
1966
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classVarianceAuthority.cx(className, inputRoot({ size })), ref, ...rest });
|
|
1967
|
+
})
|
|
1968
|
+
);
|
|
1969
|
+
const MenuInputSlot = React.memo(
|
|
1970
|
+
React.forwardRef((props, ref) => {
|
|
1971
|
+
const { className, ...rest } = props;
|
|
1972
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: classVarianceAuthority.cx(className, "flex", "items-center", "text-(--base-a11)"), ref, ...rest });
|
|
1973
|
+
})
|
|
1974
|
+
);
|
|
1975
|
+
const SubContext = React.createContext({});
|
|
1976
|
+
const useSubContext = () => React.useContext(SubContext);
|
|
1977
|
+
const computeOffsets = (side, alignment) => {
|
|
1978
|
+
switch (side) {
|
|
1979
|
+
case "right":
|
|
1980
|
+
if (alignment === "start") {
|
|
1981
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: -8 };
|
|
1982
|
+
} else if (alignment === "end") {
|
|
1983
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: MENU_CONTENT_PADDING };
|
|
1984
|
+
}
|
|
1985
|
+
break;
|
|
1986
|
+
case "left":
|
|
1987
|
+
if (alignment === "start") {
|
|
1988
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: -8 };
|
|
1989
|
+
} else if (alignment === "end") {
|
|
1990
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: MENU_CONTENT_PADDING };
|
|
1991
|
+
}
|
|
1992
|
+
break;
|
|
1993
|
+
}
|
|
1994
|
+
return { mainAxis: MENU_CONTENT_PADDING + 1, crossAxis: 0 };
|
|
1995
|
+
};
|
|
1996
|
+
const Sub = React.memo((props) => {
|
|
1997
|
+
const {
|
|
1998
|
+
children,
|
|
1999
|
+
disabled = false,
|
|
2000
|
+
side = "right",
|
|
2001
|
+
align = "start",
|
|
2002
|
+
closeRoot = false,
|
|
2003
|
+
loop = false,
|
|
2004
|
+
modal = false,
|
|
2005
|
+
// open state related props
|
|
2006
|
+
open: controlledOpen,
|
|
2007
|
+
onOpenChange,
|
|
2008
|
+
defaultOpen
|
|
2009
|
+
} = props;
|
|
2010
|
+
const [open, setOpen] = useControlledState({
|
|
2011
|
+
initialState: defaultOpen ?? false,
|
|
2012
|
+
state: controlledOpen,
|
|
2013
|
+
setState: onOpenChange
|
|
2014
|
+
});
|
|
2015
|
+
const nodeId = react.useFloatingNodeId();
|
|
2016
|
+
const { refs, floatingStyles, context } = react.useFloating({
|
|
2017
|
+
nodeId,
|
|
2018
|
+
strategy: "fixed",
|
|
2019
|
+
whileElementsMounted: react.autoUpdate,
|
|
2020
|
+
open,
|
|
2021
|
+
onOpenChange: (open2, _event, reason) => {
|
|
2022
|
+
if (reason) setOpen(open2);
|
|
2023
|
+
},
|
|
2024
|
+
placement: side + (align !== "center" ? "-" + align : ""),
|
|
2025
|
+
middleware: [
|
|
2026
|
+
react.offset({ ...computeOffsets(side, align) }),
|
|
2027
|
+
react.size({
|
|
2028
|
+
padding: MENU_OVERFLOW_PADDING,
|
|
2029
|
+
apply({ availableHeight, elements }) {
|
|
2030
|
+
elements.floating.style.setProperty(
|
|
2031
|
+
"--overmap-menu-available-height",
|
|
2032
|
+
`${Math.max(availableHeight, MENU_MINIMUM_MAX_HEIGHT)}px`
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
}),
|
|
2036
|
+
react.flip(),
|
|
2037
|
+
react.shift({ padding: MENU_OVERFLOW_PADDING }),
|
|
2038
|
+
react.hide()
|
|
2039
|
+
]
|
|
2040
|
+
});
|
|
2041
|
+
const dismiss = react.useDismiss(context, {
|
|
2042
|
+
bubbles: closeRoot,
|
|
2043
|
+
outsidePress: closeRoot
|
|
2044
|
+
});
|
|
2045
|
+
const hover = react.useHover(context, {
|
|
2046
|
+
restMs: 50,
|
|
2047
|
+
handleClose: react.safePolygon({
|
|
2048
|
+
blockPointerEvents: true,
|
|
2049
|
+
requireIntent: false
|
|
2050
|
+
}),
|
|
2051
|
+
enabled: !disabled
|
|
2052
|
+
});
|
|
2053
|
+
const click = react.useClick(context, {
|
|
2054
|
+
enabled: !disabled
|
|
2055
|
+
});
|
|
2056
|
+
const elementsRef = React.useRef([]);
|
|
2057
|
+
const [activeIndex, setActiveIndex] = React.useState(null);
|
|
2058
|
+
const listNavigation = react.useListNavigation(context, {
|
|
2059
|
+
listRef: elementsRef,
|
|
2060
|
+
nested: true,
|
|
2061
|
+
activeIndex,
|
|
2062
|
+
onNavigate: setActiveIndex,
|
|
2063
|
+
loop,
|
|
2064
|
+
rtl: side === "left"
|
|
2065
|
+
});
|
|
2066
|
+
const { getFloatingProps, getItemProps, getReferenceProps } = react.useInteractions([
|
|
2067
|
+
listNavigation,
|
|
2068
|
+
dismiss,
|
|
2069
|
+
hover,
|
|
2070
|
+
click
|
|
2071
|
+
]);
|
|
2072
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2073
|
+
SubContext.Provider,
|
|
2074
|
+
{
|
|
2075
|
+
value: {
|
|
2076
|
+
open,
|
|
2077
|
+
setOpen,
|
|
2078
|
+
nodeId,
|
|
2079
|
+
refs,
|
|
2080
|
+
floatingStyles,
|
|
2081
|
+
context,
|
|
2082
|
+
elementsRef,
|
|
2083
|
+
activeIndex,
|
|
2084
|
+
setActiveIndex,
|
|
2085
|
+
getFloatingProps,
|
|
2086
|
+
getItemProps,
|
|
2087
|
+
getReferenceProps,
|
|
2088
|
+
disabled,
|
|
2089
|
+
side,
|
|
2090
|
+
closeRoot,
|
|
2091
|
+
modal
|
|
2092
|
+
},
|
|
2093
|
+
children
|
|
2094
|
+
}
|
|
2095
|
+
);
|
|
2096
|
+
});
|
|
2097
|
+
Sub.displayName = "SubMenu";
|
|
2098
|
+
const TRIGGER_SELECT_KEYS = ["Enter", " "];
|
|
2099
|
+
const Item = React.memo(
|
|
2100
|
+
React.forwardRef((props, forwardedRef) => {
|
|
2101
|
+
const rootMenuContext = useMenuContext();
|
|
2102
|
+
const { getItemProps, activeIndex, setOpen, size, variant, radius } = useMenuContentContext();
|
|
2103
|
+
const { closeRoot } = useSubContext();
|
|
2104
|
+
const {
|
|
2105
|
+
className,
|
|
2106
|
+
children,
|
|
2107
|
+
onSelect,
|
|
2108
|
+
onClick,
|
|
2109
|
+
onKeyDown,
|
|
2110
|
+
closeOnSelect = true,
|
|
2111
|
+
disabled,
|
|
2112
|
+
...rest
|
|
2113
|
+
} = props;
|
|
2114
|
+
const { ref, index } = react.useListItem();
|
|
2115
|
+
const mergeRefs = react.useMergeRefs([ref, forwardedRef]);
|
|
2116
|
+
const handleClick = React.useCallback(
|
|
2117
|
+
(e) => {
|
|
2118
|
+
e.stopPropagation();
|
|
2119
|
+
if (disabled) return;
|
|
2120
|
+
if (onClick) onClick(e);
|
|
2121
|
+
if (onSelect) onSelect();
|
|
2122
|
+
if (closeOnSelect) setOpen(false);
|
|
2123
|
+
if (closeRoot) rootMenuContext.setOpen(false);
|
|
2124
|
+
},
|
|
2125
|
+
[closeOnSelect, closeRoot, disabled, rootMenuContext, onClick, onSelect, setOpen]
|
|
2126
|
+
);
|
|
2127
|
+
const handleKeyDown = React.useCallback(
|
|
2128
|
+
(e) => {
|
|
2129
|
+
if (disabled) return;
|
|
2130
|
+
if (onKeyDown) onKeyDown(e);
|
|
2131
|
+
if (TRIGGER_SELECT_KEYS.includes(e.key)) {
|
|
2132
|
+
if (onSelect) onSelect();
|
|
2133
|
+
if (closeOnSelect) setOpen(false);
|
|
2134
|
+
}
|
|
2135
|
+
},
|
|
2136
|
+
[closeOnSelect, disabled, onKeyDown, onSelect, setOpen]
|
|
2137
|
+
);
|
|
2138
|
+
const isActive = React.useMemo(() => index === activeIndex, [activeIndex, index]);
|
|
2139
|
+
const computedChildren = React.useMemo(() => {
|
|
2140
|
+
return typeof children === "function" ? children({ active: isActive, selected: false }) : children;
|
|
2141
|
+
}, [children, isActive]);
|
|
2142
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2143
|
+
"div",
|
|
2144
|
+
{
|
|
2145
|
+
className: classVarianceAuthority.cx(className, menuItem({ size, variant }), radiusCva({ radius, maxLarge: true })),
|
|
2146
|
+
ref: mergeRefs,
|
|
2147
|
+
role: "menuitem",
|
|
2148
|
+
"data-disabled": disabled ? "" : void 0,
|
|
2149
|
+
"aria-disabled": disabled,
|
|
2150
|
+
"data-highlighted": isActive ? "" : void 0,
|
|
2151
|
+
...getItemProps({
|
|
2152
|
+
onClick: handleClick,
|
|
2153
|
+
onKeyDown: handleKeyDown,
|
|
2154
|
+
tabIndex: isActive ? 0 : -1,
|
|
2155
|
+
...rest
|
|
2156
|
+
}),
|
|
2157
|
+
children: computedChildren
|
|
2158
|
+
}
|
|
2159
|
+
);
|
|
2160
|
+
})
|
|
2161
|
+
);
|
|
2162
|
+
const SelectContext = React.createContext({});
|
|
2163
|
+
function useSelectContext() {
|
|
2164
|
+
return React.useContext(SelectContext);
|
|
2165
|
+
}
|
|
2166
|
+
const SelectContextProvider = React.memo((props) => {
|
|
2167
|
+
const { type, children } = props;
|
|
2168
|
+
const [controlledValue, setControlledValue] = React.useState(
|
|
2169
|
+
type === "single" ? (props == null ? void 0 : props.defaultValue) ?? null : null
|
|
2170
|
+
);
|
|
2171
|
+
const [controlledValues, setControlledValues] = React.useState(
|
|
2172
|
+
type === "multi" ? (props == null ? void 0 : props.defaultValues) ?? [] : []
|
|
2173
|
+
);
|
|
2174
|
+
const onValuesChange = React.useCallback(
|
|
2175
|
+
(values) => {
|
|
2176
|
+
setControlledValues(values);
|
|
2177
|
+
if (type === "multi" && (props == null ? void 0 : props.onValuesChange)) props.onValuesChange(values);
|
|
2178
|
+
},
|
|
2179
|
+
[props, type]
|
|
2180
|
+
);
|
|
2181
|
+
const onValueChange = React.useCallback(
|
|
2182
|
+
(value2) => {
|
|
2183
|
+
setControlledValue(value2);
|
|
2184
|
+
if (type === "single" && (props == null ? void 0 : props.onValueChange)) props.onValueChange(value2);
|
|
2185
|
+
},
|
|
2186
|
+
[props, type]
|
|
2187
|
+
);
|
|
2188
|
+
const value = React.useMemo(
|
|
2189
|
+
() => type === "multi" ? {
|
|
2190
|
+
type,
|
|
2191
|
+
values: (props == null ? void 0 : props.values) ?? controlledValues,
|
|
2192
|
+
handleValuesChange: onValuesChange
|
|
2193
|
+
} : {
|
|
2194
|
+
type,
|
|
2195
|
+
value: props.value ?? controlledValue,
|
|
2196
|
+
handleValueChange: onValueChange
|
|
2197
|
+
},
|
|
2198
|
+
[controlledValue, controlledValues, onValueChange, onValuesChange, props, type]
|
|
2199
|
+
);
|
|
2200
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContext.Provider, { value, children });
|
|
2201
|
+
});
|
|
2202
|
+
SelectContextProvider.displayName = "SelectContextProvider";
|
|
2203
|
+
const MultiSelectGroup = React.memo(
|
|
2204
|
+
React.forwardRef((props, ref) => {
|
|
2205
|
+
const { children, values, onValuesChange, ...rest } = props;
|
|
2206
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Group, { ref, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(SelectContextProvider, { type: "multi", values, onValuesChange, children }) });
|
|
2207
|
+
})
|
|
2208
|
+
);
|
|
2209
|
+
const SelectedIndicatorContext = React.createContext({});
|
|
2210
|
+
const useSelectedIndicatorContext = () => React.useContext(SelectedIndicatorContext);
|
|
2211
|
+
const SelectedIndicator = React.memo((props) => {
|
|
2212
|
+
const { children } = props;
|
|
2213
|
+
const { selected } = useSelectedIndicatorContext();
|
|
2214
|
+
const { size } = useMenuContentContext();
|
|
2215
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: menuSelectedIndicator({ size }), children: selected ? children : null });
|
|
2216
|
+
});
|
|
2217
|
+
SelectedIndicator.displayName = "SelectedIndicator";
|
|
2218
|
+
const MultiSelectItem = React.memo(
|
|
2219
|
+
React.forwardRef((props, ref) => {
|
|
2220
|
+
const { onSelect, children, closeOnSelect = false, value, ...rest } = props;
|
|
2221
|
+
const { values, handleValuesChange } = useSelectContext();
|
|
2222
|
+
const selected = React.useMemo(() => values.includes(value), [value, values]);
|
|
2223
|
+
const handleSelect = React.useCallback(() => {
|
|
2224
|
+
if (!selected) {
|
|
2225
|
+
handleValuesChange([...values, value]);
|
|
2226
|
+
} else {
|
|
2227
|
+
handleValuesChange(values.filter((currentValue) => currentValue !== value));
|
|
2228
|
+
}
|
|
2229
|
+
if (onSelect) onSelect();
|
|
2230
|
+
}, [handleValuesChange, onSelect, selected, value, values]);
|
|
2231
|
+
const computedChildren = React.useMemo(() => {
|
|
2232
|
+
return typeof children === "function" ? ({ active }) => children({ selected, active }) : children;
|
|
2233
|
+
}, [children, selected]);
|
|
2234
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectedIndicatorContext.Provider, { value: { selected }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2235
|
+
Item,
|
|
2236
|
+
{
|
|
2237
|
+
ref,
|
|
2238
|
+
role: "menuitemcheckbox",
|
|
2239
|
+
onSelect: handleSelect,
|
|
2240
|
+
closeOnSelect,
|
|
2241
|
+
"data-selected": selected ? "" : void 0,
|
|
2242
|
+
...rest,
|
|
2243
|
+
children: computedChildren
|
|
2244
|
+
}
|
|
2245
|
+
) });
|
|
2246
|
+
})
|
|
2247
|
+
);
|
|
2248
|
+
const PagesContext = React.createContext({});
|
|
2249
|
+
const usePagesContext = () => React.useContext(PagesContext);
|
|
2250
|
+
const Pages = React.memo((props) => {
|
|
2251
|
+
const { children, defaultPage, page, onPageChange } = props;
|
|
2252
|
+
const [activePage, setActivePage] = useControlledState({
|
|
2253
|
+
state: page,
|
|
2254
|
+
initialState: defaultPage ?? "",
|
|
2255
|
+
setState: onPageChange
|
|
2256
|
+
});
|
|
2257
|
+
return /* @__PURE__ */ jsxRuntime.jsx(PagesContext.Provider, { value: { activePage, setActivePage }, children });
|
|
2258
|
+
});
|
|
2259
|
+
Pages.displayName = "Pages";
|
|
2260
|
+
const PageContent = React.memo((props) => {
|
|
2261
|
+
const { page, children } = props;
|
|
2262
|
+
const { activePage } = usePagesContext();
|
|
2263
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: activePage === page ? children : null });
|
|
2264
|
+
});
|
|
2265
|
+
PageContent.displayName = "PageContent";
|
|
2266
|
+
const PageTrigger = React.memo(
|
|
2267
|
+
React.forwardRef((props, ref) => {
|
|
2268
|
+
const { onSelect, page, ...rest } = props;
|
|
2269
|
+
const { refs, setActiveIndex } = useMenuContentContext();
|
|
2270
|
+
const { setActivePage } = usePagesContext();
|
|
2271
|
+
const handleSelect = React.useCallback(() => {
|
|
2272
|
+
var _a;
|
|
2273
|
+
setActivePage(page);
|
|
2274
|
+
(_a = refs.floating.current) == null ? void 0 : _a.focus();
|
|
2275
|
+
setActiveIndex(null);
|
|
2276
|
+
if (onSelect) onSelect();
|
|
2277
|
+
}, [onSelect, page, refs.floating, setActiveIndex, setActivePage]);
|
|
2278
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Item, { ref, onSelect: handleSelect, closeOnSelect: false, ...rest });
|
|
2279
|
+
})
|
|
2280
|
+
);
|
|
2281
|
+
const SelectAllContext = React.createContext({});
|
|
2282
|
+
const SelectAllIndicator = React.forwardRef((props, ref) => {
|
|
2283
|
+
const { className, children, ...rest } = props;
|
|
2284
|
+
const { size } = useMenuContentContext();
|
|
2285
|
+
const { selected } = React.useContext(SelectAllContext);
|
|
2286
|
+
const computedChildren = React.useMemo(() => {
|
|
2287
|
+
return typeof children === "function" ? children(selected === "indeterminate") : children;
|
|
2288
|
+
}, [children, selected]);
|
|
2289
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { ref, className: classVarianceAuthority.cx(className, menuSelectedIndicator({ size })), ...rest, children: selected ? computedChildren : null });
|
|
2290
|
+
});
|
|
2291
|
+
SelectAllIndicator.displayName = "SelectAllIndicator";
|
|
2292
|
+
const SelectAllItem = React.forwardRef((props, ref) => {
|
|
2293
|
+
const { children, allValues, onSelect, closeOnSelect = false, ...rest } = props;
|
|
2294
|
+
const { values, handleValuesChange } = useSelectContext();
|
|
2295
|
+
const selected = React.useMemo(() => {
|
|
2296
|
+
const selectValuesSet = new Set(values);
|
|
2297
|
+
if (allValues.every((value) => selectValuesSet.has(value))) return true;
|
|
2298
|
+
if (values.length > 0) return "indeterminate";
|
|
2299
|
+
return false;
|
|
2300
|
+
}, [allValues, values]);
|
|
2301
|
+
const handleSelect = React.useCallback(() => {
|
|
2302
|
+
onSelect == null ? void 0 : onSelect();
|
|
2303
|
+
switch (selected) {
|
|
2304
|
+
case true:
|
|
2305
|
+
handleValuesChange([]);
|
|
2306
|
+
break;
|
|
2307
|
+
case "indeterminate":
|
|
2308
|
+
case false: {
|
|
2309
|
+
handleValuesChange(allValues);
|
|
2310
|
+
break;
|
|
2311
|
+
}
|
|
2312
|
+
}
|
|
2313
|
+
}, [allValues, handleValuesChange, onSelect, selected]);
|
|
2314
|
+
const computedChildren = React.useMemo(() => {
|
|
2315
|
+
return typeof children === "function" ? ({ active }) => children({ selected, active }) : children;
|
|
2316
|
+
}, [children, selected]);
|
|
2317
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectAllContext.Provider, { value: { selected }, children: /* @__PURE__ */ jsxRuntime.jsx(Item, { onSelect: handleSelect, ref, "data-state": selected, closeOnSelect, ...rest, children: computedChildren }) });
|
|
2318
|
+
});
|
|
2319
|
+
SelectAllItem.displayName = "SelectAllItem";
|
|
2320
|
+
const SelectGroup = React.memo(
|
|
2321
|
+
React.forwardRef((props, ref) => {
|
|
2322
|
+
const { children, value, onValueChange } = props;
|
|
2323
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectContextProvider, { type: "single", value, onValueChange, children: /* @__PURE__ */ jsxRuntime.jsx(Group, { ref, children }) });
|
|
2324
|
+
})
|
|
2325
|
+
);
|
|
2326
|
+
const SelectItem = React.memo(
|
|
2327
|
+
React.forwardRef((props, ref) => {
|
|
2328
|
+
const { value, onSelect, children, closeOnSelect = false, ...rest } = props;
|
|
2329
|
+
const { value: currentValue, handleValueChange } = useSelectContext();
|
|
2330
|
+
const selected = React.useMemo(() => value === currentValue, [currentValue, value]);
|
|
2331
|
+
const handleSelect = React.useCallback(() => {
|
|
2332
|
+
handleValueChange(!selected ? value : null);
|
|
2333
|
+
if (onSelect) onSelect();
|
|
2334
|
+
}, [handleValueChange, onSelect, selected, value]);
|
|
2335
|
+
const computedChildren = React.useMemo(() => {
|
|
2336
|
+
return typeof children === "function" ? ({ active }) => children({ selected, active }) : children;
|
|
2337
|
+
}, [children, selected]);
|
|
2338
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SelectedIndicatorContext.Provider, { value: { selected }, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2339
|
+
Item,
|
|
2340
|
+
{
|
|
2341
|
+
ref,
|
|
2342
|
+
role: "menuitemcheckbox",
|
|
2343
|
+
onSelect: handleSelect,
|
|
2344
|
+
closeOnSelect,
|
|
2345
|
+
"data-selected": selected ? "" : void 0,
|
|
2346
|
+
...rest,
|
|
2347
|
+
children: computedChildren
|
|
2348
|
+
}
|
|
2349
|
+
) });
|
|
2350
|
+
})
|
|
2351
|
+
);
|
|
2352
|
+
const Separator$1 = React.memo(
|
|
2353
|
+
React.forwardRef((props, ref) => {
|
|
2354
|
+
const { className, ...rest } = props;
|
|
2355
|
+
const { size } = useMenuContentContext();
|
|
2356
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixSeparator__namespace.Root, { className: classVarianceAuthority.cx(className, menuSeparator({ size })), ref, ...rest });
|
|
2357
|
+
})
|
|
2358
|
+
);
|
|
2359
|
+
const SubContent = React.memo(
|
|
2360
|
+
React.forwardRef((props, forwardedRef) => {
|
|
2361
|
+
var _a;
|
|
2362
|
+
const { children, ...rest } = props;
|
|
2363
|
+
const { middlewareData } = useMenuContext();
|
|
2364
|
+
const { accentColor, radius, variant, size } = useMenuContentContext();
|
|
2365
|
+
const {
|
|
2366
|
+
open,
|
|
2367
|
+
nodeId,
|
|
2368
|
+
refs,
|
|
2369
|
+
context,
|
|
2370
|
+
getFloatingProps,
|
|
2371
|
+
getItemProps,
|
|
2372
|
+
activeIndex,
|
|
2373
|
+
setActiveIndex,
|
|
2374
|
+
elementsRef,
|
|
2375
|
+
floatingStyles,
|
|
2376
|
+
setOpen,
|
|
2377
|
+
side
|
|
2378
|
+
} = useSubContext();
|
|
2379
|
+
const wrapperRef = React.useRef(null);
|
|
2380
|
+
const mergeRefs = react.useMergeRefs([refs.setFloating, wrapperRef]);
|
|
2381
|
+
const computedFloatingStyles = React.useMemo(() => {
|
|
2382
|
+
var _a2;
|
|
2383
|
+
return {
|
|
2384
|
+
...floatingStyles,
|
|
2385
|
+
visibility: ((_a2 = middlewareData.hide) == null ? void 0 : _a2.referenceHidden) ? "hidden" : "visible"
|
|
2386
|
+
};
|
|
2387
|
+
}, [floatingStyles, (_a = middlewareData.hide) == null ? void 0 : _a.referenceHidden]);
|
|
2388
|
+
return /* @__PURE__ */ jsxRuntime.jsx(react.FloatingNode, { id: nodeId, children: open && /* @__PURE__ */ jsxRuntime.jsx(react.FloatingPortal, { children: /* @__PURE__ */ jsxRuntime.jsx(react.FloatingFocusManager, { context, initialFocus: wrapperRef, children: /* @__PURE__ */ jsxRuntime.jsx(react.FloatingList, { elementsRef, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2389
|
+
MenuContentContext.Provider,
|
|
2390
|
+
{
|
|
2391
|
+
value: {
|
|
2392
|
+
getItemProps,
|
|
2393
|
+
activeIndex,
|
|
2394
|
+
setActiveIndex,
|
|
2395
|
+
elementsRef,
|
|
2396
|
+
open,
|
|
2397
|
+
setOpen,
|
|
2398
|
+
refs,
|
|
2399
|
+
size,
|
|
2400
|
+
radius,
|
|
2401
|
+
accentColor,
|
|
2402
|
+
variant
|
|
2403
|
+
},
|
|
2404
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2405
|
+
"div",
|
|
2406
|
+
{
|
|
2407
|
+
className: "outline-none",
|
|
2408
|
+
ref: mergeRefs,
|
|
2409
|
+
style: computedFloatingStyles,
|
|
2410
|
+
...getFloatingProps(),
|
|
2411
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2412
|
+
"div",
|
|
2413
|
+
{
|
|
2414
|
+
className: classVarianceAuthority.cx(
|
|
2415
|
+
"overmap-menu-sub-content",
|
|
2416
|
+
menuContent({ size }),
|
|
2417
|
+
floating({ side, shadow: "3" }),
|
|
2418
|
+
radiusCva({ radius, maxLarge: true }),
|
|
2419
|
+
"max-h-(--overmap-menu-available-height)"
|
|
2420
|
+
),
|
|
2421
|
+
ref: forwardedRef,
|
|
2422
|
+
"data-state": open ? "open" : "closed",
|
|
2423
|
+
"data-side": side,
|
|
2424
|
+
"data-accent-color": accentColor,
|
|
2425
|
+
...rest,
|
|
2426
|
+
children
|
|
2427
|
+
}
|
|
2428
|
+
)
|
|
2429
|
+
}
|
|
2430
|
+
)
|
|
2431
|
+
}
|
|
2432
|
+
) }) }) }) });
|
|
2433
|
+
})
|
|
2434
|
+
);
|
|
2435
|
+
const SubTrigger = React.memo(
|
|
2436
|
+
React.forwardRef((props, forwardedRef) => {
|
|
2437
|
+
const { children, ...rest } = props;
|
|
2438
|
+
const { refs, getReferenceProps, open, disabled } = useSubContext();
|
|
2439
|
+
const mergedRefs = react.useMergeRefs([forwardedRef, refs.setReference]);
|
|
2440
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2441
|
+
Item,
|
|
2442
|
+
{
|
|
2443
|
+
ref: mergedRefs,
|
|
2444
|
+
closeOnSelect: false,
|
|
2445
|
+
"aria-haspopup": "menu",
|
|
2446
|
+
"data-open": open,
|
|
2447
|
+
disabled,
|
|
2448
|
+
...getReferenceProps(rest),
|
|
2449
|
+
children
|
|
2450
|
+
}
|
|
2451
|
+
);
|
|
2452
|
+
})
|
|
2453
|
+
);
|
|
2454
|
+
const VirtualTrigger = React.memo((props) => {
|
|
2455
|
+
const { virtualElement, disabled } = props;
|
|
2456
|
+
const { refs, setTriggerType, setOpen } = useMenuContext();
|
|
2457
|
+
React.useEffect(() => {
|
|
2458
|
+
setTriggerType("virtual");
|
|
2459
|
+
}, [setTriggerType]);
|
|
2460
|
+
React.useEffect(() => {
|
|
2461
|
+
if (!disabled && virtualElement) {
|
|
2462
|
+
refs.setPositionReference(virtualElement);
|
|
2463
|
+
setOpen(true);
|
|
2464
|
+
} else {
|
|
2465
|
+
refs.setPositionReference(null);
|
|
2466
|
+
setOpen(false);
|
|
2467
|
+
}
|
|
2468
|
+
}, [disabled, refs, setOpen, virtualElement]);
|
|
2469
|
+
return null;
|
|
2470
|
+
});
|
|
2471
|
+
VirtualTrigger.displayName = "VirtualTrigger";
|
|
2472
|
+
const OvermapMenu = {
|
|
2473
|
+
Root,
|
|
2474
|
+
ClickTrigger,
|
|
2475
|
+
ContextTrigger,
|
|
2476
|
+
VirtualTrigger,
|
|
2477
|
+
Content,
|
|
2478
|
+
Item,
|
|
2479
|
+
Sub,
|
|
2480
|
+
SubContent,
|
|
2481
|
+
SubTrigger,
|
|
2482
|
+
Group,
|
|
2483
|
+
SelectGroup,
|
|
2484
|
+
MultiSelectGroup,
|
|
2485
|
+
MultiSelectItem,
|
|
2486
|
+
SelectAllItem,
|
|
2487
|
+
SelectAllIndicator,
|
|
2488
|
+
SelectItem,
|
|
2489
|
+
SelectedIndicator,
|
|
2490
|
+
PageContent,
|
|
2491
|
+
Pages,
|
|
2492
|
+
PageTrigger,
|
|
2493
|
+
Separator: Separator$1,
|
|
2494
|
+
InputField: MenuInputField,
|
|
2495
|
+
InputRoot: MenuInputRoot,
|
|
2496
|
+
InputSlot: MenuInputSlot
|
|
2497
|
+
};
|
|
2498
|
+
const PopoverArrow = React.forwardRef((props, ref) => {
|
|
2499
|
+
const { className, ...rest } = props;
|
|
2500
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixPopover__namespace.Arrow, { className: classVarianceAuthority.cx(className, "fill-(--base-6)"), ref, ...rest });
|
|
2501
|
+
});
|
|
2502
|
+
PopoverArrow.displayName = "PopoverArrow";
|
|
2503
|
+
const popoverContent = classVarianceAuthority.cva(["bg-(--base-1)", "ring-1", "ring-(--base-6)"], {
|
|
2504
|
+
variants: {
|
|
2505
|
+
size: {
|
|
2506
|
+
xs: ["text-xs", "p-2"],
|
|
2507
|
+
sm: ["text-sm", "p-3"],
|
|
2508
|
+
md: ["text-base", "p-4"],
|
|
2509
|
+
lg: ["text-lg", "p-5"],
|
|
2510
|
+
xl: ["text-xl", "p-6"]
|
|
2511
|
+
}
|
|
2512
|
+
},
|
|
2513
|
+
defaultVariants: {
|
|
2514
|
+
size: "md"
|
|
2515
|
+
}
|
|
2516
|
+
});
|
|
2517
|
+
const PopoverContent = React.forwardRef((props, ref) => {
|
|
2518
|
+
const providerContext = useProvider();
|
|
2519
|
+
const {
|
|
2520
|
+
className,
|
|
2521
|
+
radius = providerContext.radius,
|
|
2522
|
+
accentColor = providerContext.accentColor,
|
|
2523
|
+
size = "md",
|
|
2524
|
+
sideOffset = 5,
|
|
2525
|
+
container,
|
|
2526
|
+
...rest
|
|
2527
|
+
} = props;
|
|
2528
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixPopover__namespace.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2529
|
+
RadixPopover__namespace.Content,
|
|
2530
|
+
{
|
|
2531
|
+
className: classVarianceAuthority.cx(
|
|
2532
|
+
className,
|
|
2533
|
+
popoverContent({ size }),
|
|
2534
|
+
floating({ shadow: "3" }),
|
|
2535
|
+
radiusCva({ radius, maxLarge: true })
|
|
2536
|
+
),
|
|
2537
|
+
ref,
|
|
2538
|
+
sideOffset,
|
|
2539
|
+
"data-accent-color": accentColor,
|
|
2540
|
+
...rest
|
|
2541
|
+
}
|
|
2542
|
+
) });
|
|
2543
|
+
});
|
|
2544
|
+
PopoverContent.displayName = "PopoverContent";
|
|
2545
|
+
const Popover = {
|
|
2546
|
+
...RadixPopover__namespace,
|
|
2547
|
+
Content: PopoverContent,
|
|
2548
|
+
Arrow: PopoverArrow
|
|
2549
|
+
};
|
|
2550
|
+
const RadioGroupIndicator = React.forwardRef((props, ref) => {
|
|
2551
|
+
const { className, ...rest } = props;
|
|
2552
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixRadioGroup__namespace.Indicator, { className: classVarianceAuthority.cx(className, "flex items-center justify-center"), ref, ...rest });
|
|
2553
|
+
});
|
|
2554
|
+
RadioGroupIndicator.displayName = "RadioGroupIndicator";
|
|
2555
|
+
const RadioGroupContext = React.createContext({});
|
|
2556
|
+
const radioGroupItem = classVarianceAuthority.cva(
|
|
2557
|
+
[
|
|
2558
|
+
"outline-none",
|
|
2559
|
+
"rounded-full",
|
|
2560
|
+
"focus-visible:outline-2",
|
|
2561
|
+
"focus-visible:outline-(--accent-a8)",
|
|
2562
|
+
"focus-visible:outline-offset-2",
|
|
2563
|
+
"disabled:opacity-50",
|
|
2564
|
+
"disabled:pointer-events-none"
|
|
2565
|
+
],
|
|
2566
|
+
{
|
|
2567
|
+
variants: {
|
|
2568
|
+
variant: {
|
|
2569
|
+
surface: [
|
|
2570
|
+
"bg-(--base-surface)",
|
|
2571
|
+
"data-[state='checked']:bg-(--accent-indicator)",
|
|
2572
|
+
"ring-1",
|
|
2573
|
+
"ring-inset",
|
|
2574
|
+
"ring-(--base-a6)",
|
|
2575
|
+
"data-[state='checked']:ring-(--accent-indicator)",
|
|
2576
|
+
"text-(--accent-contrast)"
|
|
2577
|
+
],
|
|
2578
|
+
soft: ["bg-(--accent-a3)", "text-(--accent-a11)"]
|
|
2579
|
+
},
|
|
2580
|
+
size: {
|
|
2581
|
+
xs: ["w-4", "h-4", "text-[0.625rem]"],
|
|
2582
|
+
sm: ["w-5", "h-5", "text-xs"],
|
|
2583
|
+
md: ["w-6", "h-6", "text-sm"],
|
|
2584
|
+
lg: ["w-7", "h-7", "text-md"],
|
|
2585
|
+
xl: ["w-8", "h-8", "text-lg"]
|
|
2586
|
+
}
|
|
2587
|
+
},
|
|
2588
|
+
defaultVariants: {
|
|
2589
|
+
variant: "surface",
|
|
2590
|
+
size: "md"
|
|
2591
|
+
}
|
|
2592
|
+
}
|
|
2593
|
+
);
|
|
2594
|
+
const RadioGroupItem = React.memo(
|
|
2595
|
+
React.forwardRef((props, ref) => {
|
|
2596
|
+
const radioGroupContext = React.useContext(RadioGroupContext);
|
|
2597
|
+
const { className, size = radioGroupContext.size, variant = radioGroupContext.variant, ...rest } = props;
|
|
2598
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2599
|
+
RadixRadioGroup__namespace.Item,
|
|
2600
|
+
{
|
|
2601
|
+
className: classVarianceAuthority.cx(className, radioGroupItem({ size, variant }), "flex", "justify-center", "items-center"),
|
|
2602
|
+
ref,
|
|
2603
|
+
...rest
|
|
2604
|
+
}
|
|
2605
|
+
);
|
|
2606
|
+
})
|
|
2607
|
+
);
|
|
2608
|
+
const RadioGroupRoot = React.memo(
|
|
2609
|
+
React.forwardRef((props, ref) => {
|
|
2610
|
+
const providerContext = useProvider();
|
|
2611
|
+
const {
|
|
2612
|
+
className,
|
|
2613
|
+
accentColor = providerContext.accentColor,
|
|
2614
|
+
variant = "surface",
|
|
2615
|
+
size = "md",
|
|
2616
|
+
children,
|
|
2617
|
+
...rest
|
|
2618
|
+
} = props;
|
|
2619
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixRadioGroup__namespace.Root, { className: classVarianceAuthority.cx(className), ref, "data-accent-color": accentColor, ...rest, children: /* @__PURE__ */ jsxRuntime.jsx(RadioGroupContext.Provider, { value: { variant, size }, children }) });
|
|
2620
|
+
})
|
|
2621
|
+
);
|
|
2622
|
+
const RadioGroup = {
|
|
2623
|
+
Indicator: RadioGroupIndicator,
|
|
2624
|
+
Item: RadioGroupItem,
|
|
2625
|
+
Root: RadioGroupRoot
|
|
2626
|
+
};
|
|
2627
|
+
const separator = classVarianceAuthority.cva([], {
|
|
2628
|
+
variants: {
|
|
2629
|
+
size: {
|
|
2630
|
+
xs: [],
|
|
2631
|
+
sm: [],
|
|
2632
|
+
md: [],
|
|
2633
|
+
lg: [],
|
|
2634
|
+
xl: [],
|
|
2635
|
+
full: []
|
|
2636
|
+
},
|
|
2637
|
+
orientation: {
|
|
2638
|
+
horizontal: ["h-px"],
|
|
2639
|
+
vertical: ["w-px"]
|
|
2640
|
+
},
|
|
2641
|
+
weight: {
|
|
2642
|
+
light: ["bg-(--accent-a6)"],
|
|
2643
|
+
medium: ["bg-(--accent-a7)"],
|
|
2644
|
+
heavy: ["bg-(--accent-a8)"]
|
|
2645
|
+
}
|
|
2646
|
+
},
|
|
2647
|
+
compoundVariants: [
|
|
2648
|
+
{
|
|
2649
|
+
size: "xs",
|
|
2650
|
+
orientation: "horizontal",
|
|
2651
|
+
class: ["w-4"]
|
|
2652
|
+
},
|
|
2653
|
+
{
|
|
2654
|
+
size: "sm",
|
|
2655
|
+
orientation: "horizontal",
|
|
2656
|
+
class: ["w-6"]
|
|
2657
|
+
},
|
|
2658
|
+
{
|
|
2659
|
+
size: "md",
|
|
2660
|
+
orientation: "horizontal",
|
|
2661
|
+
class: ["w-10"]
|
|
2662
|
+
},
|
|
2663
|
+
{
|
|
2664
|
+
size: "lg",
|
|
2665
|
+
orientation: "horizontal",
|
|
2666
|
+
class: ["w-16"]
|
|
2667
|
+
},
|
|
2668
|
+
{
|
|
2669
|
+
size: "xl",
|
|
2670
|
+
orientation: "horizontal",
|
|
2671
|
+
class: ["w-24"]
|
|
2672
|
+
},
|
|
2673
|
+
{
|
|
2674
|
+
size: "full",
|
|
2675
|
+
orientation: "horizontal",
|
|
2676
|
+
class: ["w-full"]
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
size: "xs",
|
|
2680
|
+
orientation: "vertical",
|
|
2681
|
+
class: ["h-4"]
|
|
2682
|
+
},
|
|
2683
|
+
{
|
|
2684
|
+
size: "sm",
|
|
2685
|
+
orientation: "vertical",
|
|
2686
|
+
class: ["h-6"]
|
|
2687
|
+
},
|
|
2688
|
+
{
|
|
2689
|
+
size: "md",
|
|
2690
|
+
orientation: "vertical",
|
|
2691
|
+
class: ["h-10"]
|
|
2692
|
+
},
|
|
2693
|
+
{
|
|
2694
|
+
size: "lg",
|
|
2695
|
+
orientation: "vertical",
|
|
2696
|
+
class: ["h-16"]
|
|
2697
|
+
},
|
|
2698
|
+
{
|
|
2699
|
+
size: "xl",
|
|
2700
|
+
orientation: "vertical",
|
|
2701
|
+
class: ["h-24"]
|
|
2702
|
+
},
|
|
2703
|
+
{
|
|
2704
|
+
size: "full",
|
|
2705
|
+
orientation: "vertical",
|
|
2706
|
+
class: ["h-full"]
|
|
2707
|
+
}
|
|
2708
|
+
],
|
|
2709
|
+
defaultVariants: {
|
|
2710
|
+
size: "md",
|
|
2711
|
+
orientation: "horizontal",
|
|
2712
|
+
weight: "medium"
|
|
2713
|
+
}
|
|
2714
|
+
});
|
|
2715
|
+
const Separator = React.forwardRef((props, ref) => {
|
|
2716
|
+
const { className, accentColor = "base", orientation, size, weight, ...rest } = props;
|
|
2717
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2718
|
+
RadixSeparator__namespace.Root,
|
|
2719
|
+
{
|
|
2720
|
+
className: classVarianceAuthority.cx(className, separator({ orientation, size, weight })),
|
|
2721
|
+
"data-accent-color": accentColor,
|
|
2722
|
+
ref,
|
|
2723
|
+
...rest
|
|
2724
|
+
}
|
|
2725
|
+
);
|
|
2726
|
+
});
|
|
2727
|
+
Separator.displayName = "Separator";
|
|
2728
|
+
const TIMEOUT_DURATION = 200;
|
|
2729
|
+
const SlideOutV2 = React.memo(
|
|
2730
|
+
React.forwardRef((props, ref) => {
|
|
2731
|
+
const {
|
|
2732
|
+
className,
|
|
2733
|
+
style,
|
|
2734
|
+
children,
|
|
2735
|
+
open,
|
|
2736
|
+
modal = false,
|
|
2737
|
+
resizeable = true,
|
|
2738
|
+
side,
|
|
2739
|
+
position = "relative",
|
|
2740
|
+
initialWidth,
|
|
2741
|
+
minWidth,
|
|
2742
|
+
maxWidth,
|
|
2743
|
+
onDismiss,
|
|
2744
|
+
onOpening,
|
|
2745
|
+
onClosed
|
|
2746
|
+
} = props;
|
|
2747
|
+
const isLeft = side === "left";
|
|
2748
|
+
const [slideOutWidth, setSlideOutWidth] = React.useState(initialWidth);
|
|
2749
|
+
const handleResize = React.useCallback(
|
|
2750
|
+
(_event, _dir, ref2, _delta) => {
|
|
2751
|
+
setSlideOutWidth(ref2.clientWidth);
|
|
2752
|
+
},
|
|
2753
|
+
[]
|
|
2754
|
+
);
|
|
2755
|
+
const handleDismiss = React.useCallback(() => {
|
|
2756
|
+
if (modal && onDismiss) {
|
|
2757
|
+
onDismiss();
|
|
2758
|
+
}
|
|
2759
|
+
}, [modal, onDismiss]);
|
|
2760
|
+
React.useEffect(() => {
|
|
2761
|
+
setSlideOutWidth(initialWidth);
|
|
2762
|
+
}, [initialWidth]);
|
|
2763
|
+
const CSSTransitionClassNames = React.useMemo(
|
|
2764
|
+
() => ({
|
|
2765
|
+
enter: isLeft ? "-ml-(--slide-out-width)" : "-mr-(--slide-out-width)",
|
|
2766
|
+
enterActive: isLeft ? "ease-linear duration-200 transition-[margin-left] ml-0" : "ease-linear duration-200 transition-[margin-right] mr-0",
|
|
2767
|
+
enterDone: isLeft ? "ml-0" : "mr-0",
|
|
2768
|
+
exitActive: isLeft ? "ease-linear duration-200 transition-[margin-left] -ml-(--slide-out-width)" : "ease-linear duration-200 transition-[margin-right] -mr-(--slide-out-width)",
|
|
2769
|
+
exitDone: isLeft ? "-ml-(--slide-out-width)" : "-mr-(--slide-out-width)"
|
|
2770
|
+
}),
|
|
2771
|
+
[isLeft]
|
|
2772
|
+
);
|
|
2773
|
+
return (
|
|
2774
|
+
/** The DismissableLayer Component is strictly a functionality-based component for emulating an overlay. Its main use is for
|
|
2775
|
+
* detecting interactions OUTSIDE whatever content is placed within it, allowing the developer to decide what to do with that
|
|
2776
|
+
* content when it is 'dismissed' (i.e closed, to be hidden, etc.).
|
|
2777
|
+
*
|
|
2778
|
+
* There are three main events that trigger this 'dismissal' behavior
|
|
2779
|
+
* 1) Focus is given to an element outside the content rendered within the DismissableLayer component
|
|
2780
|
+
* 2) PointerEvent occurs on an element outside the content rendered within the DismissableLayer component
|
|
2781
|
+
* 3) Escape key is pressed
|
|
2782
|
+
*
|
|
2783
|
+
* The 'disableOutsidePointerEvents' prop is used for disabling focus and PointerEvents on outside elements.
|
|
2784
|
+
* The dismissal behavior will still eb trigger, it just won't allow any elements to be interacted with until
|
|
2785
|
+
* the DismissableLayer is removed from the DOM, or 'disableOutsidePointerEvents' is set to false
|
|
2786
|
+
*
|
|
2787
|
+
* In this use case, Overmap's SlideOut will have two specific behaviors
|
|
2788
|
+
* 1) Modal mode - the SlideOut has modal-like behavior where it will dismiss PointerEvents and Focus of
|
|
2789
|
+
* outside elements
|
|
2790
|
+
* 2) Non-modal mode - the SlideOut behaves like a side panel the co-exists with content outside of it
|
|
2791
|
+
* */
|
|
2792
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2793
|
+
reactTransitionGroup.CSSTransition,
|
|
2794
|
+
{
|
|
2795
|
+
classNames: CSSTransitionClassNames,
|
|
2796
|
+
in: open,
|
|
2797
|
+
timeout: TIMEOUT_DURATION,
|
|
2798
|
+
unmountOnExit: true,
|
|
2799
|
+
mountOnEnter: true,
|
|
2800
|
+
onEntering: onOpening,
|
|
2801
|
+
onExited: onClosed,
|
|
2802
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2803
|
+
reactDismissableLayer.DismissableLayer,
|
|
2804
|
+
{
|
|
2805
|
+
disableOutsidePointerEvents: modal,
|
|
2806
|
+
style,
|
|
2807
|
+
onInteractOutside: handleDismiss,
|
|
2808
|
+
onEscapeKeyDown: handleDismiss,
|
|
2809
|
+
asChild: true,
|
|
2810
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2811
|
+
reactSlot.Slot,
|
|
2812
|
+
{
|
|
2813
|
+
className: classVarianceAuthority.cx(className, "top-0", "bottom-0", {
|
|
2814
|
+
"left-0": isLeft,
|
|
2815
|
+
"right-0": !isLeft,
|
|
2816
|
+
absolute: position === "absolute",
|
|
2817
|
+
relative: position === "relative"
|
|
2818
|
+
}),
|
|
2819
|
+
ref,
|
|
2820
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2821
|
+
reResizable.Resizable,
|
|
2822
|
+
{
|
|
2823
|
+
onResize: handleResize,
|
|
2824
|
+
size: { width: slideOutWidth, height: "100%" },
|
|
2825
|
+
style: {
|
|
2826
|
+
position,
|
|
2827
|
+
"--slide-out-width": `${slideOutWidth}${typeof slideOutWidth === "number" ? "px" : ""}`
|
|
2828
|
+
},
|
|
2829
|
+
minWidth,
|
|
2830
|
+
maxWidth,
|
|
2831
|
+
enable: { left: resizeable && !isLeft, right: resizeable && isLeft },
|
|
2832
|
+
children
|
|
2833
|
+
}
|
|
2834
|
+
)
|
|
2835
|
+
}
|
|
2836
|
+
)
|
|
2837
|
+
},
|
|
2838
|
+
modal ? "1" : "0"
|
|
2839
|
+
)
|
|
2840
|
+
}
|
|
2841
|
+
)
|
|
2842
|
+
);
|
|
2843
|
+
})
|
|
2844
|
+
);
|
|
2845
|
+
const Spinner = React.memo(() => {
|
|
2846
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "size-5 rounded-full border border-2 border-(--base-a12) border-b-transparent animate-spin" });
|
|
2847
|
+
});
|
|
2848
|
+
Spinner.displayName = "Spinner";
|
|
2849
|
+
const textAreaCva = classVarianceAuthority.cva(
|
|
2850
|
+
[
|
|
2851
|
+
"focus:ring-2",
|
|
2852
|
+
"focus:ring-(--accent-a8)",
|
|
2853
|
+
"disabled:opacity-50",
|
|
2854
|
+
"disabled:pointer-events-none",
|
|
2855
|
+
"transition-colors",
|
|
2856
|
+
"[scrollbar-width:thin]",
|
|
2857
|
+
"[scrollbar-color:var(--base-6)_transparent]",
|
|
2858
|
+
"outline-none"
|
|
2859
|
+
],
|
|
2860
|
+
{
|
|
2861
|
+
variants: {
|
|
2862
|
+
variant: {
|
|
2863
|
+
outline: [
|
|
2864
|
+
"placeholder-(--base-a9)",
|
|
2865
|
+
"selection:bg-(--accent-a5)",
|
|
2866
|
+
"ring-1",
|
|
2867
|
+
"ring-(--base-a7)",
|
|
2868
|
+
"bg-transparent",
|
|
2869
|
+
"text-(--base-12)"
|
|
2870
|
+
],
|
|
2871
|
+
surface: [
|
|
2872
|
+
"placeholder-(--accent-12)",
|
|
2873
|
+
"placeholder:opacity-60",
|
|
2874
|
+
"selection:bg-(--accent-a5)",
|
|
2875
|
+
"ring-1",
|
|
2876
|
+
"ring-(--accent-a7)",
|
|
2877
|
+
"bg-(--accent-surface)",
|
|
2878
|
+
"text-(--accent-a12)"
|
|
2879
|
+
],
|
|
2880
|
+
soft: [
|
|
2881
|
+
"bg-(--accent-a3)",
|
|
2882
|
+
"text-(--accent-12)",
|
|
2883
|
+
"placeholder-(--accent-12)",
|
|
2884
|
+
"placeholder:opacity-60",
|
|
2885
|
+
"selection:bg-(--accent-a5)"
|
|
2886
|
+
]
|
|
2887
|
+
},
|
|
2888
|
+
size: {
|
|
2889
|
+
xs: ["p-1", "text-xs"],
|
|
2890
|
+
sm: ["p-1.5", "text-sm"],
|
|
2891
|
+
md: ["p-2", "text-base"],
|
|
2892
|
+
lg: ["p-2.5", "text-lg"],
|
|
2893
|
+
xl: ["p-3", "text-xl"]
|
|
2894
|
+
},
|
|
2895
|
+
resize: {
|
|
2896
|
+
none: ["resize-none"],
|
|
2897
|
+
vertical: ["resize-y"],
|
|
2898
|
+
horizontal: ["resize-x"],
|
|
2899
|
+
both: ["resize"]
|
|
2900
|
+
}
|
|
2901
|
+
},
|
|
2902
|
+
defaultVariants: {
|
|
2903
|
+
variant: "outline",
|
|
2904
|
+
size: "md",
|
|
2905
|
+
resize: "none"
|
|
2906
|
+
}
|
|
2907
|
+
}
|
|
2908
|
+
);
|
|
2909
|
+
const TextArea = React.forwardRef((props, ref) => {
|
|
2910
|
+
const providerContext = useProvider();
|
|
2911
|
+
const {
|
|
2912
|
+
className,
|
|
2913
|
+
size,
|
|
2914
|
+
variant,
|
|
2915
|
+
radius = providerContext.radius,
|
|
2916
|
+
accentColor = providerContext.accentColor,
|
|
2917
|
+
...rest
|
|
2918
|
+
} = props;
|
|
2919
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2920
|
+
"textarea",
|
|
2921
|
+
{
|
|
2922
|
+
className: classVarianceAuthority.cx(className, textAreaCva({ size, variant }), radiusCva({ radius, maxLarge: true })),
|
|
2923
|
+
ref,
|
|
2924
|
+
"data-accent-color": accentColor,
|
|
2925
|
+
...rest
|
|
2926
|
+
}
|
|
2927
|
+
);
|
|
2928
|
+
});
|
|
2929
|
+
TextArea.displayName = "TextArea";
|
|
2930
|
+
const toastCva = classVarianceAuthority.cva(
|
|
2931
|
+
[
|
|
2932
|
+
"shadow-md",
|
|
2933
|
+
"duration-200",
|
|
2934
|
+
"data-[state='open']:animate-in",
|
|
2935
|
+
"data-[state='open']:fade-in-0",
|
|
2936
|
+
"data-[state='open']:zoom-in-95",
|
|
2937
|
+
"data-[state='closed']:animate-out",
|
|
2938
|
+
"data-[state='closed']:fade-out-0",
|
|
2939
|
+
"data-[state='closed']:zoom-out-95"
|
|
2940
|
+
],
|
|
2941
|
+
{
|
|
2942
|
+
variants: {
|
|
2943
|
+
variant: {
|
|
2944
|
+
surface: ["bg-(--accent-1)", "text-(--accent-11)", "ring-1", "ring-inset", "ring-(--accent-a6)"],
|
|
2945
|
+
soft: ["bg-(--accent-1)", "text-(--accent-11)"]
|
|
2946
|
+
},
|
|
2947
|
+
size: {
|
|
2948
|
+
xs: ["text-xs", "p-2"],
|
|
2949
|
+
sm: ["text-sm", "p-3"],
|
|
2950
|
+
md: ["text-base", "p-4"],
|
|
2951
|
+
lg: ["text-lg", "p-5"],
|
|
2952
|
+
xl: ["text-xl", "p-6"]
|
|
2953
|
+
}
|
|
2954
|
+
},
|
|
2955
|
+
defaultVariants: {
|
|
2956
|
+
variant: "surface",
|
|
2957
|
+
size: "md"
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
);
|
|
2961
|
+
const _Toast = React.forwardRef(function Toast2(props, ref) {
|
|
2962
|
+
const { radius, ...restProviderContext } = useProvider();
|
|
2963
|
+
const {
|
|
2964
|
+
title,
|
|
2965
|
+
description,
|
|
2966
|
+
icon,
|
|
2967
|
+
size = "md",
|
|
2968
|
+
accentColor = restProviderContext.accentColor,
|
|
2969
|
+
variant,
|
|
2970
|
+
onClose,
|
|
2971
|
+
sensitivity,
|
|
2972
|
+
action,
|
|
2973
|
+
...rest
|
|
2974
|
+
} = props;
|
|
2975
|
+
const [open, setOpen] = React.useState(true);
|
|
2976
|
+
const handleOpenChange = React.useCallback(
|
|
2977
|
+
(open2) => {
|
|
2978
|
+
if (!open2 && onClose) onClose();
|
|
2979
|
+
setOpen(open2);
|
|
2980
|
+
},
|
|
2981
|
+
[onClose]
|
|
2982
|
+
);
|
|
2983
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2984
|
+
RadixToast__namespace.Root,
|
|
2985
|
+
{
|
|
2986
|
+
className: classVarianceAuthority.cx(
|
|
2987
|
+
"flex items-center gap-4 w-max",
|
|
2988
|
+
toastCva({ size, variant }),
|
|
2989
|
+
radiusCva({ radius, maxLarge: true })
|
|
2990
|
+
),
|
|
2991
|
+
ref,
|
|
2992
|
+
open,
|
|
2993
|
+
type: sensitivity,
|
|
2994
|
+
onOpenChange: handleOpenChange,
|
|
2995
|
+
"data-accent-color": accentColor,
|
|
2996
|
+
...rest,
|
|
2997
|
+
children: [
|
|
2998
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 grow", children: [
|
|
2999
|
+
icon,
|
|
3000
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
3001
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
|
|
3002
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Title, { className: "font-medium", children: title }),
|
|
3003
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Description, { children: description })
|
|
3004
|
+
] }),
|
|
3005
|
+
action && /* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Action, { className: "w-max", altText: action.altText, asChild: true, children: action.content })
|
|
3006
|
+
] })
|
|
3007
|
+
] }),
|
|
3008
|
+
/* @__PURE__ */ jsxRuntime.jsx(RadixToast__namespace.Close, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(IconButton, { size, "aria-label": "Close", variant: "ghost", accentColor, children: /* @__PURE__ */ jsxRuntime.jsx(hi.HiX, {}) }) })
|
|
3009
|
+
]
|
|
3010
|
+
}
|
|
3011
|
+
);
|
|
3012
|
+
});
|
|
3013
|
+
const Toast = React.memo(_Toast);
|
|
3014
|
+
const ToastContext = React.createContext({});
|
|
3015
|
+
const useToast = () => {
|
|
3016
|
+
const context = React.useContext(ToastContext);
|
|
3017
|
+
if (!context) {
|
|
3018
|
+
throw new Error("useToast must be used within a ToastProvider");
|
|
3019
|
+
}
|
|
3020
|
+
return context;
|
|
3021
|
+
};
|
|
3022
|
+
const WORDS_PER_SECOND = 240 / 60;
|
|
3023
|
+
const MIN_DURATION = 5e3;
|
|
3024
|
+
const calculatedDuration = (toast) => {
|
|
3025
|
+
if (toast.duration && toast.duration >= MIN_DURATION) return toast.duration;
|
|
3026
|
+
const words = toast.description.split(" ").length + toast.title.split(" ").length;
|
|
3027
|
+
return MIN_DURATION + words / WORDS_PER_SECOND;
|
|
3028
|
+
};
|
|
3029
|
+
exports2.unsafeShowToast = void 0;
|
|
3030
|
+
const ToastProvider = React.memo(function ToastContextProvider({
|
|
3031
|
+
children,
|
|
3032
|
+
// Use this class to change where the viewport for the toasts should be
|
|
3033
|
+
className,
|
|
3034
|
+
hotkey,
|
|
3035
|
+
...rest
|
|
3036
|
+
}) {
|
|
3037
|
+
const [toasts, setToasts] = React.useState([]);
|
|
3038
|
+
const handleCloseToast = React.useCallback((id, reason, callback) => {
|
|
3039
|
+
setToasts((prevToasts) => {
|
|
3040
|
+
const toast = prevToasts.find((toast2) => toast2.id === id);
|
|
3041
|
+
if (toast && reason === 0) clearTimeout(toast.timeout);
|
|
3042
|
+
return prevToasts.filter((toast2) => toast2.id !== id);
|
|
3043
|
+
});
|
|
3044
|
+
if (callback) callback();
|
|
3045
|
+
}, []);
|
|
3046
|
+
const toastContextValue = React.useMemo(() => {
|
|
3047
|
+
let counter = 0;
|
|
3048
|
+
const showToast = (toastProps) => {
|
|
3049
|
+
const duration = calculatedDuration(toastProps);
|
|
3050
|
+
const id = counter.toString();
|
|
3051
|
+
counter += 1;
|
|
3052
|
+
const pending = setTimeout(() => handleCloseToast(id, 1, toastProps.onClose), duration);
|
|
3053
|
+
setToasts((prevToasts) => [...prevToasts, { ...toastProps, timeout: pending, duration, id }]);
|
|
3054
|
+
};
|
|
3055
|
+
const showPrimary = (toastProps) => showToast(toastProps);
|
|
3056
|
+
const showSuccess = (toastProps) => showToast({ ...toastProps, accentColor: "success" });
|
|
3057
|
+
const showError = (toastProps) => showToast({ ...toastProps, accentColor: "danger" });
|
|
3058
|
+
const showInfo = (toastProps) => showToast({ ...toastProps, accentColor: "base" });
|
|
3059
|
+
const showWarning = (toastProps) => showToast({ ...toastProps, accentColor: "warning" });
|
|
3060
|
+
exports2.unsafeShowToast = showToast;
|
|
3061
|
+
return {
|
|
3062
|
+
showToast,
|
|
3063
|
+
showPrimary,
|
|
3064
|
+
showSuccess,
|
|
3065
|
+
showError,
|
|
3066
|
+
showInfo,
|
|
3067
|
+
showWarning
|
|
3068
|
+
};
|
|
3069
|
+
}, [handleCloseToast]);
|
|
3070
|
+
React.useEffect(() => {
|
|
3071
|
+
return () => {
|
|
3072
|
+
for (const { timeout } of toasts) clearTimeout(timeout);
|
|
3073
|
+
};
|
|
3074
|
+
}, []);
|
|
3075
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ToastContext.Provider, { value: toastContextValue, children: /* @__PURE__ */ jsxRuntime.jsxs(RadixToast.ToastProvider, { ...rest, children: [
|
|
3076
|
+
children,
|
|
3077
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3078
|
+
RadixToast.ToastViewport,
|
|
3079
|
+
{
|
|
3080
|
+
className: classVarianceAuthority.cx(
|
|
3081
|
+
className,
|
|
3082
|
+
"list-none fixed top-0 right-0 flex gap-3 flex-col items-end p-5 max-w-[100vw] z-[2147483647] outline-none overflow-y-auto overflow-x-hidden"
|
|
3083
|
+
),
|
|
3084
|
+
hotkey
|
|
3085
|
+
}
|
|
3086
|
+
),
|
|
3087
|
+
toasts.map(({ id, onClose, ...toastProps }) => /* @__PURE__ */ jsxRuntime.jsx(Toast, { ...toastProps, onClose: () => handleCloseToast(id, 0, onClose) }, id))
|
|
3088
|
+
] }) });
|
|
3089
|
+
});
|
|
3090
|
+
const toggleButtonCva = classVarianceAuthority.cva(
|
|
3091
|
+
[
|
|
3092
|
+
"flex",
|
|
3093
|
+
"items-center",
|
|
3094
|
+
"justify-center",
|
|
3095
|
+
"outline-none",
|
|
3096
|
+
"transition-colors",
|
|
3097
|
+
"disabled:opacity-50",
|
|
3098
|
+
"disabled:pointer-events-none"
|
|
3099
|
+
],
|
|
3100
|
+
{
|
|
3101
|
+
variants: {
|
|
3102
|
+
variant: {
|
|
3103
|
+
outline: [
|
|
3104
|
+
"ring-1",
|
|
3105
|
+
"ring-inset",
|
|
3106
|
+
"ring-(--accent-a4)",
|
|
3107
|
+
"text-(--accent-a11)",
|
|
3108
|
+
"data-[state=off]:hover:bg-(--accent-a3)",
|
|
3109
|
+
"data-[state=off]:hover:ring-transparent",
|
|
3110
|
+
"data-[state=on]:bg-(--accent-a4)",
|
|
3111
|
+
"data-[state=on]:ring-transparent",
|
|
3112
|
+
"data-[state=on]:text-(--accent-a12)"
|
|
3113
|
+
],
|
|
3114
|
+
ghost: [
|
|
3115
|
+
"text-(--accent-a11)",
|
|
3116
|
+
"data-[state=off]:hover:bg-(--accent-a3)",
|
|
3117
|
+
"data-[state=on]:bg-(--accent-a4)",
|
|
3118
|
+
"data-[state=on]:text-(--accent-a12)"
|
|
3119
|
+
]
|
|
3120
|
+
},
|
|
3121
|
+
icon: {
|
|
3122
|
+
true: [],
|
|
3123
|
+
false: []
|
|
3124
|
+
},
|
|
3125
|
+
size: {
|
|
3126
|
+
xs: ["h-5", "text-xs", "gap-0.25"],
|
|
3127
|
+
sm: ["h-6", "text-sm", "gap-0.5"],
|
|
3128
|
+
md: ["h-7", "text-base", "gap-1"],
|
|
3129
|
+
lg: ["h-8", "text-lg", "gap-1.5"],
|
|
3130
|
+
xl: ["h-9", "text-xl", "gap-2"]
|
|
3131
|
+
}
|
|
3132
|
+
},
|
|
3133
|
+
compoundVariants: [
|
|
3134
|
+
{
|
|
3135
|
+
icon: true,
|
|
3136
|
+
size: "xs",
|
|
3137
|
+
class: "w-5"
|
|
3138
|
+
},
|
|
3139
|
+
{
|
|
3140
|
+
icon: false,
|
|
3141
|
+
size: "xs",
|
|
3142
|
+
class: "px-2"
|
|
3143
|
+
},
|
|
3144
|
+
{
|
|
3145
|
+
icon: true,
|
|
3146
|
+
size: "sm",
|
|
3147
|
+
class: "w-6"
|
|
3148
|
+
},
|
|
3149
|
+
{
|
|
3150
|
+
icon: false,
|
|
3151
|
+
size: "sm",
|
|
3152
|
+
class: "px-2"
|
|
3153
|
+
},
|
|
3154
|
+
{
|
|
3155
|
+
icon: true,
|
|
3156
|
+
size: "md",
|
|
3157
|
+
class: "w-7"
|
|
3158
|
+
},
|
|
3159
|
+
{
|
|
3160
|
+
icon: false,
|
|
3161
|
+
size: "md",
|
|
3162
|
+
class: "px-3"
|
|
3163
|
+
},
|
|
3164
|
+
{
|
|
3165
|
+
icon: true,
|
|
3166
|
+
size: "lg",
|
|
3167
|
+
class: "w-8"
|
|
3168
|
+
},
|
|
3169
|
+
{
|
|
3170
|
+
icon: false,
|
|
3171
|
+
size: "lg",
|
|
3172
|
+
class: "px-4"
|
|
3173
|
+
},
|
|
3174
|
+
{
|
|
3175
|
+
icon: true,
|
|
3176
|
+
size: "xl",
|
|
3177
|
+
class: "w-9"
|
|
3178
|
+
},
|
|
3179
|
+
{
|
|
3180
|
+
icon: false,
|
|
3181
|
+
size: "xl",
|
|
3182
|
+
class: "px-5"
|
|
3183
|
+
}
|
|
3184
|
+
],
|
|
3185
|
+
defaultVariants: {
|
|
3186
|
+
size: "md",
|
|
3187
|
+
icon: false,
|
|
3188
|
+
variant: "outline"
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
);
|
|
3192
|
+
const BaseToggleButton = React.forwardRef((props, ref) => {
|
|
3193
|
+
const providerContext = useProvider();
|
|
3194
|
+
const {
|
|
3195
|
+
className,
|
|
3196
|
+
size,
|
|
3197
|
+
icon,
|
|
3198
|
+
variant,
|
|
3199
|
+
radius = providerContext.radius,
|
|
3200
|
+
accentColor = providerContext.accentColor,
|
|
3201
|
+
...rest
|
|
3202
|
+
} = props;
|
|
3203
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3204
|
+
Toggle__namespace.Root,
|
|
3205
|
+
{
|
|
3206
|
+
ref,
|
|
3207
|
+
className: classVarianceAuthority.cx(className, toggleButtonCva({ size, variant, icon }), radiusCva({ radius, maxLarge: false })),
|
|
3208
|
+
"data-accent-color": accentColor,
|
|
3209
|
+
...rest
|
|
3210
|
+
}
|
|
3211
|
+
);
|
|
3212
|
+
});
|
|
3213
|
+
BaseToggleButton.displayName = "BaseToggleButton";
|
|
3214
|
+
const IconToggleButton = React.forwardRef((props, ref) => {
|
|
3215
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BaseToggleButton, { ref, icon: true, ...props });
|
|
3216
|
+
});
|
|
3217
|
+
IconToggleButton.displayName = "IconToggleButton";
|
|
3218
|
+
const ToggleButton = React.forwardRef((props, ref) => {
|
|
3219
|
+
return /* @__PURE__ */ jsxRuntime.jsx(BaseToggleButton, { ref, icon: false, ...props });
|
|
3220
|
+
});
|
|
3221
|
+
ToggleButton.displayName = "ToggleButton";
|
|
3222
|
+
const TooltipArrow = React.forwardRef((props, ref) => {
|
|
3223
|
+
const { className, ...rest } = props;
|
|
3224
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Arrow, { className: classVarianceAuthority.cx(className, "fill-(--base-6)"), ref, ...rest });
|
|
3225
|
+
});
|
|
3226
|
+
TooltipArrow.displayName = "TooltipArrow";
|
|
3227
|
+
const tooltipContent = classVarianceAuthority.cva(
|
|
3228
|
+
[
|
|
3229
|
+
"data-[state=delayed-open]:animate-in",
|
|
3230
|
+
"data-[state=delayed-open]:fade-in-0",
|
|
3231
|
+
"data-[state=delayed-open]:zoom-in-95",
|
|
3232
|
+
"data-[state=closed]:animate-out",
|
|
3233
|
+
"data-[state=closed]:fade-out-0",
|
|
3234
|
+
"data-[state=closed]:zoom-out-95",
|
|
3235
|
+
"bg-(--base-1)",
|
|
3236
|
+
"ring-1",
|
|
3237
|
+
"ring-inset",
|
|
3238
|
+
"ring-(--base-a6)",
|
|
3239
|
+
"text-(--base-12)",
|
|
3240
|
+
"shadow-sm"
|
|
3241
|
+
],
|
|
3242
|
+
{
|
|
3243
|
+
variants: {
|
|
3244
|
+
size: {
|
|
3245
|
+
xs: ["text-xs", "px-2"],
|
|
3246
|
+
sm: ["text-sm", "px-3"],
|
|
3247
|
+
md: ["text-base", "px-4"],
|
|
3248
|
+
lg: ["text-lg", "px-5"],
|
|
3249
|
+
xl: ["text-xl", "px-6"]
|
|
3250
|
+
},
|
|
3251
|
+
side: {
|
|
3252
|
+
top: ["data-[side=top]:slide-in-from-bottom-1"],
|
|
3253
|
+
right: ["data-[side=right]:slide-in-from-left-1"],
|
|
3254
|
+
bottom: ["data-[side=bottom]:slide-in-from-top-1"],
|
|
3255
|
+
left: ["data-[side=left]:slide-in-from-right-1"]
|
|
3256
|
+
}
|
|
3257
|
+
},
|
|
3258
|
+
defaultVariants: {
|
|
3259
|
+
size: "md",
|
|
3260
|
+
side: "top"
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
);
|
|
3264
|
+
const TooltipContent = React.forwardRef((props, ref) => {
|
|
3265
|
+
const providerContext = useProvider();
|
|
3266
|
+
const {
|
|
3267
|
+
className,
|
|
3268
|
+
side = "top",
|
|
3269
|
+
size,
|
|
3270
|
+
radius = providerContext.radius,
|
|
3271
|
+
children,
|
|
3272
|
+
sideOffset = 2,
|
|
3273
|
+
container,
|
|
3274
|
+
...rest
|
|
3275
|
+
} = props;
|
|
3276
|
+
return /* @__PURE__ */ jsxRuntime.jsx(RadixTooltip__namespace.Portal, { container, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3277
|
+
RadixTooltip__namespace.Content,
|
|
3278
|
+
{
|
|
3279
|
+
className: classVarianceAuthority.cx(className, tooltipContent({ size, side }), radiusCva({ radius, maxLarge: false })),
|
|
3280
|
+
ref,
|
|
3281
|
+
sideOffset,
|
|
3282
|
+
...rest,
|
|
3283
|
+
children
|
|
3284
|
+
}
|
|
3285
|
+
) });
|
|
3286
|
+
});
|
|
3287
|
+
TooltipContent.displayName = "TooltipContent";
|
|
3288
|
+
const Tooltip = {
|
|
3289
|
+
Arrow: TooltipArrow,
|
|
3290
|
+
Content: TooltipContent,
|
|
3291
|
+
Root: RadixTooltip__namespace.Root,
|
|
3292
|
+
Trigger: RadixTooltip__namespace.Trigger,
|
|
3293
|
+
Provider: RadixTooltip__namespace.Provider
|
|
3294
|
+
};
|
|
3295
|
+
exports2.AlertDialog = AlertDialog;
|
|
3296
|
+
exports2.AlertDialogContent = AlertDialogContent;
|
|
3297
|
+
exports2.AlertDialogProvider = AlertDialogProvider;
|
|
3298
|
+
exports2.Avatar = Avatar;
|
|
3299
|
+
exports2.AvatarFallback = AvatarFallback;
|
|
3300
|
+
exports2.AvatarImage = AvatarImage;
|
|
3301
|
+
exports2.AvatarRoot = AvatarRoot;
|
|
3302
|
+
exports2.Badge = Badge;
|
|
3303
|
+
exports2.Button = Button;
|
|
3304
|
+
exports2.ButtonGroup = ButtonGroup;
|
|
3305
|
+
exports2.Checkbox = Checkbox;
|
|
3306
|
+
exports2.CheckboxIndicator = CheckboxIndicator;
|
|
3307
|
+
exports2.CheckboxRoot = CheckboxRoot;
|
|
3308
|
+
exports2.CollapsibleTree = CollapsibleTree;
|
|
3309
|
+
exports2.Dialog = Dialog;
|
|
3310
|
+
exports2.DialogContent = DialogContent;
|
|
3311
|
+
exports2.DialogRoot = DialogRoot;
|
|
3312
|
+
exports2.HoverCard = HoverCard;
|
|
3313
|
+
exports2.HoverCardArrow = HoverCardArrow;
|
|
3314
|
+
exports2.HoverCardContent = HoverCardContent;
|
|
3315
|
+
exports2.HoverUtility = HoverUtility;
|
|
3316
|
+
exports2.IconButton = IconButton;
|
|
3317
|
+
exports2.IconToggleButton = IconToggleButton;
|
|
3318
|
+
exports2.Input = Input;
|
|
3319
|
+
exports2.InputField = InputField;
|
|
3320
|
+
exports2.InputRoot = InputRoot;
|
|
3321
|
+
exports2.InputSlot = InputSlot;
|
|
3322
|
+
exports2.Layout = Layout;
|
|
3323
|
+
exports2.LayoutContext = LayoutContext;
|
|
3324
|
+
exports2.OvermapErrorBoundary = OvermapErrorBoundary;
|
|
3325
|
+
exports2.OvermapMenu = OvermapMenu;
|
|
3326
|
+
exports2.Popover = Popover;
|
|
3327
|
+
exports2.Provider = Provider;
|
|
3328
|
+
exports2.RadioGroup = RadioGroup;
|
|
3329
|
+
exports2.RadioGroupIndicator = RadioGroupIndicator;
|
|
3330
|
+
exports2.RadioGroupItem = RadioGroupItem;
|
|
3331
|
+
exports2.RadioGroupRoot = RadioGroupRoot;
|
|
3332
|
+
exports2.RiIcon = RiIcon;
|
|
3333
|
+
exports2.Separator = Separator;
|
|
3334
|
+
exports2.SlideOutV2 = SlideOutV2;
|
|
3335
|
+
exports2.SlideOutV3 = SlideOutV3;
|
|
3336
|
+
exports2.Spinner = Spinner;
|
|
3337
|
+
exports2.TextArea = TextArea;
|
|
3338
|
+
exports2.Toast = Toast;
|
|
3339
|
+
exports2.ToastContext = ToastContext;
|
|
3340
|
+
exports2.ToastProvider = ToastProvider;
|
|
3341
|
+
exports2.ToggleButton = ToggleButton;
|
|
3342
|
+
exports2.Tooltip = Tooltip;
|
|
3343
|
+
exports2.TooltipArrow = TooltipArrow;
|
|
3344
|
+
exports2.TooltipContent = TooltipContent;
|
|
3345
|
+
exports2.badge = badge;
|
|
3346
|
+
exports2.button = button;
|
|
3347
|
+
exports2.splitTextForEllipsisAndExpansion = splitTextForEllipsisAndExpansion;
|
|
3348
|
+
exports2.useAlertDialog = useAlertDialog;
|
|
3349
|
+
exports2.useButtonGroup = useButtonGroup;
|
|
3350
|
+
exports2.useLayoutContext = useLayoutContext;
|
|
3351
|
+
exports2.useProvider = useProvider;
|
|
3352
|
+
exports2.useSize = useSize;
|
|
3353
|
+
exports2.useStopEventPropagation = useStopEventPropagation;
|
|
3354
|
+
exports2.useTextFilter = useTextFilter;
|
|
3355
|
+
exports2.useToast = useToast;
|
|
3356
|
+
exports2.useViewportSize = useViewportSize;
|
|
3357
|
+
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
3358
|
+
});
|
|
20
3359
|
//# sourceMappingURL=blocks.umd.cjs.map
|