@lobehub/ui 4.11.0 → 4.11.2
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/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/StreamMermaid.mjs +2 -10
- package/es/Mermaid/SyntaxMermaid/StreamMermaid.mjs.map +1 -1
- 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/PopoverGroup.mjs +2 -2
- package/es/Popover/PopoverGroup.mjs.map +1 -1
- package/es/Popover/PopoverStandalone.mjs +1 -1
- package/es/Popover/PopoverStandalone.mjs.map +1 -1
- package/es/Popover/context.d.mts +2 -2
- package/es/Popover/groupContext.d.mts +1 -1
- package/es/Popover/groupContext.mjs.map +1 -1
- package/es/Popover/useMergedPopoverProps.mjs +1 -1
- package/es/Popover/useMergedPopoverProps.mjs.map +1 -1
- 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/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/GridShowcase.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/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/i18n/context.d.mts +2 -2
- package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
- 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 +2 -2
- package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
- package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
- 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 +3 -3
- package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
- 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 { LayoutTocProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react62 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Layout/components/LayoutToc.d.ts
|
|
5
|
-
declare const LayoutToc:
|
|
5
|
+
declare const LayoutToc: react62.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 react51 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/List/ListItem/index.d.ts
|
|
5
|
-
declare const ListItem:
|
|
5
|
+
declare const ListItem: react51.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 react43 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Markdown.d.ts
|
|
5
|
-
declare const Markdown:
|
|
5
|
+
declare const Markdown: react43.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 react39 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Markdown/Typography.d.ts
|
|
5
|
-
declare const Typography:
|
|
5
|
+
declare const Typography: react39.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 react9 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: react9.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 react40 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/MaskShadow/MaskShadow.d.ts
|
|
5
|
-
declare const MaskShadow:
|
|
5
|
+
declare const MaskShadow: react40.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 react38 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Menu/Menu.d.ts
|
|
5
|
-
declare const Menu:
|
|
5
|
+
declare const Menu: react38.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 react34 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/Mermaid.d.ts
|
|
5
|
-
declare const Mermaid:
|
|
5
|
+
declare const Mermaid: react34.NamedExoticComponent<MermaidProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Mermaid };
|
|
8
8
|
//# sourceMappingURL=Mermaid.d.mts.map
|
|
@@ -29,10 +29,7 @@ const StreamMermaid = memo(({ children, className, fallbackClassName, ref, style
|
|
|
29
29
|
}, [blobUrl]);
|
|
30
30
|
useEffect(() => {
|
|
31
31
|
if (isLoading || !data) {
|
|
32
|
-
|
|
33
|
-
URL.revokeObjectURL(blobUrl);
|
|
34
|
-
setBlobUrl(void 0);
|
|
35
|
-
}
|
|
32
|
+
setBlobUrl(void 0);
|
|
36
33
|
return;
|
|
37
34
|
}
|
|
38
35
|
let finalSvgString = data;
|
|
@@ -48,14 +45,9 @@ const StreamMermaid = memo(({ children, className, fallbackClassName, ref, style
|
|
|
48
45
|
finalSvgString = new XMLSerializer().serializeToString(svgDoc);
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
|
-
if (blobUrl) URL.revokeObjectURL(blobUrl);
|
|
52
48
|
const svgBlob = new Blob([finalSvgString], { type: "image/svg+xml" });
|
|
53
49
|
setBlobUrl(URL.createObjectURL(svgBlob));
|
|
54
|
-
}, [
|
|
55
|
-
isLoading,
|
|
56
|
-
data,
|
|
57
|
-
blobUrl
|
|
58
|
-
]);
|
|
50
|
+
}, [isLoading, data]);
|
|
59
51
|
if (!blobUrl) return /* @__PURE__ */ jsx("div", {
|
|
60
52
|
className: fallbackClassName,
|
|
61
53
|
style,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StreamMermaid.mjs","names":["Image"],"sources":["../../../src/Mermaid/SyntaxMermaid/StreamMermaid.tsx"],"sourcesContent":["'use client';\n\nimport { kebabCase } from 'es-toolkit/compat';\nimport { memo, useEffect, useId, useMemo, useState } from 'react';\nimport type { Ref } from 'react';\n\nimport Image from '@/Image';\nimport { useStreamMermaid } from '@/hooks/useStreamMermaid';\n\nimport { mermaidThemes } from '../const';\nimport type { SyntaxMermaidProps } from '../type';\n\ninterface StreamMermaidProps {\n children: string;\n className?: string;\n fallbackClassName?: string;\n ref?: Ref<HTMLDivElement>;\n style?: SyntaxMermaidProps['style'];\n theme?: SyntaxMermaidProps['theme'];\n variant?: SyntaxMermaidProps['variant'];\n}\n\nconst StreamMermaid = memo<StreamMermaidProps>(\n ({ children, className, fallbackClassName, ref, style, theme: customTheme, variant }) => {\n const safeChildren = children ?? '';\n const isDefaultTheme = customTheme === 'lobe-theme' || !customTheme;\n\n const background = useMemo(() => {\n if (isDefaultTheme) return;\n return mermaidThemes.find((item) => item.id === customTheme)?.background;\n }, [isDefaultTheme, customTheme]);\n\n const id = useId();\n const mermaidId = kebabCase(`mermaid-${id}`);\n const data = useStreamMermaid(safeChildren, {\n enabled: true,\n id: mermaidId,\n theme: isDefaultTheme ? undefined : customTheme,\n });\n const isLoading = !data;\n const [blobUrl, setBlobUrl] = useState<string>();\n\n // 组件卸载时清理 Blob URL,避免内存泄漏\n useEffect(() => {\n return () => {\n if (blobUrl) URL.revokeObjectURL(blobUrl);\n };\n }, [blobUrl]);\n\n useEffect(() => {\n if (isLoading || !data) {\n // Clear blob URL when loading or no data\n
|
|
1
|
+
{"version":3,"file":"StreamMermaid.mjs","names":["Image"],"sources":["../../../src/Mermaid/SyntaxMermaid/StreamMermaid.tsx"],"sourcesContent":["'use client';\n\nimport { kebabCase } from 'es-toolkit/compat';\nimport { memo, useEffect, useId, useMemo, useState } from 'react';\nimport type { Ref } from 'react';\n\nimport Image from '@/Image';\nimport { useStreamMermaid } from '@/hooks/useStreamMermaid';\n\nimport { mermaidThemes } from '../const';\nimport type { SyntaxMermaidProps } from '../type';\n\ninterface StreamMermaidProps {\n children: string;\n className?: string;\n fallbackClassName?: string;\n ref?: Ref<HTMLDivElement>;\n style?: SyntaxMermaidProps['style'];\n theme?: SyntaxMermaidProps['theme'];\n variant?: SyntaxMermaidProps['variant'];\n}\n\nconst StreamMermaid = memo<StreamMermaidProps>(\n ({ children, className, fallbackClassName, ref, style, theme: customTheme, variant }) => {\n const safeChildren = children ?? '';\n const isDefaultTheme = customTheme === 'lobe-theme' || !customTheme;\n\n const background = useMemo(() => {\n if (isDefaultTheme) return;\n return mermaidThemes.find((item) => item.id === customTheme)?.background;\n }, [isDefaultTheme, customTheme]);\n\n const id = useId();\n const mermaidId = kebabCase(`mermaid-${id}`);\n const data = useStreamMermaid(safeChildren, {\n enabled: true,\n id: mermaidId,\n theme: isDefaultTheme ? undefined : customTheme,\n });\n const isLoading = !data;\n const [blobUrl, setBlobUrl] = useState<string>();\n\n // 组件卸载时清理 Blob URL,避免内存泄漏\n useEffect(() => {\n return () => {\n if (blobUrl) URL.revokeObjectURL(blobUrl);\n };\n }, [blobUrl]);\n\n useEffect(() => {\n if (isLoading || !data) {\n // Clear blob URL when loading or no data\n setBlobUrl(undefined);\n return;\n }\n\n let finalSvgString = data;\n\n // 修复Firefox点击预览mermaid图时宽高为0导致不显示的异常\n if (\n typeof window !== 'undefined' &&\n typeof navigator !== 'undefined' &&\n navigator.userAgent.includes('Firefox')\n ) {\n const parser = new DOMParser();\n const svgDoc = parser.parseFromString(data, 'image/svg+xml');\n const svgElement = svgDoc.documentElement;\n if (svgElement && svgElement.hasAttribute('viewBox')) {\n const viewBox = svgElement.getAttribute('viewBox')!;\n const viewBoxParts = viewBox.split(' ');\n if (Array.isArray(viewBoxParts) && viewBoxParts.length === 4) {\n svgElement.setAttribute('width', viewBoxParts[2]);\n svgElement.setAttribute('height', viewBoxParts[3]);\n }\n finalSvgString = new XMLSerializer().serializeToString(svgDoc);\n }\n }\n\n // 创建Blob对象\n const svgBlob = new Blob([finalSvgString], { type: 'image/svg+xml' });\n // 创建并保存Blob URL\n const url = URL.createObjectURL(svgBlob);\n setBlobUrl(url);\n }, [isLoading, data]);\n\n if (!blobUrl) {\n return (\n <div className={fallbackClassName} style={style}>\n <div style={{ padding: 16 }}>Rendering...</div>\n </div>\n );\n }\n\n return (\n <Image\n alt={'mermaid'}\n className={className}\n maxHeight={480}\n minWidth={300}\n objectFit={'contain'}\n ref={ref}\n src={blobUrl}\n style={{\n background: variant === 'filled' ? background : undefined,\n borderRadius: 0,\n margin: 0,\n minWidth: 300,\n padding: variant === 'borderless' ? 0 : 16,\n position: 'relative',\n width: '100%',\n ...style,\n }}\n variant={'borderless'}\n width={'100%'}\n />\n );\n },\n);\n\nStreamMermaid.displayName = 'StreamMermaid';\n\nexport default StreamMermaid;\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,gBAAgB,MACnB,EAAE,UAAU,WAAW,mBAAmB,KAAK,OAAO,OAAO,aAAa,cAAc;CACvF,MAAM,eAAe,YAAY;CACjC,MAAM,iBAAiB,gBAAgB,gBAAgB,CAAC;CAExD,MAAM,aAAa,cAAc;AAC/B,MAAI,eAAgB;AACpB,SAAO,cAAc,MAAM,SAAS,KAAK,OAAO,YAAY,EAAE;IAC7D,CAAC,gBAAgB,YAAY,CAAC;CAIjC,MAAM,OAAO,iBAAiB,cAAc;EAC1C,SAAS;EACT,IAHgB,UAAU,WADjB,OAAO,GAC0B;EAI1C,OAAO,iBAAiB,SAAY;EACrC,CAAC;CACF,MAAM,YAAY,CAAC;CACnB,MAAM,CAAC,SAAS,cAAc,UAAkB;AAGhD,iBAAgB;AACd,eAAa;AACX,OAAI,QAAS,KAAI,gBAAgB,QAAQ;;IAE1C,CAAC,QAAQ,CAAC;AAEb,iBAAgB;AACd,MAAI,aAAa,CAAC,MAAM;AAEtB,cAAW,OAAU;AACrB;;EAGF,IAAI,iBAAiB;AAGrB,MACE,OAAO,WAAW,eAClB,OAAO,cAAc,eACrB,UAAU,UAAU,SAAS,UAAU,EACvC;GAEA,MAAM,SADS,IAAI,WAAW,CACR,gBAAgB,MAAM,gBAAgB;GAC5D,MAAM,aAAa,OAAO;AAC1B,OAAI,cAAc,WAAW,aAAa,UAAU,EAAE;IAEpD,MAAM,eADU,WAAW,aAAa,UAAU,CACrB,MAAM,IAAI;AACvC,QAAI,MAAM,QAAQ,aAAa,IAAI,aAAa,WAAW,GAAG;AAC5D,gBAAW,aAAa,SAAS,aAAa,GAAG;AACjD,gBAAW,aAAa,UAAU,aAAa,GAAG;;AAEpD,qBAAiB,IAAI,eAAe,CAAC,kBAAkB,OAAO;;;EAKlE,MAAM,UAAU,IAAI,KAAK,CAAC,eAAe,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAGrE,aADY,IAAI,gBAAgB,QAAQ,CACzB;IACd,CAAC,WAAW,KAAK,CAAC;AAErB,KAAI,CAAC,QACH,QACE,oBAAC;EAAI,WAAW;EAA0B;YACxC,oBAAC;GAAI,OAAO,EAAE,SAAS,IAAI;aAAE;IAAkB;GAC3C;AAIV,QACE,oBAACA;EACC,KAAK;EACM;EACX,WAAW;EACX,UAAU;EACV,WAAW;EACN;EACL,KAAK;EACL,OAAO;GACL,YAAY,YAAY,WAAW,aAAa;GAChD,cAAc;GACd,QAAQ;GACR,UAAU;GACV,SAAS,YAAY,eAAe,IAAI;GACxC,UAAU;GACV,OAAO;GACP,GAAG;GACJ;EACD,SAAS;EACT,OAAO;GACP;EAGP;AAED,cAAc,cAAc;AAE5B,4BAAe"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SyntaxMermaidProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react35 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Mermaid/SyntaxMermaid/index.d.ts
|
|
5
|
-
declare const SyntaxMermaid:
|
|
5
|
+
declare const SyntaxMermaid: react35.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 react30 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Modal/Modal.d.ts
|
|
5
|
-
declare const Modal:
|
|
5
|
+
declare const Modal: react30.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 react31 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: react31.NamedExoticComponent<{
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
value: ModalContextValue;
|
|
9
9
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react0 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: react0.NamedExoticComponent<{
|
|
10
10
|
children: ReactNode;
|
|
11
11
|
motion: MotionComponentType;
|
|
12
12
|
}>;
|
|
@@ -13,7 +13,7 @@ import { cx } from "antd-style";
|
|
|
13
13
|
import { Popover } from "@base-ui/react/popover";
|
|
14
14
|
|
|
15
15
|
//#region src/Popover/PopoverGroup.tsx
|
|
16
|
-
const PopoverGroup = ({ children, contentLayoutAnimation =
|
|
16
|
+
const PopoverGroup = ({ children, contentLayoutAnimation = false, ...sharedProps }) => {
|
|
17
17
|
const handle = useMemo(() => Popover.createHandle(), []);
|
|
18
18
|
const activeItemRef = useRef(null);
|
|
19
19
|
const close = useCallback(() => {
|
|
@@ -35,7 +35,7 @@ const PopoverGroup = ({ children, contentLayoutAnimation = true, ...sharedProps
|
|
|
35
35
|
const item = payload ?? null;
|
|
36
36
|
activeItemRef.current = item;
|
|
37
37
|
if (!item?.content) return null;
|
|
38
|
-
const arrow = item.inset ? false : item.arrow ??
|
|
38
|
+
const arrow = item.inset ? false : item.arrow ?? false;
|
|
39
39
|
const placement = item.placement ?? "top";
|
|
40
40
|
const { openOnHover } = parseTrigger(item.trigger ?? "hover");
|
|
41
41
|
const placementConfig = placementMap[placement] ?? placementMap.top;
|
|
@@ -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 =
|
|
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;C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ACC,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;;KAGa;IACe;GACD;;AAIzC,aAAa,cAAc;AAE3B,2BAAe"}
|
|
@@ -20,7 +20,7 @@ import { Popover } from "@base-ui/react/popover";
|
|
|
20
20
|
* Popover component - displays floating content relative to a trigger element
|
|
21
21
|
* Compatible with Ant Design Popover API
|
|
22
22
|
*/
|
|
23
|
-
const PopoverStandalone = memo(({ children, content, arrow: originArrow =
|
|
23
|
+
const PopoverStandalone = memo(({ children, content, arrow: originArrow = false, inset = false, trigger = "hover", placement = "top", styles: styleProps, classNames, className, open, onOpenChange, defaultOpen = false, mouseEnterDelay = .1, mouseLeaveDelay = .1, openDelay, closeDelay, portalled = true, getPopupContainer, disabled = false, zIndex, nativeButton, ref: refProp }) => {
|
|
24
24
|
const arrow = inset ? false : originArrow;
|
|
25
25
|
const isClient = useIsClient();
|
|
26
26
|
const popoverHandle = useMemo(() => Popover.createHandle(), []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PopoverStandalone.mjs","names":["BasePopover"],"sources":["../../src/Popover/PopoverStandalone.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Popover as BasePopover } from '@base-ui/react/popover';\nimport type { Side } from '@base-ui/react/utils/useAnchorPositioning';\nimport { cx } from 'antd-style';\nimport { cloneElement, isValidElement, memo, useCallback, useMemo, useState } from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { placementMap } from '@/utils/placement';\n\nimport { PopoverArrowIcon } from './ArrowIcon';\nimport { usePopoverPortalContainer } from './PopoverPortal';\nimport { PopoverProvider } from './context';\nimport { parseTrigger } from './parseTrigger';\nimport { styles } from './style';\nimport type { PopoverProps } from './type';\n\n/**\n * Popover component - displays floating content relative to a trigger element\n * Compatible with Ant Design Popover API\n */\nexport const PopoverStandalone = memo<PopoverProps>(\n ({\n children,\n content,\n arrow: originArrow = true,\n inset = false,\n trigger = 'hover',\n placement = 'top',\n styles: styleProps,\n classNames,\n className,\n open,\n onOpenChange,\n defaultOpen = false,\n mouseEnterDelay = 0.1,\n mouseLeaveDelay = 0.1,\n openDelay,\n closeDelay,\n portalled = true,\n getPopupContainer,\n disabled = false,\n zIndex,\n nativeButton,\n ref: refProp,\n }) => {\n const arrow = inset ? false : originArrow;\n const isClient = useIsClient();\n const popoverHandle = useMemo(() => BasePopover.createHandle(), []);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(Boolean(defaultOpen));\n const close = useCallback(() => {\n popoverHandle.close();\n }, [popoverHandle]);\n const contextValue = useMemo(() => ({ close }), [close]);\n\n const mergedOpen = open ?? uncontrolledOpen;\n const resolvedOpen = disabled ? false : mergedOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n // Don't open if disabled\n if (disabled && nextOpen) return;\n\n onOpenChange?.(nextOpen);\n if (open === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n },\n [onOpenChange, open, disabled],\n );\n\n // Parse trigger mode\n const { openOnHover } = useMemo(() => parseTrigger(trigger), [trigger]);\n\n // Calculate delays (milliseconds take precedence over seconds)\n const resolvedOpenDelay = openDelay ?? mouseEnterDelay * 1000;\n const resolvedCloseDelay = closeDelay ?? mouseLeaveDelay * 1000;\n\n // Get placement configuration\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 10 : 6;\n const resolvedSideOffset = useMemo(() => {\n if (!inset) return baseSideOffset;\n return ({\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, inset]);\n\n // Determine portal container\n const portalContainer = usePopoverPortalContainer();\n\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const resolvedClassNames = useMemo(\n () => ({\n arrow: cx(styles.arrow, classNames?.arrow),\n popup: cx(styles.popup, className),\n positioner: cx(styles.positioner, classNames?.root),\n trigger: classNames?.trigger,\n viewport: cx(styles.viewport, classNames?.content),\n }),\n [className, classNames?.arrow, classNames?.content, classNames?.root, classNames?.trigger],\n );\n\n // Render trigger element\n const triggerElement = useMemo(() => {\n const triggerProps = {\n closeDelay: resolvedCloseDelay,\n delay: resolvedOpenDelay,\n disabled,\n openOnHover: openOnHover && !disabled,\n };\n\n if (isValidElement(children)) {\n return (\n <BasePopover.Trigger\n handle={popoverHandle}\n {...triggerProps}\n nativeButton={resolvedNativeButton}\n render={(props) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars\n const { type, ref: triggerRef, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n className: cx(mergedProps.className, resolvedClassNames.trigger),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n }}\n />\n );\n }\n return (\n <BasePopover.Trigger\n handle={popoverHandle}\n {...triggerProps}\n className={resolvedClassNames.trigger}\n nativeButton={resolvedNativeButton}\n ref={refProp}\n >\n {children}\n </BasePopover.Trigger>\n );\n }, [\n children,\n disabled,\n isNativeButtonTriggerElement,\n openOnHover,\n popoverHandle,\n refProp,\n resolvedClassNames.trigger,\n resolvedNativeButton,\n resolvedOpenDelay,\n resolvedCloseDelay,\n ]);\n\n // Custom container from getPopupContainer\n const customContainer = useMemo(() => {\n if (!getPopupContainer || !isClient) return undefined;\n // We need a reference element, but we don't have it until render\n // This will be handled by the portal container logic\n return undefined;\n }, [getPopupContainer, isClient]);\n\n const resolvedStyles = useMemo(\n () => ({\n arrow: styleProps?.arrow,\n positioner: {\n ...styleProps?.root,\n zIndex: zIndex ?? 1100,\n },\n viewport: styleProps?.content,\n }),\n [styleProps?.arrow, styleProps?.content, styleProps?.root, zIndex],\n );\n\n const popup = useMemo(\n () => (\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 className={resolvedClassNames.arrow} style={resolvedStyles.arrow}>\n {PopoverArrowIcon}\n </BasePopover.Arrow>\n )}\n <BasePopover.Viewport\n className={resolvedClassNames.viewport}\n style={resolvedStyles.viewport}\n >\n <PopoverProvider value={contextValue}>{content}</PopoverProvider>\n </BasePopover.Viewport>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n ),\n [\n arrow,\n content,\n contextValue,\n openOnHover,\n placement,\n placementConfig.align,\n placementConfig.side,\n resolvedClassNames,\n resolvedSideOffset,\n resolvedStyles,\n ],\n );\n\n // Don't render popup if no content\n if (!content) {\n return children;\n }\n\n const resolvedPortalContainer = customContainer ?? portalContainer;\n\n return (\n <BasePopover.Root\n defaultOpen={defaultOpen}\n handle={popoverHandle}\n onOpenChange={handleOpenChange}\n open={resolvedOpen}\n >\n {triggerElement}\n {portalled ? (\n resolvedPortalContainer ? (\n <BasePopover.Portal container={resolvedPortalContainer}>{popup}</BasePopover.Portal>\n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mB,SAAS,CAAC;CAEjC,MAAM,iBAAiB,eACd;EACL,OAAO,YAAY;EACnB,YAAY;GACV,GAAG,YAAY;GACf,QAAQ,UAAU;GACnB;EACD,UAAU,YAAY;EACvB,GACD;EAAC,YAAY;EAAO,YAAY;EAAS,YAAY;EAAM;EAAO,CACnE;CAED,MAAM,QAAQ,cAEV,oBAACA,QAAY;EACX,OAAO,gBAAgB;EACvB,WAAW,mBAAmB;EAC9B,sBAAoB,eAAe;EACnC,kBAAgB;EAChB,MAAM,gBAAgB;EACtB,YAAY;EACZ,OAAO,eAAe;YAEtB,qBAACA,QAAY;GAAM,WAAW,mBAAmB;cAC9C,SACC,oBAACA,QAAY;IAAM,WAAW,mBAAmB;IAAO,OAAO,eAAe;cAC3E;KACiB,EAEtB,oBAACA,QAAY;IACX,WAAW,mBAAmB;IAC9B,OAAO,eAAe;cAEtB,oBAAC;KAAgB,OAAO;eAAe;MAA0B;KAC5C;IACL;GACG,EAE3B;EACE;EACA;EACA;EACA;EACA;EACA,gBAAgB;EAChB,gBAAgB;EAChB;EACA;EACA;EACD,CACF;AAGD,KAAI,CAAC,QACH,QAAO;CAGT,MAAM,0BAA0B,mBAAmB;AAEnD,QACE,qBAACA,QAAY;EACE;EACb,QAAQ;EACR,cAAc;EACd,MAAM;aAEL,gBACA,YACC,0BACE,oBAACA,QAAY;GAAO,WAAW;aAA0B;IAA2B,GAClF,OAEJ;GAEe;EAGxB;AAED,kBAAkB,cAAc"}
|
|
1
|
+
{"version":3,"file":"PopoverStandalone.mjs","names":["BasePopover"],"sources":["../../src/Popover/PopoverStandalone.tsx"],"sourcesContent":["'use client';\n\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { Popover as BasePopover } from '@base-ui/react/popover';\nimport type { Side } from '@base-ui/react/utils/useAnchorPositioning';\nimport { cx } from 'antd-style';\nimport { cloneElement, isValidElement, memo, useCallback, useMemo, useState } from 'react';\nimport { mergeRefs } from 'react-merge-refs';\n\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useNativeButton } from '@/hooks/useNativeButton';\nimport { placementMap } from '@/utils/placement';\n\nimport { PopoverArrowIcon } from './ArrowIcon';\nimport { usePopoverPortalContainer } from './PopoverPortal';\nimport { PopoverProvider } from './context';\nimport { parseTrigger } from './parseTrigger';\nimport { styles } from './style';\nimport type { PopoverProps } from './type';\n\n/**\n * Popover component - displays floating content relative to a trigger element\n * Compatible with Ant Design Popover API\n */\nexport const PopoverStandalone = memo<PopoverProps>(\n ({\n children,\n content,\n arrow: originArrow = false,\n inset = false,\n trigger = 'hover',\n placement = 'top',\n styles: styleProps,\n classNames,\n className,\n open,\n onOpenChange,\n defaultOpen = false,\n mouseEnterDelay = 0.1,\n mouseLeaveDelay = 0.1,\n openDelay,\n closeDelay,\n portalled = true,\n getPopupContainer,\n disabled = false,\n zIndex,\n nativeButton,\n ref: refProp,\n }) => {\n const arrow = inset ? false : originArrow;\n const isClient = useIsClient();\n const popoverHandle = useMemo(() => BasePopover.createHandle(), []);\n const [uncontrolledOpen, setUncontrolledOpen] = useState(Boolean(defaultOpen));\n const close = useCallback(() => {\n popoverHandle.close();\n }, [popoverHandle]);\n const contextValue = useMemo(() => ({ close }), [close]);\n\n const mergedOpen = open ?? uncontrolledOpen;\n const resolvedOpen = disabled ? false : mergedOpen;\n\n const handleOpenChange = useCallback(\n (nextOpen: boolean) => {\n // Don't open if disabled\n if (disabled && nextOpen) return;\n\n onOpenChange?.(nextOpen);\n if (open === undefined) {\n setUncontrolledOpen(nextOpen);\n }\n },\n [onOpenChange, open, disabled],\n );\n\n // Parse trigger mode\n const { openOnHover } = useMemo(() => parseTrigger(trigger), [trigger]);\n\n // Calculate delays (milliseconds take precedence over seconds)\n const resolvedOpenDelay = openDelay ?? mouseEnterDelay * 1000;\n const resolvedCloseDelay = closeDelay ?? mouseLeaveDelay * 1000;\n\n // Get placement configuration\n const placementConfig = placementMap[placement] ?? placementMap.top;\n const baseSideOffset = arrow ? 10 : 6;\n const resolvedSideOffset = useMemo(() => {\n if (!inset) return baseSideOffset;\n return ({\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, inset]);\n\n // Determine portal container\n const portalContainer = usePopoverPortalContainer();\n\n const { isNativeButtonTriggerElement, resolvedNativeButton } = useNativeButton({\n children,\n nativeButton,\n });\n\n const resolvedClassNames = useMemo(\n () => ({\n arrow: cx(styles.arrow, classNames?.arrow),\n popup: cx(styles.popup, className),\n positioner: cx(styles.positioner, classNames?.root),\n trigger: classNames?.trigger,\n viewport: cx(styles.viewport, classNames?.content),\n }),\n [className, classNames?.arrow, classNames?.content, classNames?.root, classNames?.trigger],\n );\n\n // Render trigger element\n const triggerElement = useMemo(() => {\n const triggerProps = {\n closeDelay: resolvedCloseDelay,\n delay: resolvedOpenDelay,\n disabled,\n openOnHover: openOnHover && !disabled,\n };\n\n if (isValidElement(children)) {\n return (\n <BasePopover.Trigger\n handle={popoverHandle}\n {...triggerProps}\n nativeButton={resolvedNativeButton}\n render={(props) => {\n // Base UI's trigger props include `type=\"button\"` by default.\n // If we render into a non-<button> element, that prop is invalid and can warn.\n const resolvedProps = (() => {\n if (isNativeButtonTriggerElement) return props as any;\n // eslint-disable-next-line unused-imports/no-unused-vars, @typescript-eslint/no-unused-vars\n const { type, ref: triggerRef, ...restProps } = props as any;\n return restProps;\n })();\n\n const mergedProps = mergeProps((children as any).props, resolvedProps);\n return cloneElement(children as any, {\n ...mergedProps,\n className: cx(mergedProps.className, resolvedClassNames.trigger),\n ref: mergeRefs([(children as any).ref, (props as any).ref, refProp]),\n });\n }}\n />\n );\n }\n return (\n <BasePopover.Trigger\n handle={popoverHandle}\n {...triggerProps}\n className={resolvedClassNames.trigger}\n nativeButton={resolvedNativeButton}\n ref={refProp}\n >\n {children}\n </BasePopover.Trigger>\n );\n }, [\n children,\n disabled,\n isNativeButtonTriggerElement,\n openOnHover,\n popoverHandle,\n refProp,\n resolvedClassNames.trigger,\n resolvedNativeButton,\n resolvedOpenDelay,\n resolvedCloseDelay,\n ]);\n\n // Custom container from getPopupContainer\n const customContainer = useMemo(() => {\n if (!getPopupContainer || !isClient) return undefined;\n // We need a reference element, but we don't have it until render\n // This will be handled by the portal container logic\n return undefined;\n }, [getPopupContainer, isClient]);\n\n const resolvedStyles = useMemo(\n () => ({\n arrow: styleProps?.arrow,\n positioner: {\n ...styleProps?.root,\n zIndex: zIndex ?? 1100,\n },\n viewport: styleProps?.content,\n }),\n [styleProps?.arrow, styleProps?.content, styleProps?.root, zIndex],\n );\n\n const popup = useMemo(\n () => (\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 className={resolvedClassNames.arrow} style={resolvedStyles.arrow}>\n {PopoverArrowIcon}\n </BasePopover.Arrow>\n )}\n <BasePopover.Viewport\n className={resolvedClassNames.viewport}\n style={resolvedStyles.viewport}\n >\n <PopoverProvider value={contextValue}>{content}</PopoverProvider>\n </BasePopover.Viewport>\n </BasePopover.Popup>\n </BasePopover.Positioner>\n ),\n [\n arrow,\n content,\n contextValue,\n openOnHover,\n placement,\n placementConfig.align,\n placementConfig.side,\n resolvedClassNames,\n resolvedSideOffset,\n resolvedStyles,\n ],\n );\n\n // Don't render popup if no content\n if (!content) {\n return children;\n }\n\n const resolvedPortalContainer = customContainer ?? portalContainer;\n\n return (\n <BasePopover.Root\n defaultOpen={defaultOpen}\n handle={popoverHandle}\n onOpenChange={handleOpenChange}\n open={resolvedOpen}\n >\n {triggerElement}\n {portalled ? (\n resolvedPortalContainer ? (\n <BasePopover.Portal container={resolvedPortalContainer}>{popup}</BasePopover.Port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mBAAmB,SAAS,CAAC;CAEjC,MAAM,iBAAiB,eACd;EACL,OAAO,YAAY;EACnB,YAAY;GACV,GAAG,YAAY;GACf,QAAQ,UAAU;GACnB;EACD,UAAU,YAAY;EACvB,GACD;EAAC,YAAY;EAAO,YAAY;EAAS,YAAY;EAAM;EAAO,CACnE;CAED,MAAM,QAAQ,cAEV,oBAACA,QAAY;EACX,OAAO,gBAAgB;EACvB,WAAW,mBAAmB;EAC9B,sBAAoB,eAAe;EACnC,kBAAgB;EAChB,MAAM,gBAAgB;EACtB,YAAY;EACZ,OAAO,eAAe;YAEtB,qBAACA,QAAY;GAAM,WAAW,mBAAmB;cAC9C,SACC,oBAACA,QAAY;IAAM,WAAW,mBAAmB;IAAO,OAAO,eAAe;cAC3E;KACiB,EAEtB,oBAACA,QAAY;IACX,WAAW,mBAAmB;IAC9B,OAAO,eAAe;cAEtB,oBAAC;KAAgB,OAAO;eAAe;MAA0B;KAC5C;IACL;GACG,EAE3B;EACE;EACA;EACA;EACA;EACA;EACA,gBAAgB;EAChB,gBAAgB;EAChB;EACA;EACA;EACD,CACF;AAGD,KAAI,CAAC,QACH,QAAO;CAGT,MAAM,0BAA0B,mBAAmB;AAEnD,QACE,qBAACA,QAAY;EACE;EACb,QAAQ;EACR,cAAc;EACd,MAAM;aAEL,gBACA,YACC,0BACE,oBAACA,QAAY;GAAO,WAAW;aAA0B;IAA2B,GAClF,OAEJ;GAEe;EAGxB;AAED,kBAAkB,cAAc"}
|
package/es/Popover/context.d.mts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react36 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: react36.NamedExoticComponent<{
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
value: PopoverContextValue;
|
|
11
11
|
}>;
|
|
@@ -5,7 +5,7 @@ import "react";
|
|
|
5
5
|
type PopoverGroupSharedProps = Omit<PopoverProps, 'children' | 'content' | 'defaultOpen' | 'open' | 'ref'> & {
|
|
6
6
|
/**
|
|
7
7
|
* @description Whether to enable content layout animation when switching triggers
|
|
8
|
-
* @default
|
|
8
|
+
* @default false
|
|
9
9
|
*/
|
|
10
10
|
contentLayoutAnimation?: boolean;
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groupContext.mjs","names":[],"sources":["../../src/Popover/groupContext.ts"],"sourcesContent":["'use client';\n\nimport type { PopoverHandle } from '@base-ui/react/popover/store/PopoverHandle';\nimport { createContext } from 'react';\n\nimport type { PopoverProps } from './type';\n\nexport type PopoverGroupItem = Omit<PopoverProps, 'children' | 'open' | 'defaultOpen' | 'ref'>;\n\nexport type PopoverGroupSharedProps = Omit<\n PopoverProps,\n 'children' | 'content' | 'defaultOpen' | 'open' | 'ref'\n> & {\n /**\n * @description Whether to enable content layout animation when switching triggers\n * @default
|
|
1
|
+
{"version":3,"file":"groupContext.mjs","names":[],"sources":["../../src/Popover/groupContext.ts"],"sourcesContent":["'use client';\n\nimport type { PopoverHandle } from '@base-ui/react/popover/store/PopoverHandle';\nimport { createContext } from 'react';\n\nimport type { PopoverProps } from './type';\n\nexport type PopoverGroupItem = Omit<PopoverProps, 'children' | 'open' | 'defaultOpen' | 'ref'>;\n\nexport type PopoverGroupSharedProps = Omit<\n PopoverProps,\n 'children' | 'content' | 'defaultOpen' | 'open' | 'ref'\n> & {\n /**\n * @description Whether to enable content layout animation when switching triggers\n * @default false\n */\n contentLayoutAnimation?: boolean;\n};\n\nexport const PopoverGroupHandleContext = createContext<PopoverHandle<PopoverGroupItem> | null>(\n null,\n);\nexport const PopoverGroupPropsContext = createContext<PopoverGroupSharedProps | null>(null);\n"],"mappings":";;;;;AAoBA,MAAa,4BAA4B,cACvC,KACD;AACD,MAAa,2BAA2B,cAA8C,KAAK"}
|
|
@@ -33,7 +33,7 @@ const useMergedPopoverProps = (props) => {
|
|
|
33
33
|
};
|
|
34
34
|
}, [onOpenChange, sharedProps?.onOpenChange]);
|
|
35
35
|
return useMemo(() => ({
|
|
36
|
-
arrow: arrow ?? sharedProps?.arrow ??
|
|
36
|
+
arrow: arrow ?? sharedProps?.arrow ?? false,
|
|
37
37
|
className: mergedClassName,
|
|
38
38
|
classNames: mergedClassNames,
|
|
39
39
|
closeDelay: closeDelay ?? sharedProps?.closeDelay,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMergedPopoverProps.mjs","names":[],"sources":["../../src/Popover/useMergedPopoverProps.ts"],"sourcesContent":["'use client';\n\nimport { useContext, useMemo } from 'react';\n\nimport { type PopoverGroupItem, PopoverGroupPropsContext } from './groupContext';\nimport type { PopoverProps } from './type';\n\nexport const useMergedPopoverProps = (props: Partial<PopoverProps>): PopoverGroupItem => {\n const sharedProps = useContext(PopoverGroupPropsContext);\n\n const {\n arrow,\n inset,\n trigger,\n placement,\n className,\n classNames,\n styles: styleProps,\n onOpenChange,\n content,\n closeDelay,\n disabled,\n getPopupContainer,\n mouseEnterDelay,\n mouseLeaveDelay,\n nativeButton,\n openDelay,\n portalled,\n zIndex,\n } = props;\n\n const mergedClassName = useMemo(() => {\n if (!sharedProps?.className && !className) return undefined;\n return [sharedProps?.className, className].filter(Boolean).join(' ');\n }, [className, sharedProps?.className]);\n\n const mergedClassNames = useMemo(() => {\n if (!sharedProps?.classNames && !classNames) return undefined;\n return { ...sharedProps?.classNames, ...classNames };\n }, [classNames, sharedProps?.classNames]);\n\n const mergedStyles = useMemo(() => {\n if (!sharedProps?.styles && !styleProps) return undefined;\n return { ...sharedProps?.styles, ...styleProps };\n }, [sharedProps?.styles, styleProps]);\n\n const mergedOnOpenChange = useMemo(() => {\n if (!sharedProps?.onOpenChange && !onOpenChange) return undefined;\n return (open: boolean) => {\n sharedProps?.onOpenChange?.(open);\n onOpenChange?.(open);\n };\n }, [onOpenChange, sharedProps?.onOpenChange]);\n\n const item: PopoverGroupItem = useMemo(\n () => ({\n arrow: arrow ?? sharedProps?.arrow ??
|
|
1
|
+
{"version":3,"file":"useMergedPopoverProps.mjs","names":[],"sources":["../../src/Popover/useMergedPopoverProps.ts"],"sourcesContent":["'use client';\n\nimport { useContext, useMemo } from 'react';\n\nimport { type PopoverGroupItem, PopoverGroupPropsContext } from './groupContext';\nimport type { PopoverProps } from './type';\n\nexport const useMergedPopoverProps = (props: Partial<PopoverProps>): PopoverGroupItem => {\n const sharedProps = useContext(PopoverGroupPropsContext);\n\n const {\n arrow,\n inset,\n trigger,\n placement,\n className,\n classNames,\n styles: styleProps,\n onOpenChange,\n content,\n closeDelay,\n disabled,\n getPopupContainer,\n mouseEnterDelay,\n mouseLeaveDelay,\n nativeButton,\n openDelay,\n portalled,\n zIndex,\n } = props;\n\n const mergedClassName = useMemo(() => {\n if (!sharedProps?.className && !className) return undefined;\n return [sharedProps?.className, className].filter(Boolean).join(' ');\n }, [className, sharedProps?.className]);\n\n const mergedClassNames = useMemo(() => {\n if (!sharedProps?.classNames && !classNames) return undefined;\n return { ...sharedProps?.classNames, ...classNames };\n }, [classNames, sharedProps?.classNames]);\n\n const mergedStyles = useMemo(() => {\n if (!sharedProps?.styles && !styleProps) return undefined;\n return { ...sharedProps?.styles, ...styleProps };\n }, [sharedProps?.styles, styleProps]);\n\n const mergedOnOpenChange = useMemo(() => {\n if (!sharedProps?.onOpenChange && !onOpenChange) return undefined;\n return (open: boolean) => {\n sharedProps?.onOpenChange?.(open);\n onOpenChange?.(open);\n };\n }, [onOpenChange, sharedProps?.onOpenChange]);\n\n const item: PopoverGroupItem = useMemo(\n () => ({\n arrow: arrow ?? sharedProps?.arrow ?? false,\n className: mergedClassName,\n classNames: mergedClassNames,\n closeDelay: closeDelay ?? sharedProps?.closeDelay,\n content,\n disabled: disabled ?? sharedProps?.disabled,\n getPopupContainer: getPopupContainer ?? sharedProps?.getPopupContainer,\n inset: inset ?? sharedProps?.inset ?? false,\n mouseEnterDelay: mouseEnterDelay ?? sharedProps?.mouseEnterDelay,\n mouseLeaveDelay: mouseLeaveDelay ?? sharedProps?.mouseLeaveDelay,\n nativeButton: nativeButton ?? sharedProps?.nativeButton,\n onOpenChange: mergedOnOpenChange,\n openDelay: openDelay ?? sharedProps?.openDelay,\n placement: placement ?? sharedProps?.placement ?? 'top',\n portalled: portalled ?? sharedProps?.portalled,\n styles: mergedStyles,\n trigger: trigger ?? sharedProps?.trigger ?? 'hover',\n zIndex: zIndex ?? sharedProps?.zIndex,\n }),\n [\n arrow,\n closeDelay,\n content,\n disabled,\n getPopupContainer,\n inset,\n mergedClassName,\n mergedClassNames,\n mergedOnOpenChange,\n mergedStyles,\n mouseEnterDelay,\n mouseLeaveDelay,\n nativeButton,\n openDelay,\n placement,\n portalled,\n sharedProps?.arrow,\n sharedProps?.closeDelay,\n sharedProps?.disabled,\n sharedProps?.getPopupContainer,\n sharedProps?.inset,\n sharedProps?.mouseEnterDelay,\n sharedProps?.mouseLeaveDelay,\n sharedProps?.nativeButton,\n sharedProps?.openDelay,\n sharedProps?.placement,\n sharedProps?.portalled,\n sharedProps?.trigger,\n sharedProps?.zIndex,\n trigger,\n zIndex,\n ],\n );\n\n return item;\n};\n"],"mappings":";;;;;;AAOA,MAAa,yBAAyB,UAAmD;CACvF,MAAM,cAAc,WAAW,yBAAyB;CAExD,MAAM,EACJ,OACA,OACA,SACA,WACA,WACA,YACA,QAAQ,YACR,cACA,SACA,YACA,UACA,mBACA,iBACA,iBACA,cACA,WACA,WACA,WACE;CAEJ,MAAM,kBAAkB,cAAc;AACpC,MAAI,CAAC,aAAa,aAAa,CAAC,UAAW,QAAO;AAClD,SAAO,CAAC,aAAa,WAAW,UAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI;IACnE,CAAC,WAAW,aAAa,UAAU,CAAC;CAEvC,MAAM,mBAAmB,cAAc;AACrC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2
|
+
import * as react33 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SearchBar/SearchBar.d.ts
|
|
5
|
-
declare const SearchBar:
|
|
5
|
+
declare const SearchBar: react33.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 react28 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Segmented/Segmented.d.ts
|
|
5
|
-
declare const Segmented:
|
|
5
|
+
declare const Segmented: react28.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 react27 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Select/Select.d.ts
|
|
5
|
-
declare const Input:
|
|
5
|
+
declare const Input: react27.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 react23 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SideNav/SideNav.d.ts
|
|
5
|
-
declare const SideNav:
|
|
5
|
+
declare const SideNav: react23.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 react55 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/SliderWithInput/SliderWithInput.d.ts
|
|
5
|
-
declare const SliderWithInput:
|
|
5
|
+
declare const SliderWithInput: react55.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 react112 from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/SortableList/components/DragHandle.d.ts
|
|
6
|
-
declare const DragHandle:
|
|
6
|
+
declare const DragHandle: react112.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 react110 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: react110.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 react54 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ThemeProvider/ThemeProvider.d.ts
|
|
5
|
-
declare const ThemeProvider:
|
|
5
|
+
declare const ThemeProvider: react54.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 react68 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Toc/Toc.d.ts
|
|
5
|
-
declare const Toc:
|
|
5
|
+
declare const Toc: react68.NamedExoticComponent<TocProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Toc };
|
|
8
8
|
//# sourceMappingURL=Toc.d.mts.map
|
package/es/Video/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FlexboxProps } from "../Flex/type.mjs";
|
|
2
2
|
import "../Flex/index.mjs";
|
|
3
3
|
import { VideoProps as VideoProps$1 } from "../types/index.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react0 from "react";
|
|
5
5
|
import { CSSProperties, Ref } from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/Video/index.d.ts
|
|
@@ -39,7 +39,7 @@ interface VideoProps extends VideoProps$1, Pick<FlexboxProps, 'width' | 'height'
|
|
|
39
39
|
};
|
|
40
40
|
variant?: 'borderless' | 'filled' | 'outlined';
|
|
41
41
|
}
|
|
42
|
-
declare const Video:
|
|
42
|
+
declare const Video: react0.NamedExoticComponent<VideoProps>;
|
|
43
43
|
//#endregion
|
|
44
44
|
export { Video, VideoProps };
|
|
45
45
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AuroraBackgroundProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react137 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/awesome/AuroraBackground/AuroraBackground.d.ts
|
|
5
|
-
declare const AuroraBackground:
|
|
5
|
+
declare const AuroraBackground: react137.NamedExoticComponent<AuroraBackgroundProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AuroraBackground };
|
|
8
8
|
//# sourceMappingURL=AuroraBackground.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { ButtonProps } from "../../Button/type.mjs";
|
|
2
2
|
import "../../Button/index.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react140 from "react";
|
|
4
4
|
|
|
5
5
|
//#region src/awesome/BottomGradientButton/BottomGradientButton.d.ts
|
|
6
|
-
declare const BottomGradientButton:
|
|
6
|
+
declare const BottomGradientButton: react140.NamedExoticComponent<ButtonProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { BottomGradientButton };
|
|
9
9
|
//# sourceMappingURL=BottomGradientButton.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { FeaturesProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react139 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/awesome/Features/Features.d.ts
|
|
5
|
-
declare const Features:
|
|
5
|
+
declare const Features: react139.NamedExoticComponent<FeaturesProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Features };
|
|
8
8
|
//# sourceMappingURL=Features.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GiscusProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react138 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/awesome/Giscus/Giscus.d.ts
|
|
5
|
-
declare const Giscus:
|
|
5
|
+
declare const Giscus: react138.NamedExoticComponent<GiscusProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Giscus };
|
|
8
8
|
//# sourceMappingURL=Giscus.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GradientButtonProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react135 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/awesome/GradientButton/GradientButton.d.ts
|
|
5
|
-
declare const GradientButton:
|
|
5
|
+
declare const GradientButton: react135.NamedExoticComponent<GradientButtonProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { GradientButton };
|
|
8
8
|
//# sourceMappingURL=GradientButton.d.mts.map
|