@lobehub/ui 4.12.2 → 4.13.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/es/Accordion/Accordion.d.mts +2 -2
- package/es/Accordion/AccordionItem.d.mts +2 -2
- package/es/ActionIcon/ActionIcon.d.mts +2 -2
- package/es/Alert/Alert.d.mts +2 -2
- package/es/AutoComplete/Select.d.mts +2 -2
- package/es/Avatar/AvatarGroup/index.d.mts +2 -2
- package/es/Burger/Burger.d.mts +2 -2
- package/es/CodeEditor/CodeEditor.d.mts +2 -2
- package/es/Collapse/Collapse.d.mts +2 -2
- package/es/ConfigProvider/index.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.d.mts +2 -2
- package/es/ContextMenu/ContextMenuHost.mjs +1 -1
- package/es/CopyButton/CopyButton.d.mts +2 -2
- package/es/DatePicker/DatePicker.d.mts +2 -2
- package/es/DraggablePanel/DraggablePanel.mjs +1 -1
- package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
- package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
- package/es/DraggableSideNav/DraggableSideNav.mjs +1 -1
- package/es/Drawer/Drawer.d.mts +2 -2
- package/es/Dropdown/Dropdown.d.mts +2 -2
- package/es/DropdownMenu/DropdownMenu.d.mts +2 -2
- package/es/DropdownMenu/DropdownMenu.mjs +3 -3
- package/es/EditableText/EditableText.d.mts +2 -2
- package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
- package/es/Flex/FlexBasic.d.mts +2 -2
- package/es/FontLoader/index.d.mts +2 -2
- package/es/Footer/Footer.d.mts +2 -2
- package/es/Form/components/FormGroup.d.mts +2 -2
- package/es/Form/components/FormItem.d.mts +2 -2
- package/es/Form/components/FormSubmitFooter.d.mts +2 -2
- package/es/FormModal/FormModal.d.mts +2 -2
- package/es/Header/Header.d.mts +2 -2
- package/es/Highlighter/Highlighter.d.mts +2 -2
- package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
- package/es/Hotkey/Hotkey.d.mts +2 -2
- package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
- package/es/Icon/Icon.d.mts +2 -2
- package/es/Icon/components/IconProvider.d.mts +3 -3
- package/es/Image/PreviewGroup.d.mts +2 -2
- package/es/ImageSelect/ImageSelect.d.mts +2 -2
- package/es/Input/Input.d.mts +2 -2
- package/es/Input/InputNumber.d.mts +2 -2
- package/es/Layout/components/LayoutFooter.d.mts +2 -2
- package/es/Layout/components/LayoutHeader.d.mts +2 -2
- package/es/Layout/components/LayoutMain.d.mts +2 -2
- package/es/Layout/components/LayoutSidebar.d.mts +2 -2
- package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
- package/es/Layout/components/LayoutToc.d.mts +2 -2
- package/es/List/ListItem/index.d.mts +2 -2
- package/es/Markdown/Markdown.d.mts +2 -2
- package/es/Markdown/Typography.d.mts +2 -2
- package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
- package/es/MaskShadow/MaskShadow.d.mts +2 -2
- package/es/Menu/Menu.d.mts +2 -2
- package/es/Mermaid/Mermaid.d.mts +2 -2
- package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
- package/es/Modal/Modal.d.mts +2 -2
- package/es/Modal/ModalProvider.d.mts +2 -2
- package/es/MotionProvider/index.d.mts +2 -2
- package/es/Popover/Popover.mjs +1 -1
- package/es/Popover/Popover.mjs.map +1 -1
- package/es/Popover/PopoverGroup.mjs +6 -2
- package/es/Popover/PopoverGroup.mjs.map +1 -1
- package/es/Popover/PopoverInGroup.mjs +1 -1
- package/es/Popover/PopoverPortal.mjs +1 -1
- package/es/Popover/PopoverPortal.mjs.map +1 -1
- package/es/Popover/PopoverStandalone.mjs +2 -2
- package/es/Popover/context.d.mts +2 -2
- package/es/Popover/context.mjs +3 -1
- package/es/Popover/context.mjs.map +1 -1
- package/es/Popover/type.d.mts +4 -0
- package/es/SearchBar/SearchBar.d.mts +2 -2
- package/es/Segmented/Segmented.d.mts +2 -2
- package/es/Select/Select.d.mts +2 -2
- package/es/SideNav/SideNav.d.mts +2 -2
- package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
- package/es/SortableList/components/DragHandle.d.mts +2 -2
- package/es/SortableList/components/SortableItem.d.mts +2 -2
- package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Tooltip/ArrowIcon.mjs +22 -0
- package/es/Tooltip/ArrowIcon.mjs.map +1 -0
- package/es/Tooltip/Tooltip.mjs +3 -3
- package/es/Tooltip/Tooltip.mjs.map +1 -1
- package/es/Tooltip/TooltipContent.mjs +24 -0
- package/es/Tooltip/TooltipContent.mjs.map +1 -0
- package/es/Tooltip/TooltipGroup.d.mts +2 -5
- package/es/Tooltip/TooltipGroup.mjs +90 -178
- package/es/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipInGroup.mjs +54 -52
- package/es/Tooltip/TooltipInGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipPortal.mjs +4 -7
- package/es/Tooltip/TooltipPortal.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +149 -83
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/Tooltip/groupContext.mjs +4 -2
- package/es/Tooltip/groupContext.mjs.map +1 -1
- package/es/Tooltip/index.d.mts +1 -1
- package/es/Tooltip/style.mjs +203 -32
- package/es/Tooltip/style.mjs.map +1 -1
- package/es/Tooltip/type.d.mts +30 -3
- package/es/Tooltip/useMergedTooltipProps.mjs +17 -6
- package/es/Tooltip/useMergedTooltipProps.mjs.map +1 -1
- package/es/Video/index.d.mts +2 -2
- package/es/awesome/AuroraBackground/AuroraBackground.d.mts +2 -2
- package/es/awesome/BottomGradientButton/BottomGradientButton.d.mts +2 -2
- package/es/awesome/Features/Features.d.mts +2 -2
- package/es/awesome/Giscus/Giscus.d.mts +2 -2
- package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
- package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
- package/es/awesome/GridBackground/GridBackground.mjs +1 -1
- package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
- package/es/awesome/Spotlight/Spotlight.d.mts +2 -2
- package/es/awesome/SpotlightCard/SpotlightCard.d.mts +2 -2
- package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
- package/es/brand/LobeChat/index.d.mts +2 -2
- package/es/brand/LobeHub/index.d.mts +2 -2
- package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
- package/es/brand/LogoThree/index.d.mts +2 -2
- package/es/chat/BackBottom/BackBottom.d.mts +2 -2
- package/es/chat/BackBottom/BackBottom.mjs +1 -1
- package/es/chat/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
- package/es/chat/ChatList/ChatList.d.mts +2 -2
- package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
- package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
- package/es/chat/MessageInput/MessageInput.d.mts +2 -2
- package/es/chat/MessageModal/MessageModal.d.mts +2 -2
- package/es/color/ColorScales/index.d.mts +2 -2
- package/es/color/CssVar/index.d.mts +2 -2
- package/es/hooks/usePortalContainer.mjs +1 -1
- package/es/i18n/context.d.mts +2 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +2 -2
- package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +2 -2
- package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ProviderIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +2 -2
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- package/es/index.mjs +1 -1
- package/es/mdx/Mdx/index.d.mts +2 -2
- package/es/mobile/ChatInputArea/ChatInputArea.mjs +1 -1
- package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
- package/es/mobile/TabBar/TabBar.d.mts +2 -2
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/es/utils/placement.d.mts +1 -1
- package/package.json +1 -1
- package/es/Tooltip/TooltipFloating.mjs +0 -119
- package/es/Tooltip/TooltipFloating.mjs.map +0 -1
- package/es/Tooltip/groupContext.d.mts +0 -14
- package/es/Tooltip/useTooltipFloating.mjs +0 -55
- package/es/Tooltip/useTooltipFloating.mjs.map +0 -1
- package/es/Tooltip/useTooltipReference.mjs +0 -56
- package/es/Tooltip/useTooltipReference.mjs.map +0 -1
- package/es/Tooltip/useTooltipTrigger.mjs +0 -18
- package/es/Tooltip/useTooltipTrigger.mjs.map +0 -1
- package/es/Tooltip/utils.mjs +0 -36
- package/es/Tooltip/utils.mjs.map +0 -1
- package/es/utils/composeEventHandlers.mjs +0 -28
- package/es/utils/composeEventHandlers.mjs.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ListItemProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react69 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/List/ListItem/index.d.ts
|
|
5
|
-
declare const ListItem:
|
|
5
|
+
declare const ListItem: react69.NamedExoticComponent<ListItemProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ListItem };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MarkdownProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react2 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Markdown.d.ts
|
|
5
|
-
declare const Markdown:
|
|
5
|
+
declare const Markdown: react2.NamedExoticComponent<MarkdownProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Markdown };
|
|
8
8
|
//# sourceMappingURL=Markdown.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TypographyProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react1 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Typography.d.ts
|
|
5
|
-
declare const Typography:
|
|
5
|
+
declare const Typography: react1.NamedExoticComponent<TypographyProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Typography };
|
|
8
8
|
//# sourceMappingURL=Typography.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlexboxProps } from "../../../Flex/type.mjs";
|
|
2
2
|
import "../../../Flex/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react45 from "react";
|
|
4
4
|
import { Ref } from "react";
|
|
5
5
|
|
|
6
6
|
//#region src/Markdown/components/SearchResultCards/index.d.ts
|
|
@@ -14,7 +14,7 @@ interface SearchResultCardsProps extends FlexboxProps {
|
|
|
14
14
|
dataSource: string[] | SearchResultItem[];
|
|
15
15
|
ref?: Ref<HTMLDivElement>;
|
|
16
16
|
}
|
|
17
|
-
declare const SearchResultCards:
|
|
17
|
+
declare const SearchResultCards: react45.NamedExoticComponent<SearchResultCardsProps>;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { SearchResultCards, SearchResultCardsProps };
|
|
20
20
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MaskShadowProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react0 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/MaskShadow/MaskShadow.d.ts
|
|
5
|
-
declare const MaskShadow:
|
|
5
|
+
declare const MaskShadow: react0.NamedExoticComponent<MaskShadowProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { MaskShadow };
|
|
8
8
|
//# sourceMappingURL=MaskShadow.d.mts.map
|
package/es/Menu/Menu.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MenuProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react62 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Menu/Menu.d.ts
|
|
5
|
-
declare const Menu:
|
|
5
|
+
declare const Menu: react62.NamedExoticComponent<MenuProps<unknown>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Menu };
|
|
8
8
|
//# sourceMappingURL=Menu.d.mts.map
|
package/es/Mermaid/Mermaid.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MermaidProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react61 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/Mermaid.d.ts
|
|
5
|
-
declare const Mermaid:
|
|
5
|
+
declare const Mermaid: react61.NamedExoticComponent<MermaidProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Mermaid };
|
|
8
8
|
//# sourceMappingURL=Mermaid.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SyntaxMermaidProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react60 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/SyntaxMermaid/index.d.ts
|
|
5
|
-
declare const SyntaxMermaid:
|
|
5
|
+
declare const SyntaxMermaid: react60.NamedExoticComponent<SyntaxMermaidProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SyntaxMermaid };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
package/es/Modal/Modal.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ModalProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react63 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Modal/Modal.d.ts
|
|
5
|
-
declare const Modal:
|
|
5
|
+
declare const Modal: react63.NamedExoticComponent<ModalProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Modal };
|
|
8
8
|
//# sourceMappingURL=Modal.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ModalContextValue } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react64 from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/Modal/ModalProvider.d.ts
|
|
6
|
-
declare const ModalProvider:
|
|
6
|
+
declare const ModalProvider: react64.NamedExoticComponent<{
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
value: ModalContextValue;
|
|
9
9
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react46 from "react";
|
|
2
2
|
import { Context, ReactNode } from "react";
|
|
3
3
|
import * as motion_react0 from "motion/react";
|
|
4
4
|
import * as m from "motion/react-m";
|
|
@@ -6,7 +6,7 @@ import * as m from "motion/react-m";
|
|
|
6
6
|
//#region src/MotionProvider/index.d.ts
|
|
7
7
|
type MotionComponentType = typeof motion_react0.motion | typeof m;
|
|
8
8
|
declare const MotionComponent: Context<MotionComponentType>;
|
|
9
|
-
declare const MotionProvider:
|
|
9
|
+
declare const MotionProvider: react46.NamedExoticComponent<{
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
motion: MotionComponentType;
|
|
12
12
|
}>;
|
package/es/Popover/Popover.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
10
10
|
//#region src/Popover/Popover.tsx
|
|
11
11
|
const Popover = (props) => {
|
|
12
12
|
const group = useContext(PopoverGroupHandleContext);
|
|
13
|
-
return Boolean(group) && props.open === void 0 && props.defaultOpen === void 0 ? /* @__PURE__ */ jsx(PopoverInGroup, { ...props }) : /* @__PURE__ */ jsx(PopoverStandalone, { ...props });
|
|
13
|
+
return Boolean(group) && props.open === void 0 && props.defaultOpen === void 0 && !props.standalone ? /* @__PURE__ */ jsx(PopoverInGroup, { ...props }) : /* @__PURE__ */ jsx(PopoverStandalone, { ...props });
|
|
14
14
|
};
|
|
15
15
|
Popover.displayName = "Popover";
|
|
16
16
|
var Popover_default = Popover;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Popover.mjs","names":["Popover: FC<PopoverProps>"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useContext } from 'react';\n\nimport { PopoverInGroup } from './PopoverInGroup';\nimport { PopoverStandalone } from './PopoverStandalone';\nimport { PopoverGroupHandleContext } from './groupContext';\nimport type { PopoverProps } from './type';\n\nexport { parseTrigger } from './parseTrigger';\n\nconst Popover: FC<PopoverProps> = (props) => {\n const group = useContext(PopoverGroupHandleContext);\n\n // Group mode is driven by trigger interactions; keep standalone behavior for controlled cases.\n const canUseGroup
|
|
1
|
+
{"version":3,"file":"Popover.mjs","names":["Popover: FC<PopoverProps>"],"sources":["../../src/Popover/Popover.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useContext } from 'react';\n\nimport { PopoverInGroup } from './PopoverInGroup';\nimport { PopoverStandalone } from './PopoverStandalone';\nimport { PopoverGroupHandleContext } from './groupContext';\nimport type { PopoverProps } from './type';\n\nexport { parseTrigger } from './parseTrigger';\n\nconst Popover: FC<PopoverProps> = (props) => {\n const group = useContext(PopoverGroupHandleContext);\n\n // Group mode is driven by trigger interactions; keep standalone behavior for controlled cases.\n const canUseGroup =\n Boolean(group) &&\n props.open === undefined &&\n props.defaultOpen === undefined &&\n !props.standalone;\n\n return canUseGroup ? <PopoverInGroup {...props} /> : <PopoverStandalone {...props} />;\n};\n\nPopover.displayName = 'Popover';\n\nexport default Popover;\n"],"mappings":";;;;;;;;;;AAWA,MAAMA,WAA6B,UAAU;CAC3C,MAAM,QAAQ,WAAW,0BAA0B;AASnD,QALE,QAAQ,MAAM,IACd,MAAM,SAAS,UACf,MAAM,gBAAgB,UACtB,CAAC,MAAM,aAEY,oBAAC,kBAAe,GAAI,QAAS,GAAG,oBAAC,qBAAkB,GAAI,QAAS;;AAGvF,QAAQ,cAAc;AAEtB,sBAAe"}
|
|
@@ -7,7 +7,7 @@ import { parseTrigger } from "./parseTrigger.mjs";
|
|
|
7
7
|
import { PopoverArrowIcon } from "./ArrowIcon.mjs";
|
|
8
8
|
import { usePopoverPortalContainer } from "./PopoverPortal.mjs";
|
|
9
9
|
import { styles } from "./style.mjs";
|
|
10
|
-
import { useCallback, useMemo, useRef } from "react";
|
|
10
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { cx } from "antd-style";
|
|
13
13
|
import { Popover } from "@base-ui/react/popover";
|
|
@@ -23,6 +23,10 @@ const PopoverGroup = ({ children, contentLayoutAnimation = false, ...sharedProps
|
|
|
23
23
|
const handleOpenChange = useCallback((open) => {
|
|
24
24
|
activeItemRef.current?.onOpenChange?.(open);
|
|
25
25
|
}, []);
|
|
26
|
+
const [updateKey, setUpdateKey] = useState(0);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
setUpdateKey((prev) => prev + 1);
|
|
29
|
+
}, [handle]);
|
|
26
30
|
const portalContainer = usePopoverPortalContainer();
|
|
27
31
|
return /* @__PURE__ */ jsx(PopoverGroupHandleContext.Provider, {
|
|
28
32
|
value: handle,
|
|
@@ -93,7 +97,7 @@ const PopoverGroup = ({ children, contentLayoutAnimation = false, ...sharedProps
|
|
|
93
97
|
children: popup
|
|
94
98
|
}) : null : popup;
|
|
95
99
|
}
|
|
96
|
-
})]
|
|
100
|
+
}, updateKey)]
|
|
97
101
|
})
|
|
98
102
|
});
|
|
99
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverGroup.mjs","names":["PopoverGroup: FC<PopoverGroupProps>","BasePopover"],"sources":["../../src/Popover/PopoverGroup.tsx"],"sourcesContent":["'use client';\n\nimport { Popover as BasePopover } from '@base-ui/react/popover';\nimport type { Side } from '@base-ui/react/utils/useAnchorPositioning';\nimport { cx } from 'antd-style';\nimport { type FC, type ReactNode, useCallback, useMemo, useRef } from 'react';\n\nimport { placementMap } from '@/utils/placement';\n\nimport { PopoverArrowIcon } from './ArrowIcon';\nimport { usePopoverPortalContainer } from './PopoverPortal';\nimport { PopoverProvider } from './context';\nimport {\n PopoverGroupHandleContext,\n type PopoverGroupItem,\n PopoverGroupPropsContext,\n type PopoverGroupSharedProps,\n} from './groupContext';\nimport { parseTrigger } from './parseTrigger';\nimport { styles } from './style';\n\ntype PopoverGroupProps = PopoverGroupSharedProps & {\n children: ReactNode;\n};\n\nconst PopoverGroup: FC<PopoverGroupProps> = ({\n children,\n contentLayoutAnimation = false,\n ...sharedProps\n}) => {\n const handle = useMemo(() => BasePopover.createHandle<PopoverGroupItem>(), []);\n const activeItemRef = useRef<PopoverGroupItem | null>(null);\n const close = useCallback(() => {\n handle.close();\n }, [handle]);\n const contextValue = useMemo(() => ({ close }), [close]);\n\n const handleOpenChange = useCallback((open: boolean) => {\n activeItemRef.current?.onOpenChange?.(open);\n }, []);\n\n const portalContainer = usePopoverPortalContainer();\n\n return (\n <PopoverGroupHandleContext.Provider value={handle}>\n <PopoverGroupPropsContext.Provider value={sharedProps}>\n {children}\n <BasePopover.Root handle={handle} onOpenChange={handleOpenChange}>\n {({ payload }) => {\n const item = (payload as PopoverGroupItem | null) ?? null;\n activeItemRef.current = item;\n\n if (!item?.content) return null;\n\n const arrow = item.inset ? false : (item.arrow ?? false);\n const placement = item.placement ?? 'top';\n const { openOnHover } = parseTrigger(item.trigger ?? 'hover');\n\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 10 : 6;\n const resolvedSideOffset = item.inset\n ? ({\n side,\n positioner,\n }: {\n positioner: { height: number; width: number };\n side: Side;\n }) => {\n if (\n side === 'left' ||\n side === 'right' ||\n side === 'inline-start' ||\n side === 'inline-end'\n ) {\n return -positioner.width;\n }\n return -positioner.height;\n }\n : baseSideOffset;\n\n const resolvedClassNames = {\n arrow: cx(styles.arrow, item.classNames?.arrow),\n popup: cx(styles.popup, item.className),\n positioner: cx(styles.positioner, item.classNames?.root),\n viewport: cx(styles.viewport, item.classNames?.content),\n };\n\n const resolvedStyles = {\n arrow: item.styles?.arrow,\n positioner: {\n ...item.styles?.root,\n zIndex: item.zIndex ?? 1100,\n },\n viewport: item.styles?.content,\n };\n\n const contentNode = (\n <PopoverProvider value={contextValue}>{item.content}</PopoverProvider>\n );\n\n const popup = (\n <BasePopover.Positioner\n align={placementConfig.align}\n className={resolvedClassNames.positioner}\n data-hover-trigger={openOnHover || undefined}\n data-placement={placement}\n side={placementConfig.side}\n sideOffset={resolvedSideOffset}\n style={resolvedStyles.positioner}\n >\n <BasePopover.Popup className={resolvedClassNames.popup}>\n {arrow && (\n <BasePopover.Arrow\n className={resolvedClassNames.arrow}\n style={resolvedStyles.arrow}\n >\n {PopoverArrowIcon}\n </BasePopover.Arrow>\n )}\n {contentLayoutAnimation ? (\n <BasePopover.Viewport\n className={resolvedClassNames.viewport}\n style={resolvedStyles.viewport}\n >\n {contentNode}\n </BasePopover.Viewport>\n ) : (\n <div className={resolvedClassNames.viewport} style={resolvedStyles.viewport}>\n {contentNode}\n </div>\n )}\n </BasePopover.Popup>\n </BasePopover.Positioner>\n );\n\n const resolvedPortalContainer = portalContainer;\n const portalled = item.portalled ?? true;\n\n return portalled ? (\n resolvedPortalContainer ? (\n <BasePopover.Portal container={resolvedPortalContainer}>{popup}</BasePopover.Portal>\n ) : null\n ) : (\n popup\n );\n }}\n </BasePopover.Root>\n </PopoverGroupPropsContext.Provider>\n </PopoverGroupHandleContext.Provider>\n );\n};\n\nPopoverGroup.displayName = 'PopoverGroup';\n\nexport default PopoverGroup;\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAMA,gBAAuC,EAC3C,UACA,yBAAyB,OACzB,GAAG,kBACC;CACJ,MAAM,SAAS,cAAcC,QAAY,cAAgC,EAAE,EAAE,CAAC;CAC9E,MAAM,gBAAgB,OAAgC,KAAK;CAC3D,MAAM,QAAQ,kBAAkB;AAC9B,SAAO,OAAO;IACb,CAAC,OAAO,CAAC;CACZ,MAAM,eAAe,eAAe,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC;CAExD,MAAM,mBAAmB,aAAa,SAAkB;AACtD,gBAAc,SAAS,eAAe,KAAK;IAC1C,EAAE,CAAC;CAEN,MAAM,kBAAkB,2BAA2B;AAEnD,QACE,oBAAC,0BAA0B;EAAS,OAAO;YACzC,qBAAC,yBAAyB;GAAS,OAAO;cACvC,UACD,oBAACA,QAAY;IAAa;
|
|
1
|
+
{"version":3,"file":"PopoverGroup.mjs","names":["PopoverGroup: FC<PopoverGroupProps>","BasePopover"],"sources":["../../src/Popover/PopoverGroup.tsx"],"sourcesContent":["'use client';\n\nimport { Popover as BasePopover } from '@base-ui/react/popover';\nimport type { Side } from '@base-ui/react/utils/useAnchorPositioning';\nimport { cx } from 'antd-style';\nimport { type FC, type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { placementMap } from '@/utils/placement';\n\nimport { PopoverArrowIcon } from './ArrowIcon';\nimport { usePopoverPortalContainer } from './PopoverPortal';\nimport { PopoverProvider } from './context';\nimport {\n PopoverGroupHandleContext,\n type PopoverGroupItem,\n PopoverGroupPropsContext,\n type PopoverGroupSharedProps,\n} from './groupContext';\nimport { parseTrigger } from './parseTrigger';\nimport { styles } from './style';\n\ntype PopoverGroupProps = PopoverGroupSharedProps & {\n children: ReactNode;\n};\n\nconst PopoverGroup: FC<PopoverGroupProps> = ({\n children,\n contentLayoutAnimation = false,\n ...sharedProps\n}) => {\n const handle = useMemo(() => BasePopover.createHandle<PopoverGroupItem>(), []);\n const activeItemRef = useRef<PopoverGroupItem | null>(null);\n const close = useCallback(() => {\n handle.close();\n }, [handle]);\n const contextValue = useMemo(() => ({ close }), [close]);\n\n const handleOpenChange = useCallback((open: boolean) => {\n activeItemRef.current?.onOpenChange?.(open);\n }, []);\n\n const [updateKey, setUpdateKey] = useState(0);\n useEffect(() => {\n setUpdateKey((prev) => prev + 1);\n }, [handle]);\n\n const portalContainer = usePopoverPortalContainer();\n\n return (\n <PopoverGroupHandleContext.Provider value={handle}>\n <PopoverGroupPropsContext.Provider value={sharedProps}>\n {children}\n <BasePopover.Root handle={handle} key={updateKey} onOpenChange={handleOpenChange}>\n {({ payload }) => {\n const item = (payload as PopoverGroupItem | null) ?? null;\n activeItemRef.current = item;\n\n if (!item?.content) return null;\n\n const arrow = item.inset ? false : (item.arrow ?? false);\n const placement = item.placement ?? 'top';\n const { openOnHover } = parseTrigger(item.trigger ?? 'hover');\n\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 10 : 6;\n const resolvedSideOffset = item.inset\n ? ({\n side,\n positioner,\n }: {\n positioner: { height: number; width: number };\n side: Side;\n }) => {\n if (\n side === 'left' ||\n side === 'right' ||\n side === 'inline-start' ||\n side === 'inline-end'\n ) {\n return -positioner.width;\n }\n return -positioner.height;\n }\n : baseSideOffset;\n\n const resolvedClassNames = {\n arrow: cx(styles.arrow, item.classNames?.arrow),\n popup: cx(styles.popup, item.className),\n positioner: cx(styles.positioner, item.classNames?.root),\n viewport: cx(styles.viewport, item.classNames?.content),\n };\n\n const resolvedStyles = {\n arrow: item.styles?.arrow,\n positioner: {\n ...item.styles?.root,\n zIndex: item.zIndex ?? 1100,\n },\n viewport: item.styles?.content,\n };\n\n const contentNode = (\n <PopoverProvider value={contextValue}>{item.content}</PopoverProvider>\n );\n\n const popup = (\n <BasePopover.Positioner\n align={placementConfig.align}\n className={resolvedClassNames.positioner}\n data-hover-trigger={openOnHover || undefined}\n data-placement={placement}\n side={placementConfig.side}\n sideOffset={resolvedSideOffset}\n style={resolvedStyles.positioner}\n >\n <BasePopover.Popup className={resolvedClassNames.popup}>\n {arrow && (\n <BasePopover.Arrow\n className={resolvedClassNames.arrow}\n style={resolvedStyles.arrow}\n >\n {PopoverArrowIcon}\n </BasePopover.Arrow>\n )}\n {contentLayoutAnimation ? (\n <BasePopover.Viewport\n className={resolvedClassNames.viewport}\n style={resolvedStyles.viewport}\n >\n {contentNode}\n </BasePopover.Viewport>\n ) : (\n <div className={resolvedClassNames.viewport} style={resolvedStyles.viewport}>\n {contentNode}\n </div>\n )}\n </BasePopover.Popup>\n </BasePopover.Positioner>\n );\n\n const resolvedPortalContainer = portalContainer;\n const portalled = item.portalled ?? true;\n\n return portalled ? (\n resolvedPortalContainer ? (\n <BasePopover.Portal container={resolvedPortalContainer}>{popup}</BasePopover.Portal>\n ) : null\n ) : (\n popup\n );\n }}\n </BasePopover.Root>\n </PopoverGroupPropsContext.Provider>\n </PopoverGroupHandleContext.Provider>\n );\n};\n\nPopoverGroup.displayName = 'PopoverGroup';\n\nexport default PopoverGroup;\n"],"mappings":";;;;;;;;;;;;;;;AAyBA,MAAMA,gBAAuC,EAC3C,UACA,yBAAyB,OACzB,GAAG,kBACC;CACJ,MAAM,SAAS,cAAcC,QAAY,cAAgC,EAAE,EAAE,CAAC;CAC9E,MAAM,gBAAgB,OAAgC,KAAK;CAC3D,MAAM,QAAQ,kBAAkB;AAC9B,SAAO,OAAO;IACb,CAAC,OAAO,CAAC;CACZ,MAAM,eAAe,eAAe,EAAE,OAAO,GAAG,CAAC,MAAM,CAAC;CAExD,MAAM,mBAAmB,aAAa,SAAkB;AACtD,gBAAc,SAAS,eAAe,KAAK;IAC1C,EAAE,CAAC;CAEN,MAAM,CAAC,WAAW,gBAAgB,SAAS,EAAE;AAC7C,iBAAgB;AACd,gBAAc,SAAS,OAAO,EAAE;IAC/B,CAAC,OAAO,CAAC;CAEZ,MAAM,kBAAkB,2BAA2B;AAEnD,QACE,oBAAC,0BAA0B;EAAS,OAAO;YACzC,qBAAC,yBAAyB;GAAS,OAAO;cACvC,UACD,oBAACA,QAAY;IAAa;IAAwB,cAAc;eAC5D,EAAE,cAAc;KAChB,MAAM,OAAQ,WAAuC;AACrD,mBAAc,UAAU;AAExB,SAAI,CAAC,MAAM,QAAS,QAAO;KAE3B,MAAM,QAAQ,KAAK,QAAQ,QAAS,KAAK,SAAS;KAClD,MAAM,YAAY,KAAK,aAAa;KACpC,MAAM,EAAE,gBAAgB,aAAa,KAAK,WAAW,QAAQ;KAE7D,MAAM,kBAAkB,aAAa,cAAc,aAAa;KAChE,MAAM,iBAAiB,QAAQ,KAAK;KACpC,MAAM,qBAAqB,KAAK,SAC3B,EACC,MACA,iBAII;AACJ,UACE,SAAS,UACT,SAAS,WACT,SAAS,kBACT,SAAS,aAET,QAAO,CAAC,WAAW;AAErB,aAAO,CAAC,WAAW;SAErB;KAEJ,MAAM,qBAAqB;MACzB,OAAO,GAAG,OAAO,OAAO,KAAK,YAAY,MAAM;MAC/C,OAAO,GAAG,OAAO,OAAO,KAAK,UAAU;MACvC,YAAY,GAAG,OAAO,YAAY,KAAK,YAAY,KAAK;MACxD,UAAU,GAAG,OAAO,UAAU,KAAK,YAAY,QAAQ;MACxD;KAED,MAAM,iBAAiB;MACrB,OAAO,KAAK,QAAQ;MACpB,YAAY;OACV,GAAG,KAAK,QAAQ;OAChB,QAAQ,KAAK,UAAU;OACxB;MACD,UAAU,KAAK,QAAQ;MACxB;KAED,MAAM,cACJ,oBAAC;MAAgB,OAAO;gBAAe,KAAK;OAA0B;KAGxE,MAAM,QACJ,oBAACA,QAAY;MACX,OAAO,gBAAgB;MACvB,WAAW,mBAAmB;MAC9B,sBAAoB,eAAe;MACnC,kBAAgB;MAChB,MAAM,gBAAgB;MACtB,YAAY;MACZ,OAAO,eAAe;gBAEtB,qBAACA,QAAY;OAAM,WAAW,mBAAmB;kBAC9C,SACC,oBAACA,QAAY;QACX,WAAW,mBAAmB;QAC9B,OAAO,eAAe;kBAErB;SACiB,EAErB,yBACC,oBAACA,QAAY;QACX,WAAW,mBAAmB;QAC9B,OAAO,eAAe;kBAErB;SACoB,GAEvB,oBAAC;QAAI,WAAW,mBAAmB;QAAU,OAAO,eAAe;kBAChE;SACG;QAEU;OACG;KAG3B,MAAM,0BAA0B;AAGhC,YAFkB,KAAK,aAAa,OAGlC,0BACE,oBAACA,QAAY;MAAO,WAAW;gBAA0B;OAA2B,GAClF,OAEJ;;MAhGiC,UAmGpB;IACe;GACD;;AAIzC,aAAa,cAAc;AAE3B,2BAAe"}
|
|
@@ -7,8 +7,8 @@ import { useMergedPopoverProps } from "./useMergedPopoverProps.mjs";
|
|
|
7
7
|
import { cloneElement, isValidElement, useContext, useMemo } from "react";
|
|
8
8
|
import { jsx } from "react/jsx-runtime";
|
|
9
9
|
import { cx } from "antd-style";
|
|
10
|
-
import { mergeRefs } from "react-merge-refs";
|
|
11
10
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
11
|
+
import { mergeRefs } from "react-merge-refs";
|
|
12
12
|
import { Popover } from "@base-ui/react/popover";
|
|
13
13
|
|
|
14
14
|
//#region src/Popover/PopoverInGroup.tsx
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverPortal.mjs","names":[],"sources":["../../src/Popover/PopoverPortal.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { LOBE_THEME_APP_ID } from '@/ThemeProvider';\n\nconst PORTAL_ATTR = 'data-lobe-ui-popover-portal';\nexport const POPOVER_CONTAINER_ATTR = 'data-lobe-ui-popover-container';\n\n// Reuse one portal container per root (document.body by default).\nconst containerMap = new WeakMap<object, HTMLElement>();\n\nconst getOrCreateContainer = (root: HTMLElement | ShadowRoot): HTMLElement => {\n const resolvedRoot = (() => {\n if (typeof document === 'undefined') return root;\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) return root;\n\n const isBody = root === document.body;\n if (!isBody) return root;\n\n const themeApp = document.querySelector<HTMLElement>(`#${LOBE_THEME_APP_ID}`);\n if (themeApp) return themeApp;\n\n const popoverContainer = document.querySelector<HTMLElement>(\n `[${POPOVER_CONTAINER_ATTR}=\"true\"]`,\n );\n if (popoverContainer) return popoverContainer;\n\n return root;\n })();\n\n const cached = containerMap.get(resolvedRoot);\n if (cached && cached.isConnected) return cached;\n\n const el = document.createElement('div');\n el.setAttribute(PORTAL_ATTR, 'true');\n resolvedRoot.append(el);\n containerMap.set(resolvedRoot, el);\n return el;\n};\n\nconst resolveRoot = (root?: HTMLElement | ShadowRoot | null): HTMLElement | ShadowRoot | null => {\n if (root) return root;\n return document.body;\n};\n\nexport const usePopoverPortalContainer = (\n root?: HTMLElement | ShadowRoot | null,\n): HTMLElement | null => {\n const [container, setContainer] = useState<HTMLElement | null>(null);\n\n // Never mutate DOM / create portal container during render.\n // Create it after mount to avoid SSR/hydration side effects.\n useEffect(() => {\n const resolved = resolveRoot(root);\n if (!resolved) return;\n setContainer(getOrCreateContainer(resolved));\n }, [root]);\n\n return container;\n};\n"],"mappings":";;;;;;AAMA,MAAM,cAAc;AACpB,MAAa,yBAAyB;AAGtC,MAAM,+BAAe,IAAI,SAA8B;AAEvD,MAAM,wBAAwB,SAAgD;CAC5E,MAAM,sBAAsB;AAC1B,MAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,MAAI,OAAO,eAAe,eAAe,gBAAgB,WAAY,QAAO;AAG5E,MAAI,EADW,SAAS,SAAS,MACpB,QAAO;EAEpB,MAAM,WAAW,SAAS,cAA2B,IAAI,oBAAoB;AAC7E,MAAI,SAAU,QAAO;EAErB,MAAM,mBAAmB,SAAS,cAChC,IAAI,uBAAuB,UAC5B;AACD,MAAI,iBAAkB,QAAO;AAE7B,SAAO;KACL;CAEJ,MAAM,SAAS,aAAa,IAAI,aAAa;AAC7C,KAAI,UAAU,OAAO,YAAa,QAAO;CAEzC,MAAM,KAAK,SAAS,cAAc,MAAM;AACxC,IAAG,aAAa,aAAa,OAAO;AACpC,cAAa,OAAO,GAAG;AACvB,cAAa,IAAI,cAAc,GAAG;AAClC,QAAO;;AAGT,MAAM,eAAe,SAA4E;AAC/F,KAAI,KAAM,QAAO;AACjB,QAAO,SAAS;;AAGlB,MAAa,6BACX,SACuB;CACvB,MAAM,CAAC,WAAW,gBAAgB,SAA6B,KAAK;AAIpE,iBAAgB;EACd,MAAM,WAAW,YAAY,KAAK;AAClC,MAAI,CAAC,SAAU;AACf,eAAa,qBAAqB,SAAS,CAAC;IAC3C,CAAC,
|
|
1
|
+
{"version":3,"file":"PopoverPortal.mjs","names":[],"sources":["../../src/Popover/PopoverPortal.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nimport { LOBE_THEME_APP_ID } from '@/ThemeProvider';\n\nconst PORTAL_ATTR = 'data-lobe-ui-popover-portal';\nexport const POPOVER_CONTAINER_ATTR = 'data-lobe-ui-popover-container';\n\n// Reuse one portal container per root (document.body by default).\nconst containerMap = new WeakMap<object, HTMLElement>();\n\nconst getOrCreateContainer = (root: HTMLElement | ShadowRoot): HTMLElement => {\n const resolvedRoot = (() => {\n if (typeof document === 'undefined') return root;\n if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot) return root;\n\n const isBody = root === document.body;\n if (!isBody) return root;\n\n const themeApp = document.querySelector<HTMLElement>(`#${LOBE_THEME_APP_ID}`);\n if (themeApp) return themeApp;\n\n const popoverContainer = document.querySelector<HTMLElement>(\n `[${POPOVER_CONTAINER_ATTR}=\"true\"]`,\n );\n if (popoverContainer) return popoverContainer;\n\n return root;\n })();\n\n const cached = containerMap.get(resolvedRoot);\n if (cached && cached.isConnected) return cached;\n\n const el = document.createElement('div');\n el.setAttribute(PORTAL_ATTR, 'true');\n resolvedRoot.append(el);\n containerMap.set(resolvedRoot, el);\n return el;\n};\n\nconst resolveRoot = (root?: HTMLElement | ShadowRoot | null): HTMLElement | ShadowRoot | null => {\n if (root) return root;\n return document.body;\n};\n\nexport const usePopoverPortalContainer = (\n root?: HTMLElement | ShadowRoot | null,\n): HTMLElement | null => {\n const [container, setContainer] = useState<HTMLElement | null>(null);\n\n // Never mutate DOM / create portal container during render.\n // Create it after mount to avoid SSR/hydration side effects.\n useEffect(() => {\n const resolved = resolveRoot(root);\n if (!resolved) return;\n setContainer(getOrCreateContainer(resolved));\n }, [root, container?.isConnected]);\n\n return container;\n};\n"],"mappings":";;;;;;AAMA,MAAM,cAAc;AACpB,MAAa,yBAAyB;AAGtC,MAAM,+BAAe,IAAI,SAA8B;AAEvD,MAAM,wBAAwB,SAAgD;CAC5E,MAAM,sBAAsB;AAC1B,MAAI,OAAO,aAAa,YAAa,QAAO;AAC5C,MAAI,OAAO,eAAe,eAAe,gBAAgB,WAAY,QAAO;AAG5E,MAAI,EADW,SAAS,SAAS,MACpB,QAAO;EAEpB,MAAM,WAAW,SAAS,cAA2B,IAAI,oBAAoB;AAC7E,MAAI,SAAU,QAAO;EAErB,MAAM,mBAAmB,SAAS,cAChC,IAAI,uBAAuB,UAC5B;AACD,MAAI,iBAAkB,QAAO;AAE7B,SAAO;KACL;CAEJ,MAAM,SAAS,aAAa,IAAI,aAAa;AAC7C,KAAI,UAAU,OAAO,YAAa,QAAO;CAEzC,MAAM,KAAK,SAAS,cAAc,MAAM;AACxC,IAAG,aAAa,aAAa,OAAO;AACpC,cAAa,OAAO,GAAG;AACvB,cAAa,IAAI,cAAc,GAAG;AAClC,QAAO;;AAGT,MAAM,eAAe,SAA4E;AAC/F,KAAI,KAAM,QAAO;AACjB,QAAO,SAAS;;AAGlB,MAAa,6BACX,SACuB;CACvB,MAAM,CAAC,WAAW,gBAAgB,SAA6B,KAAK;AAIpE,iBAAgB;EACd,MAAM,WAAW,YAAY,KAAK;AAClC,MAAI,CAAC,SAAU;AACf,eAAa,qBAAqB,SAAS,CAAC;IAC3C,CAAC,MAAM,WAAW,YAAY,CAAC;AAElC,QAAO"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { placementMap } from "../utils/placement.mjs";
|
|
4
3
|
import { useNativeButton } from "../hooks/useNativeButton.mjs";
|
|
5
4
|
import { useIsClient } from "../hooks/useIsClient.mjs";
|
|
5
|
+
import { placementMap } from "../utils/placement.mjs";
|
|
6
6
|
import { PopoverProvider } from "./context.mjs";
|
|
7
7
|
import { parseTrigger } from "./parseTrigger.mjs";
|
|
8
8
|
import { PopoverArrowIcon } from "./ArrowIcon.mjs";
|
|
@@ -11,8 +11,8 @@ import { styles } from "./style.mjs";
|
|
|
11
11
|
import { cloneElement, isValidElement, memo, useCallback, useMemo, useState } from "react";
|
|
12
12
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { cx } from "antd-style";
|
|
14
|
-
import { mergeRefs } from "react-merge-refs";
|
|
15
14
|
import { mergeProps } from "@base-ui/react/merge-props";
|
|
15
|
+
import { mergeRefs } from "react-merge-refs";
|
|
16
16
|
import { Popover } from "@base-ui/react/popover";
|
|
17
17
|
|
|
18
18
|
//#region src/Popover/PopoverStandalone.tsx
|
package/es/Popover/context.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react58 from "react";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Popover/context.d.ts
|
|
5
5
|
type PopoverContextValue = {
|
|
6
6
|
close: () => void;
|
|
7
7
|
};
|
|
8
|
-
declare const PopoverProvider:
|
|
8
|
+
declare const PopoverProvider: react58.NamedExoticComponent<{
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
value: PopoverContextValue;
|
|
11
11
|
}>;
|
package/es/Popover/context.mjs
CHANGED
|
@@ -4,7 +4,9 @@ import { createContext, memo, use } from "react";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
|
|
6
6
|
//#region src/Popover/context.tsx
|
|
7
|
-
const noop = () => void 0
|
|
7
|
+
const noop = process.env.NODE_ENV === "production" ? () => void 0 : () => {
|
|
8
|
+
throw new Error("usePopoverContext must be used within a PopoverProvider");
|
|
9
|
+
};
|
|
8
10
|
const PopoverContext = createContext({ close: noop });
|
|
9
11
|
const PopoverProvider = memo(({ children, value }) => {
|
|
10
12
|
return /* @__PURE__ */ jsx(PopoverContext, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","names":[],"sources":["../../src/Popover/context.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, createContext, memo, use } from 'react';\n\nexport type PopoverContextValue = {\n close: () => void;\n};\n\nconst noop
|
|
1
|
+
{"version":3,"file":"context.mjs","names":[],"sources":["../../src/Popover/context.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, createContext, memo, use } from 'react';\n\nexport type PopoverContextValue = {\n close: () => void;\n};\n\nconst noop =\n process.env.NODE_ENV === 'production'\n ? () => void 0\n : () => {\n throw new Error('usePopoverContext must be used within a PopoverProvider');\n };\n\nexport const PopoverContext = createContext<PopoverContextValue>({\n close: noop,\n});\n\nexport const PopoverProvider = memo<{ children: ReactNode; value: PopoverContextValue }>(\n ({ children, value }) => {\n return <PopoverContext value={value}>{children}</PopoverContext>;\n },\n);\n\nexport const usePopoverContext = () => {\n return use(PopoverContext);\n};\n"],"mappings":";;;;;;AAQA,MAAM,OACJ,QAAQ,IAAI,aAAa,qBACf,KAAK,UACL;AACJ,OAAM,IAAI,MAAM,0DAA0D;;AAGlF,MAAa,iBAAiB,cAAmC,EAC/D,OAAO,MACR,CAAC;AAEF,MAAa,kBAAkB,MAC5B,EAAE,UAAU,YAAY;AACvB,QAAO,oBAAC;EAAsB;EAAQ;GAA0B;EAEnE;AAED,MAAa,0BAA0B;AACrC,QAAO,IAAI,eAAe"}
|
package/es/Popover/type.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SearchBarProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react57 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SearchBar/SearchBar.d.ts
|
|
5
|
-
declare const SearchBar:
|
|
5
|
+
declare const SearchBar: react57.NamedExoticComponent<SearchBarProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SearchBar };
|
|
8
8
|
//# sourceMappingURL=SearchBar.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SegmentedProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react56 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Segmented/Segmented.d.ts
|
|
5
|
-
declare const Segmented:
|
|
5
|
+
declare const Segmented: react56.NamedExoticComponent<SegmentedProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Segmented };
|
|
8
8
|
//# sourceMappingURL=Segmented.d.mts.map
|
package/es/Select/Select.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SelectProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react55 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Select/Select.d.ts
|
|
5
|
-
declare const Input:
|
|
5
|
+
declare const Input: react55.NamedExoticComponent<SelectProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Input };
|
|
8
8
|
//# sourceMappingURL=Select.d.mts.map
|
package/es/SideNav/SideNav.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SideNavProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react54 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SideNav/SideNav.d.ts
|
|
5
|
-
declare const SideNav:
|
|
5
|
+
declare const SideNav: react54.NamedExoticComponent<SideNavProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SideNav };
|
|
8
8
|
//# sourceMappingURL=SideNav.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SliderWithInputProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react20 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SliderWithInput/SliderWithInput.d.ts
|
|
5
|
-
declare const SliderWithInput:
|
|
5
|
+
declare const SliderWithInput: react20.NamedExoticComponent<SliderWithInputProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { SliderWithInput };
|
|
8
8
|
//# sourceMappingURL=SliderWithInput.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ActionIconProps } from "../../ActionIcon/type.mjs";
|
|
2
2
|
import "../../ActionIcon/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react108 from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/SortableList/components/DragHandle.d.ts
|
|
6
|
-
declare const DragHandle:
|
|
6
|
+
declare const DragHandle: react108.NamedExoticComponent<ActionIconProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DragHandle };
|
|
9
9
|
//# sourceMappingURL=DragHandle.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FlexboxProps } from "../../Flex/type.mjs";
|
|
2
2
|
import "../../Flex/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react106 from "react";
|
|
4
4
|
import "@dnd-kit/core";
|
|
5
5
|
|
|
6
6
|
//#region src/SortableList/components/SortableItem.d.ts
|
|
@@ -9,7 +9,7 @@ interface SortableItemProps extends Omit<FlexboxProps, 'id'> {
|
|
|
9
9
|
id: string | number;
|
|
10
10
|
variant?: 'borderless' | 'filled' | 'outlined';
|
|
11
11
|
}
|
|
12
|
-
declare const SortableItem:
|
|
12
|
+
declare const SortableItem: react106.NamedExoticComponent<SortableItemProps>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { SortableItem };
|
|
15
15
|
//# sourceMappingURL=SortableItem.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ThemeProviderProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react8 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ThemeProvider/ThemeProvider.d.ts
|
|
5
|
-
declare const ThemeProvider:
|
|
5
|
+
declare const ThemeProvider: react8.NamedExoticComponent<ThemeProviderProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ThemeProvider };
|
|
8
8
|
//# sourceMappingURL=ThemeProvider.d.mts.map
|
package/es/Toc/Toc.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TocProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react7 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Toc/Toc.d.ts
|
|
5
|
-
declare const Toc:
|
|
5
|
+
declare const Toc: react7.NamedExoticComponent<TocProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Toc };
|
|
8
8
|
//# sourceMappingURL=Toc.d.mts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
|
|
5
|
+
//#region src/Tooltip/ArrowIcon.tsx
|
|
6
|
+
const TooltipArrowIcon = /* @__PURE__ */ jsxs("svg", {
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
height: "6",
|
|
9
|
+
viewBox: "0 0 12 6",
|
|
10
|
+
width: "12",
|
|
11
|
+
children: [/* @__PURE__ */ jsx("path", {
|
|
12
|
+
d: "M0 6L6 0L12 6Z",
|
|
13
|
+
"data-role": "fill"
|
|
14
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
15
|
+
d: "M0 6L6 0L12 6",
|
|
16
|
+
"data-role": "stroke"
|
|
17
|
+
})]
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { TooltipArrowIcon };
|
|
22
|
+
//# sourceMappingURL=ArrowIcon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArrowIcon.mjs","names":[],"sources":["../../src/Tooltip/ArrowIcon.tsx"],"sourcesContent":["'use client';\n\nexport const TooltipArrowIcon = (\n <svg aria-hidden=\"true\" height=\"6\" viewBox=\"0 0 12 6\" width=\"12\">\n <path d=\"M0 6L6 0L12 6Z\" data-role=\"fill\" />\n <path d=\"M0 6L6 0L12 6\" data-role=\"stroke\" />\n </svg>\n);\n"],"mappings":";;;;;AAEA,MAAa,mBACX,qBAAC;CAAI,eAAY;CAAO,QAAO;CAAI,SAAQ;CAAW,OAAM;YAC1D,oBAAC;EAAK,GAAE;EAAiB,aAAU;GAAS,EAC5C,oBAAC;EAAK,GAAE;EAAgB,aAAU;GAAW;EACzC"}
|
package/es/Tooltip/Tooltip.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { TooltipGroupHandleContext } from "./groupContext.mjs";
|
|
4
4
|
import { TooltipInGroup } from "./TooltipInGroup.mjs";
|
|
5
5
|
import { TooltipStandalone } from "./TooltipStandalone.mjs";
|
|
6
6
|
import { useContext } from "react";
|
|
@@ -8,8 +8,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
8
8
|
|
|
9
9
|
//#region src/Tooltip/Tooltip.tsx
|
|
10
10
|
const Tooltip = (props) => {
|
|
11
|
-
const group = useContext(
|
|
12
|
-
return Boolean(group) && props.open === void 0 && props.defaultOpen === void 0 ? /* @__PURE__ */ jsx(TooltipInGroup, { ...props }) : /* @__PURE__ */ jsx(TooltipStandalone, { ...props });
|
|
11
|
+
const group = useContext(TooltipGroupHandleContext);
|
|
12
|
+
return Boolean(group) && props.open === void 0 && props.defaultOpen === void 0 && !props.standalone ? /* @__PURE__ */ jsx(TooltipInGroup, { ...props }) : /* @__PURE__ */ jsx(TooltipStandalone, { ...props });
|
|
13
13
|
};
|
|
14
14
|
var Tooltip_default = Tooltip;
|
|
15
15
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.mjs","names":["Tooltip: FC<TooltipProps>"],"sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useContext } from 'react';\n\nimport { TooltipInGroup } from './TooltipInGroup';\nimport { TooltipStandalone } from './TooltipStandalone';\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.mjs","names":["Tooltip: FC<TooltipProps>"],"sources":["../../src/Tooltip/Tooltip.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, useContext } from 'react';\n\nimport { TooltipInGroup } from './TooltipInGroup';\nimport { TooltipStandalone } from './TooltipStandalone';\nimport { TooltipGroupHandleContext } from './groupContext';\nimport type { TooltipProps } from './type';\n\nexport const Tooltip: FC<TooltipProps> = (props) => {\n const group = useContext(TooltipGroupHandleContext);\n\n const canUseGroup =\n Boolean(group) &&\n props.open === undefined &&\n props.defaultOpen === undefined &&\n !props.standalone;\n\n return canUseGroup ? <TooltipInGroup {...props} /> : <TooltipStandalone {...props} />;\n};\n\nexport default Tooltip;\n"],"mappings":";;;;;;;;;AASA,MAAaA,WAA6B,UAAU;CAClD,MAAM,QAAQ,WAAW,0BAA0B;AAQnD,QALE,QAAQ,MAAM,IACd,MAAM,SAAS,UACf,MAAM,gBAAgB,UACtB,CAAC,MAAM,aAEY,oBAAC,kBAAe,GAAI,QAAS,GAAG,oBAAC,qBAAkB,GAAI,QAAS;;AAGvF,sBAAe"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import Hotkey_default from "../Hotkey/Hotkey.mjs";
|
|
4
|
+
import { memo, useMemo } from "react";
|
|
5
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
|
|
7
|
+
//#region src/Tooltip/TooltipContent.tsx
|
|
8
|
+
const TooltipContent = memo(({ title, hotkey, hotkeyProps }) => {
|
|
9
|
+
const resolvedHotkeyProps = useMemo(() => ({
|
|
10
|
+
compact: true,
|
|
11
|
+
inverseTheme: true,
|
|
12
|
+
...hotkeyProps
|
|
13
|
+
}), [hotkeyProps]);
|
|
14
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [title, hotkey ? /* @__PURE__ */ jsx(Hotkey_default, {
|
|
15
|
+
keys: hotkey,
|
|
16
|
+
...resolvedHotkeyProps
|
|
17
|
+
}) : null] });
|
|
18
|
+
});
|
|
19
|
+
TooltipContent.displayName = "TooltipContent";
|
|
20
|
+
var TooltipContent_default = TooltipContent;
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { TooltipContent_default as default };
|
|
24
|
+
//# sourceMappingURL=TooltipContent.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TooltipContent.mjs","names":["Hotkey"],"sources":["../../src/Tooltip/TooltipContent.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, memo, useMemo } from 'react';\n\nimport Hotkey, { type HotkeyProps } from '@/Hotkey';\n\ntype TooltipContentProps = {\n hotkey?: string;\n hotkeyProps?: Omit<HotkeyProps, 'keys'>;\n title: ReactNode;\n};\n\nconst TooltipContent = memo<TooltipContentProps>(({ title, hotkey, hotkeyProps }) => {\n const resolvedHotkeyProps = useMemo(\n () => ({\n compact: true,\n inverseTheme: true,\n ...hotkeyProps,\n }),\n [hotkeyProps],\n );\n\n return (\n <>\n {title}\n {hotkey ? <Hotkey keys={hotkey} {...resolvedHotkeyProps} /> : null}\n </>\n );\n});\n\nTooltipContent.displayName = 'TooltipContent';\n\nexport default TooltipContent;\n"],"mappings":";;;;;;;AAYA,MAAM,iBAAiB,MAA2B,EAAE,OAAO,QAAQ,kBAAkB;CACnF,MAAM,sBAAsB,eACnB;EACL,SAAS;EACT,cAAc;EACd,GAAG;EACJ,GACD,CAAC,YAAY,CACd;AAED,QACE,8CACG,OACA,SAAS,oBAACA;EAAO,MAAM;EAAQ,GAAI;GAAuB,GAAG,QAC7D;EAEL;AAEF,eAAe,cAAc;AAE7B,6BAAe"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { FC
|
|
1
|
+
import { TooltipGroupProps } from "./type.mjs";
|
|
2
|
+
import { FC } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Tooltip/TooltipGroup.d.ts
|
|
5
|
-
type TooltipGroupProps = TooltipGroupSharedProps & {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
};
|
|
8
5
|
declare const TooltipGroup: FC<TooltipGroupProps>;
|
|
9
6
|
//#endregion
|
|
10
7
|
export { TooltipGroup };
|