@lobehub/ui 4.8.0 → 4.8.1
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/CopyButton/CopyButton.d.mts +2 -2
- package/es/DatePicker/DatePicker.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
- package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
- package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
- 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/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/GuideCard/GuideCard.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/Input/InputOPT.d.mts +2 -2
- package/es/Input/InputPassword.d.mts +2 -2
- package/es/Input/TextArea.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/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/Tag/Tag.mjs +10 -15
- package/es/Tag/Tag.mjs.map +1 -1
- package/es/Tag/utils.mjs +9 -4
- package/es/Tag/utils.mjs.map +1 -1
- package/es/ThemeProvider/GlobalMouseDirectionContext.mjs +28 -0
- package/es/ThemeProvider/GlobalMouseDirectionContext.mjs.map +1 -0
- package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
- package/es/ThemeProvider/ThemeProvider.mjs +3 -2
- package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Tooltip/TooltipFloating.mjs +58 -36
- package/es/Tooltip/TooltipFloating.mjs.map +1 -1
- package/es/Tooltip/TooltipGroup.mjs +6 -0
- package/es/Tooltip/TooltipGroup.mjs.map +1 -1
- package/es/Tooltip/TooltipStandalone.mjs +1 -0
- package/es/Tooltip/TooltipStandalone.mjs.map +1 -1
- package/es/Tooltip/style.mjs +4 -1
- package/es/Tooltip/style.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/Hero/Hero.d.mts +2 -2
- package/es/awesome/Spline/Spine.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/ChatInputArea/components/ChatInputAreaInner.d.mts +2 -2
- package/es/chat/ChatItem/ChatItem.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/i18n/context.d.mts +2 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +3 -3
- package/es/icons/lucideExtra/CreateBotIcon.d.mts +2 -2
- package/es/icons/lucideExtra/DiscordIcon.d.mts +3 -3
- package/es/icons/lucideExtra/GlobeOffIcon.d.mts +3 -3
- 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 +3 -3
- 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 +2 -2
- package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
- package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +2 -2
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +2 -2
- package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
- package/es/mdx/Mdx/index.d.mts +2 -2
- package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
- 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/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutSidebarInnerProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react51 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutSidebarInner.d.ts
|
|
5
|
-
declare const LayoutSidebarInner:
|
|
5
|
+
declare const LayoutSidebarInner: react51.NamedExoticComponent<LayoutSidebarInnerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutSidebarInner };
|
|
8
8
|
//# sourceMappingURL=LayoutSidebarInner.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LayoutTocProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react52 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutToc.d.ts
|
|
5
|
-
declare const LayoutToc:
|
|
5
|
+
declare const LayoutToc: react52.NamedExoticComponent<LayoutTocProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { LayoutToc };
|
|
8
8
|
//# sourceMappingURL=LayoutToc.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ListItemProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react46 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/List/ListItem/index.d.ts
|
|
5
|
-
declare const ListItem:
|
|
5
|
+
declare const ListItem: react46.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 react44 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Markdown.d.ts
|
|
5
|
-
declare const Markdown:
|
|
5
|
+
declare const Markdown: react44.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 react43 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Typography.d.ts
|
|
5
|
-
declare const Typography:
|
|
5
|
+
declare const Typography: react43.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 react70 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: react70.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 react45 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/MaskShadow/MaskShadow.d.ts
|
|
5
|
-
declare const MaskShadow:
|
|
5
|
+
declare const MaskShadow: react45.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 react42 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Menu/Menu.d.ts
|
|
5
|
-
declare const Menu:
|
|
5
|
+
declare const Menu: react42.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 react35 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/Mermaid.d.ts
|
|
5
|
-
declare const Mermaid:
|
|
5
|
+
declare const Mermaid: react35.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 react36 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/SyntaxMermaid/index.d.ts
|
|
5
|
-
declare const SyntaxMermaid:
|
|
5
|
+
declare const SyntaxMermaid: react36.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 react38 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Modal/Modal.d.ts
|
|
5
|
-
declare const Modal:
|
|
5
|
+
declare const Modal: react38.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 react39 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: react39.NamedExoticComponent<{
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
value: ModalContextValue;
|
|
9
9
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react71 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: react71.NamedExoticComponent<{
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
motion: MotionComponentType;
|
|
12
12
|
}>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SearchBarProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react41 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SearchBar/SearchBar.d.ts
|
|
5
|
-
declare const SearchBar:
|
|
5
|
+
declare const SearchBar: react41.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 react37 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Segmented/Segmented.d.ts
|
|
5
|
-
declare const Segmented:
|
|
5
|
+
declare const Segmented: react37.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 react32 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Select/Select.d.ts
|
|
5
|
-
declare const Input:
|
|
5
|
+
declare const Input: react32.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 react34 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SideNav/SideNav.d.ts
|
|
5
|
-
declare const SideNav:
|
|
5
|
+
declare const SideNav: react34.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 react27 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SliderWithInput/SliderWithInput.d.ts
|
|
5
|
-
declare const SliderWithInput:
|
|
5
|
+
declare const SliderWithInput: react27.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
|
package/es/Tag/Tag.mjs
CHANGED
|
@@ -5,13 +5,12 @@ import { variants } from "./styles.mjs";
|
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { Tag } from "antd";
|
|
8
|
-
import {
|
|
8
|
+
import { cssVar, cx } from "antd-style";
|
|
9
9
|
|
|
10
10
|
//#region src/Tag/Tag.tsx
|
|
11
11
|
const Tag$1 = ({ className, ref, size = "middle", color, variant = "filled", children, onClick, style, ...rest }) => {
|
|
12
|
-
const theme = useTheme();
|
|
13
12
|
const colors = useMemo(() => {
|
|
14
|
-
let textColor =
|
|
13
|
+
let textColor = cssVar.colorTextSecondary;
|
|
15
14
|
let backgroundColor;
|
|
16
15
|
let borderColor;
|
|
17
16
|
const isBorderless = variant === "borderless";
|
|
@@ -20,17 +19,17 @@ const Tag$1 = ({ className, ref, size = "middle", color, variant = "filled", chi
|
|
|
20
19
|
const isPresetSystemColors = color && presetSystemColors.has(color);
|
|
21
20
|
const isHexColor = color && color.startsWith("#");
|
|
22
21
|
if (isPresetColor) {
|
|
23
|
-
textColor = colorsPreset(
|
|
24
|
-
backgroundColor = isBorderless ? "transparent" : colorsPreset(
|
|
25
|
-
borderColor = colorsPreset(
|
|
22
|
+
textColor = colorsPreset(color);
|
|
23
|
+
backgroundColor = isBorderless ? "transparent" : colorsPreset(color, "fillTertiary");
|
|
24
|
+
borderColor = colorsPreset(color, isFilled ? "fillQuaternary" : "fillTertiary");
|
|
26
25
|
}
|
|
27
26
|
if (isPresetSystemColors) {
|
|
28
|
-
textColor = colorsPresetSystem(
|
|
29
|
-
backgroundColor = isBorderless ? "transparent" : colorsPresetSystem(
|
|
30
|
-
borderColor = colorsPresetSystem(
|
|
27
|
+
textColor = colorsPresetSystem(color);
|
|
28
|
+
backgroundColor = isBorderless ? "transparent" : colorsPresetSystem(color, "fillTertiary");
|
|
29
|
+
borderColor = colorsPresetSystem(color, isFilled ? "fillQuaternary" : "fillTertiary");
|
|
31
30
|
}
|
|
32
31
|
if (isHexColor) {
|
|
33
|
-
textColor =
|
|
32
|
+
textColor = cssVar.colorBgLayout;
|
|
34
33
|
backgroundColor = isBorderless ? "transparent" : color;
|
|
35
34
|
}
|
|
36
35
|
return {
|
|
@@ -38,11 +37,7 @@ const Tag$1 = ({ className, ref, size = "middle", color, variant = "filled", chi
|
|
|
38
37
|
borderColor,
|
|
39
38
|
textColor
|
|
40
39
|
};
|
|
41
|
-
}, [
|
|
42
|
-
color,
|
|
43
|
-
theme,
|
|
44
|
-
variant
|
|
45
|
-
]);
|
|
40
|
+
}, [color, variant]);
|
|
46
41
|
return /* @__PURE__ */ jsx(Tag, {
|
|
47
42
|
className: cx(variants({
|
|
48
43
|
size,
|
package/es/Tag/Tag.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tag.mjs","names":["Tag: FC<TagProps>","AntTag","Tag"],"sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["'use client';\n\nimport { Tag as AntTag } from 'antd';\nimport {
|
|
1
|
+
{"version":3,"file":"Tag.mjs","names":["Tag: FC<TagProps>","AntTag","Tag"],"sources":["../../src/Tag/Tag.tsx"],"sourcesContent":["'use client';\n\nimport { Tag as AntTag } from 'antd';\nimport { cssVar, cx } from 'antd-style';\nimport { type FC, useMemo } from 'react';\n\nimport { colorsPreset, colorsPresetSystem, presetColors, presetSystemColors } from '@/Tag/utils';\n\nimport { variants } from './styles';\nimport type { TagProps } from './type';\n\nconst Tag: FC<TagProps> = ({\n className,\n ref,\n size = 'middle',\n color,\n variant = 'filled',\n children,\n onClick,\n style,\n ...rest\n}) => {\n const colors = useMemo(() => {\n let textColor = cssVar.colorTextSecondary;\n let backgroundColor;\n let borderColor;\n const isBorderless = variant === 'borderless';\n const isFilled = variant === 'filled';\n const isPresetColor = color && presetColors.includes(color);\n const isPresetSystemColors = color && presetSystemColors.has(color);\n const isHexColor = color && color.startsWith('#');\n\n if (isPresetColor) {\n textColor = colorsPreset(color);\n backgroundColor = isBorderless ? 'transparent' : colorsPreset(color, 'fillTertiary');\n borderColor = colorsPreset(color, isFilled ? 'fillQuaternary' : 'fillTertiary');\n }\n if (isPresetSystemColors) {\n textColor = colorsPresetSystem(color);\n backgroundColor = isBorderless ? 'transparent' : colorsPresetSystem(color, 'fillTertiary');\n borderColor = colorsPresetSystem(color, isFilled ? 'fillQuaternary' : 'fillTertiary');\n }\n if (isHexColor) {\n textColor = cssVar.colorBgLayout;\n backgroundColor = isBorderless ? 'transparent' : color;\n }\n\n return {\n backgroundColor,\n borderColor,\n textColor,\n };\n }, [color, variant]);\n\n return (\n <AntTag\n className={cx(variants({ size, variant: variant as any }), className)}\n color={color}\n onClick={onClick}\n ref={ref}\n style={{\n background: colors?.backgroundColor,\n borderColor: colors?.borderColor,\n color: colors?.textColor,\n cursor: onClick ? 'pointer' : undefined,\n ...style,\n }}\n variant={variant === 'borderless' ? 'outlined' : variant}\n {...rest}\n >\n {children}\n </AntTag>\n );\n};\n\nTag.displayName = 'Tag';\n\nexport default Tag;\n"],"mappings":";;;;;;;;;;AAWA,MAAMA,SAAqB,EACzB,WACA,KACA,OAAO,UACP,OACA,UAAU,UACV,UACA,SACA,OACA,GAAG,WACC;CACJ,MAAM,SAAS,cAAc;EAC3B,IAAI,YAAY,OAAO;EACvB,IAAI;EACJ,IAAI;EACJ,MAAM,eAAe,YAAY;EACjC,MAAM,WAAW,YAAY;EAC7B,MAAM,gBAAgB,SAAS,aAAa,SAAS,MAAM;EAC3D,MAAM,uBAAuB,SAAS,mBAAmB,IAAI,MAAM;EACnE,MAAM,aAAa,SAAS,MAAM,WAAW,IAAI;AAEjD,MAAI,eAAe;AACjB,eAAY,aAAa,MAAM;AAC/B,qBAAkB,eAAe,gBAAgB,aAAa,OAAO,eAAe;AACpF,iBAAc,aAAa,OAAO,WAAW,mBAAmB,eAAe;;AAEjF,MAAI,sBAAsB;AACxB,eAAY,mBAAmB,MAAM;AACrC,qBAAkB,eAAe,gBAAgB,mBAAmB,OAAO,eAAe;AAC1F,iBAAc,mBAAmB,OAAO,WAAW,mBAAmB,eAAe;;AAEvF,MAAI,YAAY;AACd,eAAY,OAAO;AACnB,qBAAkB,eAAe,gBAAgB;;AAGnD,SAAO;GACL;GACA;GACA;GACD;IACA,CAAC,OAAO,QAAQ,CAAC;AAEpB,QACE,oBAACC;EACC,WAAW,GAAG,SAAS;GAAE;GAAe;GAAgB,CAAC,EAAE,UAAU;EAC9D;EACE;EACJ;EACL,OAAO;GACL,YAAY,QAAQ;GACpB,aAAa,QAAQ;GACrB,OAAO,QAAQ;GACf,QAAQ,UAAU,YAAY;GAC9B,GAAG;GACJ;EACD,SAAS,YAAY,eAAe,aAAa;EACjD,GAAI;EAEH;GACM;;AAIb,MAAI,cAAc;AAElB,kBAAeC"}
|
package/es/Tag/utils.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { cssVar } from "antd-style";
|
|
1
2
|
import { camelCase } from "es-toolkit/compat";
|
|
2
3
|
|
|
3
4
|
//#region src/Tag/utils.ts
|
|
@@ -23,13 +24,17 @@ const presetSystemColors = new Set([
|
|
|
23
24
|
"info",
|
|
24
25
|
"processing"
|
|
25
26
|
]);
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
return
|
|
27
|
+
const toKebabCase = (value) => value.replaceAll(/([a-z])([A-Z])/g, "$1-$2").replaceAll(/([a-z])(\d)/g, "$1-$2").replaceAll(/(\d)([A-Z])/g, "$1-$2").replaceAll(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").toLowerCase();
|
|
28
|
+
const getCssVar = (tokenKey) => {
|
|
29
|
+
return cssVar[tokenKey] || `var(--ant-${toKebabCase(tokenKey)})`;
|
|
30
|
+
};
|
|
31
|
+
const colorsPreset = (type, ...keys) => getCssVar(camelCase([type, ...keys].join("-")));
|
|
32
|
+
const colorsPresetSystem = (type, ...keys) => {
|
|
33
|
+
return getCssVar(camelCase([
|
|
29
34
|
"color",
|
|
30
35
|
type === "processing" ? "info" : type,
|
|
31
36
|
...keys
|
|
32
|
-
].join("-"))
|
|
37
|
+
].join("-")));
|
|
33
38
|
};
|
|
34
39
|
|
|
35
40
|
//#endregion
|
package/es/Tag/utils.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/Tag/utils.ts"],"sourcesContent":["import { camelCase } from 'es-toolkit/compat';\n\nexport const presetColors = [\n 'red',\n 'volcano',\n 'orange',\n 'gold',\n 'yellow',\n 'lime',\n 'green',\n 'cyan',\n 'blue',\n 'geekblue',\n 'purple',\n 'magenta',\n 'gray',\n];\n\nexport const presetSystemColors = new Set(['error', 'warning', 'success', 'info', 'processing']);\n\
|
|
1
|
+
{"version":3,"file":"utils.mjs","names":[],"sources":["../../src/Tag/utils.ts"],"sourcesContent":["import { cssVar } from 'antd-style';\nimport { camelCase } from 'es-toolkit/compat';\n\nexport const presetColors = [\n 'red',\n 'volcano',\n 'orange',\n 'gold',\n 'yellow',\n 'lime',\n 'green',\n 'cyan',\n 'blue',\n 'geekblue',\n 'purple',\n 'magenta',\n 'gray',\n];\n\nexport const presetSystemColors = new Set(['error', 'warning', 'success', 'info', 'processing']);\n\nconst toKebabCase = (value: string) =>\n value\n .replaceAll(/([a-z])([A-Z])/g, '$1-$2')\n .replaceAll(/([a-z])(\\d)/g, '$1-$2')\n .replaceAll(/(\\d)([A-Z])/g, '$1-$2')\n .replaceAll(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')\n .toLowerCase();\n\nconst getCssVar = (tokenKey: string) => {\n const mapped = (cssVar as Record<string, string>)[tokenKey];\n return mapped || `var(--ant-${toKebabCase(tokenKey)})`;\n};\n\nexport const colorsPreset = (type: string, ...keys: string[]) =>\n getCssVar(camelCase([type, ...keys].join('-')));\n\nexport const colorsPresetSystem = (type: string, ...keys: string[]) => {\n const t = type === 'processing' ? 'info' : type;\n return getCssVar(camelCase(['color', t, ...keys].join('-')));\n};\n"],"mappings":";;;;AAGA,MAAa,eAAe;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;AAED,MAAa,qBAAqB,IAAI,IAAI;CAAC;CAAS;CAAW;CAAW;CAAQ;CAAa,CAAC;AAEhG,MAAM,eAAe,UACnB,MACG,WAAW,mBAAmB,QAAQ,CACtC,WAAW,gBAAgB,QAAQ,CACnC,WAAW,gBAAgB,QAAQ,CACnC,WAAW,yBAAyB,QAAQ,CAC5C,aAAa;AAElB,MAAM,aAAa,aAAqB;AAEtC,QADgB,OAAkC,aACjC,aAAa,YAAY,SAAS,CAAC;;AAGtD,MAAa,gBAAgB,MAAc,GAAG,SAC5C,UAAU,UAAU,CAAC,MAAM,GAAG,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC;AAEjD,MAAa,sBAAsB,MAAc,GAAG,SAAmB;AAErE,QAAO,UAAU,UAAU;EAAC;EADlB,SAAS,eAAe,SAAS;EACH,GAAG;EAAK,CAAC,KAAK,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createContext, memo, useEffect, useRef, useState } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/ThemeProvider/GlobalMouseDirectionContext.tsx
|
|
5
|
+
const GlobalMouseDirectionContext = createContext("right");
|
|
6
|
+
const GlobalMouseDirectionProvider = memo(({ children }) => {
|
|
7
|
+
const [direction, setDirection] = useState("right");
|
|
8
|
+
const prevX = useRef(0);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const handleMouseMove = (e) => {
|
|
11
|
+
if (e.clientX > prevX.current) setDirection((prev) => prev !== "right" ? "right" : prev);
|
|
12
|
+
else if (e.clientX < prevX.current) setDirection((prev) => prev !== "left" ? "left" : prev);
|
|
13
|
+
prevX.current = e.clientX;
|
|
14
|
+
};
|
|
15
|
+
window.addEventListener("mousemove", handleMouseMove);
|
|
16
|
+
return () => {
|
|
17
|
+
window.removeEventListener("mousemove", handleMouseMove);
|
|
18
|
+
};
|
|
19
|
+
}, []);
|
|
20
|
+
return /* @__PURE__ */ jsx(GlobalMouseDirectionContext.Provider, {
|
|
21
|
+
value: direction,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { GlobalMouseDirectionProvider };
|
|
28
|
+
//# sourceMappingURL=GlobalMouseDirectionContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlobalMouseDirectionContext.mjs","names":[],"sources":["../../src/ThemeProvider/GlobalMouseDirectionContext.tsx"],"sourcesContent":["import { ReactNode, createContext, memo, useEffect, useRef, useState } from 'react';\n\ntype Direction = 'left' | 'right';\n\nexport const GlobalMouseDirectionContext = createContext<Direction>('right');\n\nexport const GlobalMouseDirectionProvider = memo(({ children }: { children: ReactNode }) => {\n const [direction, setDirection] = useState<Direction>('right');\n const prevX = useRef(0);\n\n useEffect(() => {\n const handleMouseMove = (e: MouseEvent) => {\n if (e.clientX > prevX.current) {\n setDirection((prev) => (prev !== 'right' ? 'right' : prev));\n } else if (e.clientX < prevX.current) {\n setDirection((prev) => (prev !== 'left' ? 'left' : prev));\n }\n prevX.current = e.clientX;\n };\n\n window.addEventListener('mousemove', handleMouseMove);\n return () => {\n window.removeEventListener('mousemove', handleMouseMove);\n };\n }, []);\n\n return (\n <GlobalMouseDirectionContext.Provider value={direction}>\n {children}\n </GlobalMouseDirectionContext.Provider>\n );\n});\n"],"mappings":";;;;AAIA,MAAa,8BAA8B,cAAyB,QAAQ;AAE5E,MAAa,+BAA+B,MAAM,EAAE,eAAwC;CAC1F,MAAM,CAAC,WAAW,gBAAgB,SAAoB,QAAQ;CAC9D,MAAM,QAAQ,OAAO,EAAE;AAEvB,iBAAgB;EACd,MAAM,mBAAmB,MAAkB;AACzC,OAAI,EAAE,UAAU,MAAM,QACpB,eAAc,SAAU,SAAS,UAAU,UAAU,KAAM;YAClD,EAAE,UAAU,MAAM,QAC3B,eAAc,SAAU,SAAS,SAAS,SAAS,KAAM;AAE3D,SAAM,UAAU,EAAE;;AAGpB,SAAO,iBAAiB,aAAa,gBAAgB;AACrD,eAAa;AACX,UAAO,oBAAoB,aAAa,gBAAgB;;IAEzD,EAAE,CAAC;AAEN,QACE,oBAAC,4BAA4B;EAAS,OAAO;EAC1C;GACoC;EAEzC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ThemeProviderProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react31 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ThemeProvider/ThemeProvider.d.ts
|
|
5
|
-
declare const ThemeProvider:
|
|
5
|
+
declare const ThemeProvider: react31.NamedExoticComponent<ThemeProviderProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ThemeProvider };
|
|
8
8
|
//# sourceMappingURL=ThemeProvider.d.mts.map
|
|
@@ -7,6 +7,7 @@ import { LOBE_THEME_APP_ID } from "./constants.mjs";
|
|
|
7
7
|
import FontLoader_default from "../FontLoader/index.mjs";
|
|
8
8
|
import { createLobeAntdTheme } from "../styles/theme/antdTheme.mjs";
|
|
9
9
|
import ConfigProvider_default from "./ConfigProvider.mjs";
|
|
10
|
+
import { GlobalMouseDirectionProvider } from "./GlobalMouseDirectionContext.mjs";
|
|
10
11
|
import GlobalStyle_default from "./GlobalStyle/index.mjs";
|
|
11
12
|
import { memo, useCallback, useMemo } from "react";
|
|
12
13
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -59,7 +60,7 @@ const ThemeProvider$1 = memo(({ children, customStylish, customToken, enableCust
|
|
|
59
60
|
customToken: token,
|
|
60
61
|
theme,
|
|
61
62
|
...rest,
|
|
62
|
-
children: /* @__PURE__ */ jsxs(ConfigProvider_default, { children: [enableGlobalStyle && /* @__PURE__ */ jsx(GlobalStyle_default, {}), /* @__PURE__ */ jsx(App, {
|
|
63
|
+
children: /* @__PURE__ */ jsxs(ConfigProvider_default, { children: [enableGlobalStyle && /* @__PURE__ */ jsx(GlobalStyle_default, {}), /* @__PURE__ */ jsx(GlobalMouseDirectionProvider, { children: /* @__PURE__ */ jsx(App, {
|
|
63
64
|
className,
|
|
64
65
|
style: {
|
|
65
66
|
minHeight: "inherit",
|
|
@@ -71,7 +72,7 @@ const ThemeProvider$1 = memo(({ children, customStylish, customToken, enableCust
|
|
|
71
72
|
style: { display: "contents" },
|
|
72
73
|
children
|
|
73
74
|
})
|
|
74
|
-
})] })
|
|
75
|
+
}) })] })
|
|
75
76
|
})] });
|
|
76
77
|
});
|
|
77
78
|
ThemeProvider$1.displayName = "LobeThemeProvider";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.mjs","names":["ThemeProvider","lobeCustomStylish","theme","lobeCustomToken","FontLoader","AntdThemeProvider","AntdConfigProvider","GlobalStyle"],"sources":["../../src/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["'use client';\n\nimport { App } from 'antd';\nimport {\n ThemeProvider as AntdThemeProvider,\n CustomStylishParams,\n CustomTokenParams,\n GetAntdTheme,\n} from 'antd-style';\nimport { merge } from 'es-toolkit/compat';\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { useCdnFn } from '@/ConfigProvider';\nimport FontLoader from '@/FontLoader';\nimport { lobeCustomStylish, lobeCustomToken } from '@/styles';\nimport { createLobeAntdTheme } from '@/styles/theme/antdTheme';\nimport { LobeCustomToken } from '@/types/customToken';\n\nimport AntdConfigProvider from './ConfigProvider';\nimport GlobalStyle from './GlobalStyle';\nimport { LOBE_THEME_APP_ID } from './constants';\nimport type { ThemeProviderProps } from './type';\n\nconst ThemeProvider = memo<ThemeProviderProps>(\n ({\n children,\n customStylish,\n customToken,\n enableCustomFonts = true,\n enableGlobalStyle = true,\n customFonts,\n customTheme = {},\n className,\n style,\n theme: antdTheme,\n ...rest\n }) => {\n const genCdnUrl = useCdnFn();\n\n const webfontUrls = useMemo(\n () =>\n customFonts || [\n genCdnUrl({ path: 'css/index.css', pkg: '@lobehub/webfont-mono' }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans',\n }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans-sc',\n }),\n genCdnUrl({ path: 'dist/katex.min.css', pkg: 'katex' }),\n ],\n [customFonts, genCdnUrl],\n );\n\n const stylish = useCallback(\n (theme: CustomStylishParams) => ({ ...lobeCustomStylish(theme), ...customStylish?.(theme) }),\n [customStylish],\n );\n\n const token = useCallback(\n (theme: CustomTokenParams) => ({ ...lobeCustomToken(theme), ...customToken?.(theme) }),\n [customToken],\n );\n\n const theme = useCallback<GetAntdTheme>(\n (appearance) => {\n const lobeTheme = createLobeAntdTheme({\n appearance,\n neutralColor: customTheme.neutralColor,\n primaryColor: customTheme.primaryColor,\n });\n return merge(lobeTheme, antdTheme);\n },\n [customTheme.primaryColor, customTheme.neutralColor, antdTheme],\n );\n\n return (\n <>\n {enableCustomFonts &&\n webfontUrls?.length > 0 &&\n webfontUrls.map((webfont) => <FontLoader key={webfont} url={webfont} />)}\n <AntdThemeProvider<LobeCustomToken>\n customStylish={stylish}\n customToken={token}\n theme={theme}\n {...rest}\n >\n <AntdConfigProvider>\n {enableGlobalStyle && <GlobalStyle />}\n <App
|
|
1
|
+
{"version":3,"file":"ThemeProvider.mjs","names":["ThemeProvider","lobeCustomStylish","theme","lobeCustomToken","FontLoader","AntdThemeProvider","AntdConfigProvider","GlobalStyle"],"sources":["../../src/ThemeProvider/ThemeProvider.tsx"],"sourcesContent":["'use client';\n\nimport { App } from 'antd';\nimport {\n ThemeProvider as AntdThemeProvider,\n CustomStylishParams,\n CustomTokenParams,\n GetAntdTheme,\n} from 'antd-style';\nimport { merge } from 'es-toolkit/compat';\nimport { memo, useCallback, useMemo } from 'react';\n\nimport { useCdnFn } from '@/ConfigProvider';\nimport FontLoader from '@/FontLoader';\nimport { lobeCustomStylish, lobeCustomToken } from '@/styles';\nimport { createLobeAntdTheme } from '@/styles/theme/antdTheme';\nimport { LobeCustomToken } from '@/types/customToken';\n\nimport AntdConfigProvider from './ConfigProvider';\nimport { GlobalMouseDirectionProvider } from './GlobalMouseDirectionContext';\nimport GlobalStyle from './GlobalStyle';\nimport { LOBE_THEME_APP_ID } from './constants';\nimport type { ThemeProviderProps } from './type';\n\nconst ThemeProvider = memo<ThemeProviderProps>(\n ({\n children,\n customStylish,\n customToken,\n enableCustomFonts = true,\n enableGlobalStyle = true,\n customFonts,\n customTheme = {},\n className,\n style,\n theme: antdTheme,\n ...rest\n }) => {\n const genCdnUrl = useCdnFn();\n\n const webfontUrls = useMemo(\n () =>\n customFonts || [\n genCdnUrl({ path: 'css/index.css', pkg: '@lobehub/webfont-mono' }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans',\n }),\n genCdnUrl({\n path: 'css/index.css',\n pkg: '@lobehub/webfont-harmony-sans-sc',\n }),\n genCdnUrl({ path: 'dist/katex.min.css', pkg: 'katex' }),\n ],\n [customFonts, genCdnUrl],\n );\n\n const stylish = useCallback(\n (theme: CustomStylishParams) => ({ ...lobeCustomStylish(theme), ...customStylish?.(theme) }),\n [customStylish],\n );\n\n const token = useCallback(\n (theme: CustomTokenParams) => ({ ...lobeCustomToken(theme), ...customToken?.(theme) }),\n [customToken],\n );\n\n const theme = useCallback<GetAntdTheme>(\n (appearance) => {\n const lobeTheme = createLobeAntdTheme({\n appearance,\n neutralColor: customTheme.neutralColor,\n primaryColor: customTheme.primaryColor,\n });\n return merge(lobeTheme, antdTheme);\n },\n [customTheme.primaryColor, customTheme.neutralColor, antdTheme],\n );\n\n return (\n <>\n {enableCustomFonts &&\n webfontUrls?.length > 0 &&\n webfontUrls.map((webfont) => <FontLoader key={webfont} url={webfont} />)}\n <AntdThemeProvider<LobeCustomToken>\n customStylish={stylish}\n customToken={token}\n theme={theme}\n {...rest}\n >\n <AntdConfigProvider>\n {enableGlobalStyle && <GlobalStyle />}\n <GlobalMouseDirectionProvider>\n <App\n className={className}\n style={{ minHeight: 'inherit', width: 'inherit', ...style }}\n >\n <div id={LOBE_THEME_APP_ID} style={{ display: 'contents' }}>\n {children}\n </div>\n </App>\n </GlobalMouseDirectionProvider>\n </AntdConfigProvider>\n </AntdThemeProvider>\n </>\n );\n },\n);\n\nThemeProvider.displayName = 'LobeThemeProvider';\n\nexport default ThemeProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAwBA,MAAMA,kBAAgB,MACnB,EACC,UACA,eACA,aACA,oBAAoB,MACpB,oBAAoB,MACpB,aACA,cAAc,EAAE,EAChB,WACA,OACA,OAAO,WACP,GAAG,WACC;CACJ,MAAM,YAAY,UAAU;CAE5B,MAAM,cAAc,cAEhB,eAAe;EACb,UAAU;GAAE,MAAM;GAAiB,KAAK;GAAyB,CAAC;EAClE,UAAU;GACR,MAAM;GACN,KAAK;GACN,CAAC;EACF,UAAU;GACR,MAAM;GACN,KAAK;GACN,CAAC;EACF,UAAU;GAAE,MAAM;GAAsB,KAAK;GAAS,CAAC;EACxD,EACH,CAAC,aAAa,UAAU,CACzB;CAED,MAAM,UAAU,aACb,aAAgC;EAAE,GAAGC,sBAAkBC,QAAM;EAAE,GAAG,gBAAgBA,QAAM;EAAE,GAC3F,CAAC,cAAc,CAChB;CAED,MAAM,QAAQ,aACX,aAA8B;EAAE,GAAGC,oBAAgBD,QAAM;EAAE,GAAG,cAAcA,QAAM;EAAE,GACrF,CAAC,YAAY,CACd;CAED,MAAM,QAAQ,aACX,eAAe;AAMd,SAAO,MALW,oBAAoB;GACpC;GACA,cAAc,YAAY;GAC1B,cAAc,YAAY;GAC3B,CAAC,EACsB,UAAU;IAEpC;EAAC,YAAY;EAAc,YAAY;EAAc;EAAU,CAChE;AAED,QACE,8CACG,qBACC,aAAa,SAAS,KACtB,YAAY,KAAK,YAAY,oBAACE,sBAAyB,KAAK,WAAd,QAAyB,CAAC,EAC1E,oBAACC;EACC,eAAe;EACf,aAAa;EACN;EACP,GAAI;YAEJ,qBAACC,qCACE,qBAAqB,oBAACC,wBAAc,EACrC,oBAAC,0CACC,oBAAC;GACY;GACX,OAAO;IAAE,WAAW;IAAW,OAAO;IAAW,GAAG;IAAO;aAE3D,oBAAC;IAAI,IAAI;IAAmB,OAAO,EAAE,SAAS,YAAY;IACvD;KACG;IACF,GACuB,IACZ;GACH,IACnB;EAGR;AAED,gBAAc,cAAc;AAE5B,4BAAeP"}
|
package/es/Toc/Toc.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { TocProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react30 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Toc/Toc.d.ts
|
|
5
|
-
declare const Toc:
|
|
5
|
+
declare const Toc: react30.NamedExoticComponent<TocProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Toc };
|
|
8
8
|
//# sourceMappingURL=Toc.d.mts.map
|
|
@@ -4,7 +4,7 @@ import { useMotionComponent } from "../MotionProvider/index.mjs";
|
|
|
4
4
|
import FlexBasic_default from "../Flex/FlexBasic.mjs";
|
|
5
5
|
import Hotkey_default from "../Hotkey/Hotkey.mjs";
|
|
6
6
|
import { styles } from "./style.mjs";
|
|
7
|
-
import
|
|
7
|
+
import { useMemo } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { cx } from "antd-style";
|
|
10
10
|
import { AnimatePresence } from "motion/react";
|
|
@@ -12,21 +12,61 @@ import { FloatingArrow } from "@floating-ui/react";
|
|
|
12
12
|
import { useDebounce } from "ahooks";
|
|
13
13
|
|
|
14
14
|
//#region src/Tooltip/TooltipFloating.tsx
|
|
15
|
-
const
|
|
15
|
+
const tooltipAnimateState = {
|
|
16
|
+
opacity: 1,
|
|
17
|
+
scale: 1,
|
|
18
|
+
y: 0
|
|
19
|
+
};
|
|
20
|
+
const tooltipExitState = {
|
|
21
|
+
opacity: 0,
|
|
22
|
+
scale: .98,
|
|
23
|
+
y: 4
|
|
24
|
+
};
|
|
25
|
+
const tooltipInitialState = {
|
|
26
|
+
opacity: 0,
|
|
27
|
+
scale: .96,
|
|
28
|
+
y: 6
|
|
29
|
+
};
|
|
30
|
+
const tooltipTransition = {
|
|
31
|
+
duration: .14,
|
|
32
|
+
ease: [
|
|
33
|
+
.4,
|
|
34
|
+
0,
|
|
35
|
+
.2,
|
|
36
|
+
1
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
const contentAnimateState = { opacity: 1 };
|
|
40
|
+
const contentExitState = { opacity: 0 };
|
|
41
|
+
const contentInitialState = { opacity: 0 };
|
|
42
|
+
const contentTransition = { duration: .3 };
|
|
43
|
+
const TooltipFloating = ({ open, title, placement, floatingStyles, setFloating, floatingProps, arrow: arrow$1, arrowRef, context, hotkey, hotkeyProps, isInitialShow, layoutAnimation = true, className, classNames, styles: styleProps, zIndex }) => {
|
|
44
|
+
const basePlacement = String(placement || "top").split("-")[0];
|
|
16
45
|
const transformOrigin = useMemo(() => {
|
|
17
|
-
switch (
|
|
46
|
+
switch (basePlacement) {
|
|
18
47
|
case "top": return "bottom center";
|
|
19
48
|
case "bottom": return "top center";
|
|
20
49
|
case "left": return "center right";
|
|
21
50
|
case "right": return "center left";
|
|
22
51
|
default: return "center";
|
|
23
52
|
}
|
|
24
|
-
}, [
|
|
53
|
+
}, [basePlacement]);
|
|
25
54
|
const hasTransform = useDebounce(Boolean(floatingStyles?.transform), {
|
|
26
55
|
leading: false,
|
|
27
56
|
wait: 16
|
|
28
57
|
});
|
|
29
58
|
const Motion = useMotionComponent();
|
|
59
|
+
const TooltipContent = hotkey ? /* @__PURE__ */ jsxs(FlexBasic_default, {
|
|
60
|
+
align: "center",
|
|
61
|
+
gap: 8,
|
|
62
|
+
horizontal: true,
|
|
63
|
+
justify: "space-between",
|
|
64
|
+
children: [/* @__PURE__ */ jsx("span", { children: title }), /* @__PURE__ */ jsx(Hotkey_default, {
|
|
65
|
+
inverseTheme: true,
|
|
66
|
+
keys: hotkey,
|
|
67
|
+
...hotkeyProps
|
|
68
|
+
})]
|
|
69
|
+
}) : title;
|
|
30
70
|
return /* @__PURE__ */ jsx(AnimatePresence, { children: open && title && /* @__PURE__ */ jsx("div", {
|
|
31
71
|
className: cx(styles.tooltip, layoutAnimation && hasTransform && styles.tooltipLayout, classNames?.container, classNames?.root, className),
|
|
32
72
|
ref: setFloating,
|
|
@@ -43,42 +83,24 @@ const TooltipFloating = ({ open, title, placement, floatingStyles, setFloating,
|
|
|
43
83
|
},
|
|
44
84
|
...floatingProps,
|
|
45
85
|
children: /* @__PURE__ */ jsxs(Motion.div, {
|
|
46
|
-
animate:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
exit: {
|
|
51
|
-
opacity: 0,
|
|
52
|
-
scale: .98
|
|
53
|
-
},
|
|
54
|
-
initial: {
|
|
55
|
-
opacity: 0,
|
|
56
|
-
scale: .96
|
|
57
|
-
},
|
|
86
|
+
animate: tooltipAnimateState,
|
|
87
|
+
exit: tooltipExitState,
|
|
88
|
+
initial: tooltipInitialState,
|
|
58
89
|
style: { transformOrigin },
|
|
59
|
-
transition:
|
|
60
|
-
duration: .12,
|
|
61
|
-
ease: [
|
|
62
|
-
.4,
|
|
63
|
-
0,
|
|
64
|
-
.2,
|
|
65
|
-
1
|
|
66
|
-
]
|
|
67
|
-
},
|
|
90
|
+
transition: tooltipTransition,
|
|
68
91
|
children: [/* @__PURE__ */ jsx("div", {
|
|
69
92
|
className: cx(styles.content, classNames?.content),
|
|
70
93
|
style: styleProps?.content,
|
|
71
|
-
children:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}) : title
|
|
94
|
+
children: layoutAnimation ? /* @__PURE__ */ jsx(AnimatePresence, {
|
|
95
|
+
mode: "popLayout",
|
|
96
|
+
children: /* @__PURE__ */ jsx(Motion.div, {
|
|
97
|
+
animate: contentAnimateState,
|
|
98
|
+
exit: contentExitState,
|
|
99
|
+
initial: isInitialShow ? false : contentInitialState,
|
|
100
|
+
transition: contentTransition,
|
|
101
|
+
children: TooltipContent
|
|
102
|
+
}, String(title))
|
|
103
|
+
}) : TooltipContent
|
|
82
104
|
}), arrow$1 && context && /* @__PURE__ */ jsx(FloatingArrow, {
|
|
83
105
|
className: cx(styles.arrow, classNames?.arrow),
|
|
84
106
|
context,
|