@lobehub/ui 4.27.3 → 4.27.5
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/Avatar.mjs +4 -5
- package/es/Avatar/Avatar.mjs.map +1 -1
- package/es/Avatar/AvatarGroup/index.d.mts +2 -2
- package/es/Burger/Burger.d.mts +2 -2
- package/es/CodeDiff/CodeDiff.d.mts +2 -2
- package/es/CodeDiff/PatchDiff.d.mts +2 -2
- package/es/CodeEditor/CodeEditor.d.mts +2 -2
- package/es/Collapse/Collapse.d.mts +2 -2
- package/es/ColorSwatches/ColorSwatches.mjs +3 -4
- package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
- 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/DropdownMenu/atoms.d.mts +17 -16
- package/es/DropdownMenu/atoms.mjs +9 -2
- package/es/DropdownMenu/atoms.mjs.map +1 -1
- package/es/EditableText/EditableText.d.mts +2 -2
- package/es/EditorSlashMenu/atoms.d.mts +12 -12
- 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/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/LobeSelect/LobeSelect.d.mts +2 -2
- package/es/LobeSelect/atoms.d.mts +19 -19
- package/es/LobeSwitch/LobeSwitch.d.mts +2 -2
- package/es/LobeSwitch/atoms.d.mts +4 -4
- 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/Menu/sharedStyle.mjs +1 -1
- package/es/Menu/sharedStyle.mjs.map +1 -1
- 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/Modal/imperative.d.mts +2 -2
- package/es/MotionProvider/index.d.mts +2 -2
- package/es/Popover/ArrowIcon.d.mts +2 -2
- package/es/Popover/atoms.d.mts +9 -9
- package/es/Popover/context.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/Skeleton/SkeletonTags.mjs +2 -3
- package/es/Skeleton/SkeletonTags.mjs.map +1 -1
- package/es/Skeleton/SkeletonTitle.mjs +6 -7
- package/es/Skeleton/SkeletonTitle.mjs.map +1 -1
- 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/Toast/imperative.d.mts +3 -3
- package/es/Toc/Toc.d.mts +2 -2
- package/es/Tooltip/style.mjs +0 -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/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/CreateBotIcon.d.mts +3 -3
- 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 +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 +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 +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/node_modules/unist-util-visit/lib/index.mjs +4 -5
- package/es/node_modules/unist-util-visit/lib/index.mjs.map +1 -1
- package/es/storybook/StoryBook/index.d.mts +2 -2
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AccordionProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react85 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Accordion/Accordion.d.ts
|
|
5
|
-
declare const Accordion:
|
|
5
|
+
declare const Accordion: react85.NamedExoticComponent<AccordionProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Accordion };
|
|
8
8
|
//# sourceMappingURL=Accordion.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AccordionItemProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react86 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Accordion/AccordionItem.d.ts
|
|
5
|
-
declare const AccordionItem:
|
|
5
|
+
declare const AccordionItem: react86.NamedExoticComponent<AccordionItemProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AccordionItem };
|
|
8
8
|
//# sourceMappingURL=AccordionItem.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ActionIconProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react7 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/ActionIcon/ActionIcon.d.ts
|
|
5
|
-
declare const ActionIcon:
|
|
5
|
+
declare const ActionIcon: react7.NamedExoticComponent<ActionIconProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ActionIcon };
|
|
8
8
|
//# sourceMappingURL=ActionIcon.d.mts.map
|
package/es/Alert/Alert.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AlertProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react87 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Alert/Alert.d.ts
|
|
5
|
-
declare const Alert:
|
|
5
|
+
declare const Alert: react87.NamedExoticComponent<AlertProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Alert };
|
|
8
8
|
//# sourceMappingURL=Alert.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AutoCompleteProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react84 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/AutoComplete/Select.d.ts
|
|
5
|
-
declare const AutoComplete:
|
|
5
|
+
declare const AutoComplete: react84.NamedExoticComponent<AutoCompleteProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AutoComplete };
|
|
8
8
|
//# sourceMappingURL=Select.d.mts.map
|
package/es/Avatar/Avatar.mjs
CHANGED
|
@@ -10,13 +10,12 @@ import { calculateEmojiSize, formatAvatarText, getActualColorForReadable, hasVal
|
|
|
10
10
|
import { memo, useMemo, useState } from "react";
|
|
11
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { Avatar } from "antd";
|
|
13
|
-
import { cssVar, cx
|
|
13
|
+
import { cssVar, cx } from "antd-style";
|
|
14
14
|
import { Loader2 } from "lucide-react";
|
|
15
15
|
import { getEmoji } from "@lobehub/fluent-emoji";
|
|
16
16
|
|
|
17
17
|
//#region src/Avatar/Avatar.tsx
|
|
18
18
|
const Avatar$1 = memo(({ bordered, className, avatar, title, animation, borderedColor, size = 48, shape = "square", background, style, unoptimized, alt, variant = "borderless", shadow, loading, sliceText = true, emojiScaleWithBackground = true, ref, ...rest }) => {
|
|
19
|
-
const theme = useTheme();
|
|
20
19
|
const isStringAvatar = typeof avatar === "string";
|
|
21
20
|
const isDefaultAntAvatar$1 = useMemo(() => isDefaultAntAvatar(avatar), [avatar]);
|
|
22
21
|
const [isImgError, setIsImgError] = useState(false);
|
|
@@ -27,7 +26,7 @@ const Avatar$1 = memo(({ bordered, className, avatar, title, animation, bordered
|
|
|
27
26
|
]);
|
|
28
27
|
const text = String(isDefaultAntAvatar$1 ? title : avatar);
|
|
29
28
|
const imgAlt = alt || title || "avatar";
|
|
30
|
-
const
|
|
29
|
+
const defaultAvatar = useMemo(() => typeof avatar === "string" ? /* @__PURE__ */ jsx(Img_default, {
|
|
31
30
|
alt: imgAlt,
|
|
32
31
|
height: size,
|
|
33
32
|
loading: "lazy",
|
|
@@ -58,7 +57,7 @@ const Avatar$1 = memo(({ bordered, className, avatar, title, animation, bordered
|
|
|
58
57
|
unoptimized,
|
|
59
58
|
emojiScaleWithBackground
|
|
60
59
|
]);
|
|
61
|
-
const actualColorForReadable = useMemo(() => getActualColorForReadable(background,
|
|
60
|
+
const actualColorForReadable = useMemo(() => getActualColorForReadable(background, cssVar.colorBorder), [background]);
|
|
62
61
|
const avatarStyle = useMemo(() => ({
|
|
63
62
|
backgroundColor: isDefaultAntAvatar$1 && !isImgError || emoji ? background : background || cssVar.colorBorder,
|
|
64
63
|
borderRadius: shape === "square" && size && size < 24 ? "33%" : void 0,
|
|
@@ -91,7 +90,7 @@ const Avatar$1 = memo(({ bordered, className, avatar, title, animation, bordered
|
|
|
91
90
|
ref,
|
|
92
91
|
shape,
|
|
93
92
|
size,
|
|
94
|
-
src: isDefaultAntAvatar$1 && !isImgError ?
|
|
93
|
+
src: isDefaultAntAvatar$1 && !isImgError ? defaultAvatar : void 0,
|
|
95
94
|
style: avatarStyle,
|
|
96
95
|
...rest,
|
|
97
96
|
children: [loading && /* @__PURE__ */ jsx(Center_default, {
|
package/es/Avatar/Avatar.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.mjs","names":["Avatar","isDefaultAntAvatar","checkIsDefaultAntAvatar","Img","FluentEmoji","AntAvatar","Center","Icon"],"sources":["../../src/Avatar/Avatar.tsx"],"sourcesContent":["'use client';\n\nimport { getEmoji } from '@lobehub/fluent-emoji';\nimport { Avatar as AntAvatar } from 'antd';\nimport { cssVar, cx
|
|
1
|
+
{"version":3,"file":"Avatar.mjs","names":["Avatar","isDefaultAntAvatar","checkIsDefaultAntAvatar","Img","FluentEmoji","AntAvatar","Center","Icon"],"sources":["../../src/Avatar/Avatar.tsx"],"sourcesContent":["'use client';\n\nimport { getEmoji } from '@lobehub/fluent-emoji';\nimport { Avatar as AntAvatar } from 'antd';\nimport { cssVar, cx } from 'antd-style';\nimport { Loader2 } from 'lucide-react';\nimport { memo, useMemo, useState } from 'react';\n\nimport { Center } from '@/Flex';\nimport FluentEmoji from '@/FluentEmoji';\nimport Icon from '@/Icon';\nimport Img from '@/Img';\nimport { safeReadableColor } from '@/utils/safeReadableColor';\n\nimport { styles, variants } from './style';\nimport type { AvatarProps } from './type';\nimport {\n calculateEmojiSize,\n isDefaultAntAvatar as checkIsDefaultAntAvatar,\n formatAvatarText,\n getActualColorForReadable,\n hasValidBackground,\n} from './utils';\n\nconst Avatar = memo<AvatarProps>(\n ({\n bordered,\n className,\n avatar,\n title,\n animation,\n borderedColor,\n size = 48,\n shape = 'square',\n background,\n style,\n unoptimized,\n alt,\n variant = 'borderless',\n shadow,\n loading,\n sliceText = true,\n emojiScaleWithBackground = true,\n ref,\n ...rest\n }) => {\n const isStringAvatar = typeof avatar === 'string';\n\n const isDefaultAntAvatar = useMemo(() => checkIsDefaultAntAvatar(avatar), [avatar]);\n const [isImgError, setIsImgError] = useState(false);\n\n const emoji = useMemo(\n () => avatar && !isDefaultAntAvatar && isStringAvatar && getEmoji(avatar),\n [avatar, isStringAvatar, isDefaultAntAvatar],\n );\n\n const text = String(isDefaultAntAvatar ? title : avatar);\n\n const imgAlt = alt || title || 'avatar';\n\n const defaultAvatar = useMemo(\n () =>\n typeof avatar === 'string' ? (\n <Img\n alt={imgAlt}\n height={size}\n loading={'lazy'}\n onError={() => setIsImgError(true)}\n src={avatar}\n unoptimized={unoptimized}\n width={size}\n />\n ) : (\n avatar\n ),\n [avatar, imgAlt, size, unoptimized],\n );\n\n const hasBackground = hasValidBackground(background);\n\n const customAvatar = useMemo(\n () =>\n emoji ? (\n <FluentEmoji\n emoji={emoji}\n size={calculateEmojiSize(size, hasBackground, emojiScaleWithBackground)}\n type={animation ? 'anim' : '3d'}\n unoptimized={unoptimized}\n />\n ) : (\n formatAvatarText(text || title, sliceText)\n ),\n [\n animation,\n emoji,\n hasBackground,\n size,\n sliceText,\n text,\n title,\n unoptimized,\n emojiScaleWithBackground,\n ],\n );\n\n // Get actual color value for readableColor (CSS variables can't be parsed)\n const actualColorForReadable = useMemo(\n () => getActualColorForReadable(background, cssVar.colorBorder),\n [background],\n );\n\n const avatarStyle = useMemo(\n () => ({\n backgroundColor:\n (isDefaultAntAvatar && !isImgError) || emoji\n ? background\n : background || cssVar.colorBorder,\n borderRadius: shape === 'square' && size && size < 24 ? '33%' : undefined,\n boxShadow: bordered\n ? `${cssVar.colorBgLayout} 0 0 0 2px, ${borderedColor || cssVar.colorTextTertiary} 0 0 0 4px`\n : undefined,\n color: safeReadableColor(actualColorForReadable),\n cursor: rest?.onClick ? 'pointer' : undefined,\n fontSize: size * (emoji ? 0.7 : 0.5),\n ...style,\n }),\n [\n isDefaultAntAvatar,\n isImgError,\n background,\n shape,\n emoji,\n size,\n bordered,\n borderedColor,\n actualColorForReadable,\n rest?.onClick,\n style,\n ],\n );\n\n const showFallback = !isDefaultAntAvatar || isImgError;\n\n return (\n <AntAvatar\n alt={imgAlt}\n className={cx(variants({ shadow, variant }), className)}\n draggable={false}\n ref={ref}\n shape={shape}\n size={size}\n src={isDefaultAntAvatar && !isImgError ? defaultAvatar : undefined}\n style={avatarStyle}\n {...rest}\n >\n {loading && (\n <Center className={styles.loading} height={'100%'} width={'100%'}>\n <Icon icon={Loader2} spin />\n </Center>\n )}\n {showFallback && customAvatar}\n </AntAvatar>\n );\n },\n);\n\nAvatar.displayName = 'Avatar';\n\nexport default Avatar;\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,MAAMA,WAAS,MACZ,EACC,UACA,WACA,QACA,OACA,WACA,eACA,OAAO,IACP,QAAQ,UACR,YACA,OACA,aACA,KACA,UAAU,cACV,QACA,SACA,YAAY,MACZ,2BAA2B,MAC3B,KACA,GAAG,WACC;CACJ,MAAM,iBAAiB,OAAO,WAAW;CAEzC,MAAMC,uBAAqB,cAAcC,mBAAwB,OAAO,EAAE,CAAC,OAAO,CAAC;CACnF,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CAEnD,MAAM,QAAQ,cACN,UAAU,CAACD,wBAAsB,kBAAkB,SAAS,OAAO,EACzE;EAAC;EAAQ;EAAgBA;EAAmB,CAC7C;CAED,MAAM,OAAO,OAAOA,uBAAqB,QAAQ,OAAO;CAExD,MAAM,SAAS,OAAO,SAAS;CAE/B,MAAM,gBAAgB,cAElB,OAAO,WAAW,WAChB,oBAACE;EACC,KAAK;EACL,QAAQ;EACR,SAAS;EACT,eAAe,cAAc,KAAK;EAClC,KAAK;EACQ;EACb,OAAO;GACP,GAEF,QAEJ;EAAC;EAAQ;EAAQ;EAAM;EAAY,CACpC;CAED,MAAM,gBAAgB,mBAAmB,WAAW;CAEpD,MAAM,eAAe,cAEjB,QACE,oBAACC;EACQ;EACP,MAAM,mBAAmB,MAAM,eAAe,yBAAyB;EACvE,MAAM,YAAY,SAAS;EACd;GACb,GAEF,iBAAiB,QAAQ,OAAO,UAAU,EAE9C;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;CAGD,MAAM,yBAAyB,cACvB,0BAA0B,YAAY,OAAO,YAAY,EAC/D,CAAC,WAAW,CACb;CAED,MAAM,cAAc,eACX;EACL,iBACGH,wBAAsB,CAAC,cAAe,QACnC,aACA,cAAc,OAAO;EAC3B,cAAc,UAAU,YAAY,QAAQ,OAAO,KAAK,QAAQ;EAChE,WAAW,WACP,GAAG,OAAO,cAAc,cAAc,iBAAiB,OAAO,kBAAkB,cAChF;EACJ,OAAO,kBAAkB,uBAAuB;EAChD,QAAQ,MAAM,UAAU,YAAY;EACpC,UAAU,QAAQ,QAAQ,KAAM;EAChC,GAAG;EACJ,GACD;EACEA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAM;EACN;EACD,CACF;CAED,MAAM,eAAe,CAACA,wBAAsB;AAE5C,QACE,qBAACI;EACC,KAAK;EACL,WAAW,GAAG,SAAS;GAAE;GAAQ;GAAS,CAAC,EAAE,UAAU;EACvD,WAAW;EACN;EACE;EACD;EACN,KAAKJ,wBAAsB,CAAC,aAAa,gBAAgB;EACzD,OAAO;EACP,GAAI;aAEH,WACC,oBAACK;GAAO,WAAW,OAAO;GAAS,QAAQ;GAAQ,OAAO;aACxD,oBAACC;IAAK,MAAM;IAAS;KAAO;IACrB,EAEV,gBAAgB;GACP;EAGjB;AAED,SAAO,cAAc;AAErB,qBAAeP"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AvatarGroupProps } from "../type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react83 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Avatar/AvatarGroup/index.d.ts
|
|
5
|
-
declare const AvatarGroup:
|
|
5
|
+
declare const AvatarGroup: react83.NamedExoticComponent<AvatarGroupProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { AvatarGroup };
|
|
8
8
|
//# sourceMappingURL=index.d.mts.map
|
package/es/Burger/Burger.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BurgerProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react82 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Burger/Burger.d.ts
|
|
5
|
-
declare const Burger:
|
|
5
|
+
declare const Burger: react82.NamedExoticComponent<BurgerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Burger };
|
|
8
8
|
//# sourceMappingURL=Burger.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CodeDiffProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react80 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/CodeDiff/CodeDiff.d.ts
|
|
5
|
-
declare const CodeDiff:
|
|
5
|
+
declare const CodeDiff: react80.NamedExoticComponent<CodeDiffProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CodeDiff };
|
|
8
8
|
//# sourceMappingURL=CodeDiff.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { PatchDiffProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react81 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/CodeDiff/PatchDiff.d.ts
|
|
5
|
-
declare const PatchDiff:
|
|
5
|
+
declare const PatchDiff: react81.NamedExoticComponent<PatchDiffProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { PatchDiff };
|
|
8
8
|
//# sourceMappingURL=PatchDiff.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CodeEditorProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react78 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/CodeEditor/CodeEditor.d.ts
|
|
5
|
-
declare const CodeEditor:
|
|
5
|
+
declare const CodeEditor: react78.NamedExoticComponent<CodeEditorProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CodeEditor };
|
|
8
8
|
//# sourceMappingURL=CodeEditor.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CollapseProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react79 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Collapse/Collapse.d.ts
|
|
5
|
-
declare const Collapse:
|
|
5
|
+
declare const Collapse: react79.NamedExoticComponent<CollapseProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Collapse };
|
|
8
8
|
//# sourceMappingURL=Collapse.d.mts.map
|
|
@@ -9,7 +9,7 @@ import { styles } from "./style.mjs";
|
|
|
9
9
|
import { useMemo } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { ColorPicker } from "antd";
|
|
12
|
-
import { cssVar, cx
|
|
12
|
+
import { cssVar, cx } from "antd-style";
|
|
13
13
|
import useMergeState from "use-merge-value";
|
|
14
14
|
import { rgba } from "polished";
|
|
15
15
|
import { CheckIcon } from "lucide-react";
|
|
@@ -17,7 +17,6 @@ import chroma from "chroma-js";
|
|
|
17
17
|
|
|
18
18
|
//#region src/ColorSwatches/ColorSwatches.tsx
|
|
19
19
|
const ColorSwatches = ({ enableColorPicker, enableColorSwatches = true, defaultValue, value, style, colors, onChange, size = 24, shape = "circle", texts, ref, ...rest }) => {
|
|
20
|
-
const theme = useTheme();
|
|
21
20
|
const [active, setActive] = useMergeState(defaultValue, {
|
|
22
21
|
defaultValue,
|
|
23
22
|
onChange,
|
|
@@ -36,7 +35,7 @@ const ColorSwatches = ({ enableColorPicker, enableColorSwatches = true, defaultV
|
|
|
36
35
|
},
|
|
37
36
|
...rest,
|
|
38
37
|
children: [enableColorSwatches && colors.map((c, i) => {
|
|
39
|
-
const color = c.color ||
|
|
38
|
+
const color = c.color || cssVar.colorPrimary;
|
|
40
39
|
const isActive = !active && !c.color || color === active;
|
|
41
40
|
const isTransparent = c.color === "transparent" || c.color && !c.color.startsWith("var(") && (() => {
|
|
42
41
|
try {
|
|
@@ -45,7 +44,7 @@ const ColorSwatches = ({ enableColorPicker, enableColorSwatches = true, defaultV
|
|
|
45
44
|
return false;
|
|
46
45
|
}
|
|
47
46
|
})();
|
|
48
|
-
const actualColorForReadable = c.color?.startsWith("var(") ?
|
|
47
|
+
const actualColorForReadable = c.color?.startsWith("var(") ? cssVar.colorPrimary : color;
|
|
49
48
|
return /* @__PURE__ */ jsx(Tooltip_default, {
|
|
50
49
|
title: c.title,
|
|
51
50
|
children: /* @__PURE__ */ jsx(Center_default, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSwatches.mjs","names":["ColorSwatches: FC<ColorSwatchesProps>","Flexbox","Tooltip","Center","Icon"],"sources":["../../src/ColorSwatches/ColorSwatches.tsx"],"sourcesContent":["'use client';\n\nimport { ColorPicker } from 'antd';\nimport { cssVar, cx
|
|
1
|
+
{"version":3,"file":"ColorSwatches.mjs","names":["ColorSwatches: FC<ColorSwatchesProps>","Flexbox","Tooltip","Center","Icon"],"sources":["../../src/ColorSwatches/ColorSwatches.tsx"],"sourcesContent":["'use client';\n\nimport { ColorPicker } from 'antd';\nimport { cssVar, cx } from 'antd-style';\nimport chroma from 'chroma-js';\nimport { CheckIcon } from 'lucide-react';\nimport { rgba } from 'polished';\nimport { type FC, useMemo } from 'react';\nimport useMergeState from 'use-merge-value';\n\nimport { Center, Flexbox } from '@/Flex';\nimport Icon from '@/Icon';\nimport Tooltip from '@/Tooltip';\nimport { safeReadableColor } from '@/utils/safeReadableColor';\n\nimport { styles } from './style';\nimport type { ColorSwatchesProps } from './type';\n\nconst ColorSwatches: FC<ColorSwatchesProps> = ({\n enableColorPicker,\n enableColorSwatches = true,\n defaultValue,\n value,\n style,\n colors,\n onChange,\n size = 24,\n shape = 'circle',\n texts,\n ref,\n ...rest\n}) => {\n const [active, setActive] = useMergeState(defaultValue, {\n defaultValue,\n onChange,\n value,\n });\n\n // Convert size prop to CSS variable\n const cssVariables = useMemo<Record<string, string>>(\n () => ({\n '--color-swatches-size': `${size}px`,\n }),\n [size],\n );\n\n const isCustomActive = useMemo(\n () => active && active !== cssVar.colorPrimary && !colors.some((c) => c.color === active),\n [active, colors],\n );\n\n return (\n <Flexbox\n gap={6}\n horizontal\n ref={ref}\n style={{\n ...cssVariables,\n flexWrap: 'wrap',\n ...style,\n }}\n {...rest}\n >\n {enableColorSwatches &&\n colors.map((c, i) => {\n const color = c.color || cssVar.colorPrimary;\n const isActive = (!active && !c.color) || color === active;\n // Check if color is transparent or CSS variable (which chroma can't parse)\n const isTransparent =\n c.color === 'transparent' ||\n (c.color &&\n !c.color.startsWith('var(') &&\n (() => {\n try {\n return chroma(c.color).alpha() === 0;\n } catch {\n return false;\n }\n })());\n // Get actual color value for readableColor (CSS variables can't be parsed)\n const actualColorForReadable = c.color?.startsWith('var(') ? cssVar.colorPrimary : color;\n return (\n <Tooltip key={c?.key || i} title={c.title}>\n <Center\n className={cx(\n styles.container,\n isTransparent && styles.transparent,\n isActive && styles.active,\n )}\n onClick={() => setActive(c.color || undefined)}\n style={{\n background: isTransparent ? undefined : color,\n borderRadius: shape === 'circle' ? '50%' : cssVar.borderRadius,\n }}\n >\n {isActive && (\n <Icon\n color={rgba(safeReadableColor(actualColorForReadable), 0.33)}\n icon={CheckIcon}\n size={{ size: 14, strokeWidth: 4 }}\n style={{\n pointerEvents: 'none',\n }}\n />\n )}\n </Center>\n </Tooltip>\n );\n })}\n {enableColorPicker && (\n <Tooltip title={texts?.custom || 'Custom'}>\n <ColorPicker\n arrow={false}\n className={cx(\n styles.picker,\n enableColorSwatches && styles.conic,\n isCustomActive && styles.active,\n )}\n defaultValue={cssVar.colorPrimary}\n disabledAlpha\n format={'hex'}\n onChangeComplete={(c) => {\n if (c.toHexString() === cssVar.colorPrimary) {\n setActive('');\n } else {\n setActive(c.toHexString());\n }\n }}\n presets={\n enableColorSwatches\n ? undefined\n : [\n {\n colors: colors.map((c) => c.color),\n label: texts?.presets || 'Presets',\n },\n ]\n }\n style={{\n borderRadius: shape === 'circle' ? '50%' : cssVar.borderRadius,\n }}\n value={enableColorSwatches ? undefined : active}\n />\n </Tooltip>\n )}\n </Flexbox>\n );\n};\n\nColorSwatches.displayName = 'ColorSwatches';\n\nexport default ColorSwatches;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,MAAMA,iBAAyC,EAC7C,mBACA,sBAAsB,MACtB,cACA,OACA,OACA,QACA,UACA,OAAO,IACP,QAAQ,UACR,OACA,KACA,GAAG,WACC;CACJ,MAAM,CAAC,QAAQ,aAAa,cAAc,cAAc;EACtD;EACA;EACA;EACD,CAAC;CAGF,MAAM,eAAe,eACZ,EACL,yBAAyB,GAAG,KAAK,KAClC,GACD,CAAC,KAAK,CACP;CAED,MAAM,iBAAiB,cACf,UAAU,WAAW,OAAO,gBAAgB,CAAC,OAAO,MAAM,MAAM,EAAE,UAAU,OAAO,EACzF,CAAC,QAAQ,OAAO,CACjB;AAED,QACE,qBAACC;EACC,KAAK;EACL;EACK;EACL,OAAO;GACL,GAAG;GACH,UAAU;GACV,GAAG;GACJ;EACD,GAAI;aAEH,uBACC,OAAO,KAAK,GAAG,MAAM;GACnB,MAAM,QAAQ,EAAE,SAAS,OAAO;GAChC,MAAM,WAAY,CAAC,UAAU,CAAC,EAAE,SAAU,UAAU;GAEpD,MAAM,gBACJ,EAAE,UAAU,iBACX,EAAE,SACD,CAAC,EAAE,MAAM,WAAW,OAAO,WACpB;AACL,QAAI;AACF,YAAO,OAAO,EAAE,MAAM,CAAC,OAAO,KAAK;YAC7B;AACN,YAAO;;OAEP;GAER,MAAM,yBAAyB,EAAE,OAAO,WAAW,OAAO,GAAG,OAAO,eAAe;AACnF,UACE,oBAACC;IAA0B,OAAO,EAAE;cAClC,oBAACC;KACC,WAAW,GACT,OAAO,WACP,iBAAiB,OAAO,aACxB,YAAY,OAAO,OACpB;KACD,eAAe,UAAU,EAAE,SAAS,OAAU;KAC9C,OAAO;MACL,YAAY,gBAAgB,SAAY;MACxC,cAAc,UAAU,WAAW,QAAQ,OAAO;MACnD;eAEA,YACC,oBAACC;MACC,OAAO,KAAK,kBAAkB,uBAAuB,EAAE,IAAK;MAC5D,MAAM;MACN,MAAM;OAAE,MAAM;OAAI,aAAa;OAAG;MAClC,OAAO,EACL,eAAe,QAChB;OACD;MAEG;MAvBG,GAAG,OAAO,EAwBd;IAEZ,EACH,qBACC,oBAACF;GAAQ,OAAO,OAAO,UAAU;aAC/B,oBAAC;IACC,OAAO;IACP,WAAW,GACT,OAAO,QACP,uBAAuB,OAAO,OAC9B,kBAAkB,OAAO,OAC1B;IACD,cAAc,OAAO;IACrB;IACA,QAAQ;IACR,mBAAmB,MAAM;AACvB,SAAI,EAAE,aAAa,KAAK,OAAO,aAC7B,WAAU,GAAG;SAEb,WAAU,EAAE,aAAa,CAAC;;IAG9B,SACE,sBACI,SACA,CACE;KACE,QAAQ,OAAO,KAAK,MAAM,EAAE,MAAM;KAClC,OAAO,OAAO,WAAW;KAC1B,CACF;IAEP,OAAO,EACL,cAAc,UAAU,WAAW,QAAQ,OAAO,cACnD;IACD,OAAO,sBAAsB,SAAY;KACzC;IACM;GAEJ;;AAId,cAAc,cAAc;AAE5B,4BAAe"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MotionComponentType } from "../MotionProvider/index.mjs";
|
|
2
2
|
import { TranslationResourcesInput } from "../i18n/types.mjs";
|
|
3
3
|
import { CDN, CdnApi } from "../utils/genCdnUrl.mjs";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react0 from "react";
|
|
5
5
|
import { ElementType, ReactNode } from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/ConfigProvider/index.d.ts
|
|
@@ -19,7 +19,7 @@ interface ConfigProviderProps {
|
|
|
19
19
|
motion: MotionComponentType;
|
|
20
20
|
resources?: TranslationResourcesInput;
|
|
21
21
|
}
|
|
22
|
-
declare const ConfigProvider:
|
|
22
|
+
declare const ConfigProvider: react0.NamedExoticComponent<ConfigProviderProps>;
|
|
23
23
|
type CdnFn = ({
|
|
24
24
|
pkg,
|
|
25
25
|
version,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react125 from "react";
|
|
2
2
|
import * as react_jsx_runtime51 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/ContextMenu/ContextMenuHost.d.ts
|
|
5
|
-
declare const ContextMenuHost:
|
|
5
|
+
declare const ContextMenuHost: react125.MemoExoticComponent<() => react_jsx_runtime51.JSX.Element | null>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { ContextMenuHost };
|
|
8
8
|
//# sourceMappingURL=ContextMenuHost.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { CopyButtonProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react77 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/CopyButton/CopyButton.d.ts
|
|
5
|
-
declare const CopyButton:
|
|
5
|
+
declare const CopyButton: react77.NamedExoticComponent<CopyButtonProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { CopyButton };
|
|
8
8
|
//# sourceMappingURL=CopyButton.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DatePickerProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react76 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DatePicker/DatePicker.d.ts
|
|
5
|
-
declare const DatePicker:
|
|
5
|
+
declare const DatePicker: react76.NamedExoticComponent<DatePickerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DatePicker };
|
|
8
8
|
//# sourceMappingURL=DatePicker.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react26 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelBody.d.ts
|
|
5
5
|
type DraggablePanelBodyProps = DivProps;
|
|
6
|
-
declare const DraggablePanelBody:
|
|
6
|
+
declare const DraggablePanelBody: react26.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DraggablePanelBody, DraggablePanelBodyProps };
|
|
9
9
|
//# sourceMappingURL=DraggablePanelBody.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react27 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelContainer.d.ts
|
|
5
5
|
type DraggablePanelContainerProps = DivProps;
|
|
6
|
-
declare const DraggablePanelContainer:
|
|
6
|
+
declare const DraggablePanelContainer: react27.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DraggablePanelContainer, DraggablePanelContainerProps };
|
|
9
9
|
//# sourceMappingURL=DraggablePanelContainer.d.mts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react28 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelFooter.d.ts
|
|
5
5
|
type DraggablePanelFooterProps = DivProps;
|
|
6
|
-
declare const DraggablePanelFooter:
|
|
6
|
+
declare const DraggablePanelFooter: react28.NamedExoticComponent<DivProps>;
|
|
7
7
|
//#endregion
|
|
8
8
|
export { DraggablePanelFooter, DraggablePanelFooterProps };
|
|
9
9
|
//# sourceMappingURL=DraggablePanelFooter.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivProps } from "../../types/index.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react29 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggablePanel/components/DraggablePanelHeader.d.ts
|
|
5
5
|
interface DraggablePanelHeaderProps extends Omit<DivProps, 'children'> {
|
|
@@ -9,7 +9,7 @@ interface DraggablePanelHeaderProps extends Omit<DivProps, 'children'> {
|
|
|
9
9
|
setPin?: (pin: boolean) => void;
|
|
10
10
|
title?: string;
|
|
11
11
|
}
|
|
12
|
-
declare const DraggablePanelHeader:
|
|
12
|
+
declare const DraggablePanelHeader: react29.NamedExoticComponent<DraggablePanelHeaderProps>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { DraggablePanelHeader, DraggablePanelHeaderProps };
|
|
15
15
|
//# sourceMappingURL=DraggablePanelHeader.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DraggableSideNavProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react25 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DraggableSideNav/DraggableSideNav.d.ts
|
|
5
|
-
declare const DraggableSideNav:
|
|
5
|
+
declare const DraggableSideNav: react25.NamedExoticComponent<DraggableSideNavProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DraggableSideNav };
|
|
8
8
|
//# sourceMappingURL=DraggableSideNav.d.mts.map
|
package/es/Drawer/Drawer.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DrawerProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react23 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Drawer/Drawer.d.ts
|
|
5
|
-
declare const Drawer:
|
|
5
|
+
declare const Drawer: react23.NamedExoticComponent<DrawerProps>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { Drawer };
|
|
8
8
|
//# sourceMappingURL=Drawer.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DropdownProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react19 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/Dropdown/Dropdown.d.ts
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ import * as react60 from "react";
|
|
|
9
9
|
* @see https://ui.lobehub.com/components/context-menu
|
|
10
10
|
* @see https://ui.lobehub.com/components/dropdown-menu
|
|
11
11
|
*/
|
|
12
|
-
declare const Dropdown:
|
|
12
|
+
declare const Dropdown: react19.NamedExoticComponent<DropdownProps>;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { Dropdown };
|
|
15
15
|
//# sourceMappingURL=Dropdown.d.mts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { DropdownMenuProps } from "./type.mjs";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react9 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/DropdownMenu/DropdownMenu.d.ts
|
|
5
|
-
declare const DropdownMenu:
|
|
5
|
+
declare const DropdownMenu: react9.NamedExoticComponent<DropdownMenuProps<unknown>>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { DropdownMenu };
|
|
8
8
|
//# sourceMappingURL=DropdownMenu.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownMenuPlacement } from "./type.mjs";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
4
4
|
import * as _base_ui_react_menu0 from "@base-ui/react/menu";
|
|
5
5
|
import { Menu } from "@base-ui/react/menu";
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ declare const DropdownMenuTrigger: {
|
|
|
19
19
|
nativeButton,
|
|
20
20
|
ref: refProp,
|
|
21
21
|
...rest
|
|
22
|
-
}: DropdownMenuTriggerProps):
|
|
22
|
+
}: DropdownMenuTriggerProps): react_jsx_runtime10.JSX.Element;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
type DropdownMenuPortalProps = React.ComponentProps<typeof Menu.Portal> & {
|
|
@@ -32,7 +32,7 @@ declare const DropdownMenuPortal: {
|
|
|
32
32
|
({
|
|
33
33
|
container,
|
|
34
34
|
...rest
|
|
35
|
-
}: DropdownMenuPortalProps):
|
|
35
|
+
}: DropdownMenuPortalProps): react_jsx_runtime10.JSX.Element;
|
|
36
36
|
displayName: string;
|
|
37
37
|
};
|
|
38
38
|
type DropdownMenuPositionerProps = React.ComponentProps<typeof Menu.Positioner> & {
|
|
@@ -47,8 +47,9 @@ declare const DropdownMenuPositioner: {
|
|
|
47
47
|
align,
|
|
48
48
|
side,
|
|
49
49
|
sideOffset,
|
|
50
|
+
children,
|
|
50
51
|
...rest
|
|
51
|
-
}: DropdownMenuPositionerProps):
|
|
52
|
+
}: DropdownMenuPositionerProps): react_jsx_runtime10.JSX.Element;
|
|
52
53
|
displayName: string;
|
|
53
54
|
};
|
|
54
55
|
type DropdownMenuPopupProps = React.ComponentProps<typeof Menu.Popup>;
|
|
@@ -56,7 +57,7 @@ declare const DropdownMenuPopup: {
|
|
|
56
57
|
({
|
|
57
58
|
className,
|
|
58
59
|
...rest
|
|
59
|
-
}: DropdownMenuPopupProps):
|
|
60
|
+
}: DropdownMenuPopupProps): react_jsx_runtime10.JSX.Element;
|
|
60
61
|
displayName: string;
|
|
61
62
|
};
|
|
62
63
|
type DropdownMenuItemProps = React.ComponentProps<typeof Menu.Item> & {
|
|
@@ -67,7 +68,7 @@ declare const DropdownMenuItem: {
|
|
|
67
68
|
className,
|
|
68
69
|
danger,
|
|
69
70
|
...rest
|
|
70
|
-
}: DropdownMenuItemProps):
|
|
71
|
+
}: DropdownMenuItemProps): react_jsx_runtime10.JSX.Element;
|
|
71
72
|
displayName: string;
|
|
72
73
|
};
|
|
73
74
|
type DropdownMenuCheckboxItemProps = React.ComponentProps<typeof Menu.CheckboxItem> & {
|
|
@@ -78,7 +79,7 @@ declare const DropdownMenuCheckboxItemPrimitive: {
|
|
|
78
79
|
className,
|
|
79
80
|
danger,
|
|
80
81
|
...rest
|
|
81
|
-
}: DropdownMenuCheckboxItemProps):
|
|
82
|
+
}: DropdownMenuCheckboxItemProps): react_jsx_runtime10.JSX.Element;
|
|
82
83
|
displayName: string;
|
|
83
84
|
};
|
|
84
85
|
type DropdownMenuSeparatorProps = React.ComponentProps<typeof Menu.Separator>;
|
|
@@ -86,7 +87,7 @@ declare const DropdownMenuSeparator: {
|
|
|
86
87
|
({
|
|
87
88
|
className,
|
|
88
89
|
...rest
|
|
89
|
-
}: DropdownMenuSeparatorProps):
|
|
90
|
+
}: DropdownMenuSeparatorProps): react_jsx_runtime10.JSX.Element;
|
|
90
91
|
displayName: string;
|
|
91
92
|
};
|
|
92
93
|
declare const DropdownMenuGroup: React.ForwardRefExoticComponent<_base_ui_react_menu0.MenuGroupProps & React.RefAttributes<Element>>;
|
|
@@ -95,7 +96,7 @@ declare const DropdownMenuGroupLabel: {
|
|
|
95
96
|
({
|
|
96
97
|
className,
|
|
97
98
|
...rest
|
|
98
|
-
}: DropdownMenuGroupLabelProps):
|
|
99
|
+
}: DropdownMenuGroupLabelProps): react_jsx_runtime10.JSX.Element;
|
|
99
100
|
displayName: string;
|
|
100
101
|
};
|
|
101
102
|
type DropdownMenuSubmenuTriggerProps = React.ComponentProps<typeof Menu.SubmenuTrigger> & {
|
|
@@ -106,7 +107,7 @@ declare const DropdownMenuSubmenuTrigger: {
|
|
|
106
107
|
className,
|
|
107
108
|
danger,
|
|
108
109
|
...rest
|
|
109
|
-
}: DropdownMenuSubmenuTriggerProps):
|
|
110
|
+
}: DropdownMenuSubmenuTriggerProps): react_jsx_runtime10.JSX.Element;
|
|
110
111
|
displayName: string;
|
|
111
112
|
};
|
|
112
113
|
type DropdownMenuItemContentProps = React.HTMLAttributes<HTMLDivElement>;
|
|
@@ -114,7 +115,7 @@ declare const DropdownMenuItemContent: {
|
|
|
114
115
|
({
|
|
115
116
|
className,
|
|
116
117
|
...rest
|
|
117
|
-
}: DropdownMenuItemContentProps):
|
|
118
|
+
}: DropdownMenuItemContentProps): react_jsx_runtime10.JSX.Element;
|
|
118
119
|
displayName: string;
|
|
119
120
|
};
|
|
120
121
|
type DropdownMenuItemIconProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -122,7 +123,7 @@ declare const DropdownMenuItemIcon: {
|
|
|
122
123
|
({
|
|
123
124
|
className,
|
|
124
125
|
...rest
|
|
125
|
-
}: DropdownMenuItemIconProps):
|
|
126
|
+
}: DropdownMenuItemIconProps): react_jsx_runtime10.JSX.Element;
|
|
126
127
|
displayName: string;
|
|
127
128
|
};
|
|
128
129
|
type DropdownMenuItemLabelProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -130,7 +131,7 @@ declare const DropdownMenuItemLabel: {
|
|
|
130
131
|
({
|
|
131
132
|
className,
|
|
132
133
|
...rest
|
|
133
|
-
}: DropdownMenuItemLabelProps):
|
|
134
|
+
}: DropdownMenuItemLabelProps): react_jsx_runtime10.JSX.Element;
|
|
134
135
|
displayName: string;
|
|
135
136
|
};
|
|
136
137
|
type DropdownMenuItemExtraProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -138,7 +139,7 @@ declare const DropdownMenuItemExtra: {
|
|
|
138
139
|
({
|
|
139
140
|
className,
|
|
140
141
|
...rest
|
|
141
|
-
}: DropdownMenuItemExtraProps):
|
|
142
|
+
}: DropdownMenuItemExtraProps): react_jsx_runtime10.JSX.Element;
|
|
142
143
|
displayName: string;
|
|
143
144
|
};
|
|
144
145
|
type DropdownMenuSubmenuArrowProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
@@ -146,7 +147,7 @@ declare const DropdownMenuSubmenuArrow: {
|
|
|
146
147
|
({
|
|
147
148
|
className,
|
|
148
149
|
...rest
|
|
149
|
-
}: DropdownMenuSubmenuArrowProps):
|
|
150
|
+
}: DropdownMenuSubmenuArrowProps): react_jsx_runtime10.JSX.Element;
|
|
150
151
|
displayName: string;
|
|
151
152
|
};
|
|
152
153
|
type DropdownMenuSwitchItemProps = Omit<React.ComponentProps<typeof Menu.Item>, 'onClick'> & {
|
|
@@ -167,7 +168,7 @@ declare const DropdownMenuSwitchItem: {
|
|
|
167
168
|
onCheckedChange,
|
|
168
169
|
children,
|
|
169
170
|
...rest
|
|
170
|
-
}: DropdownMenuSwitchItemProps):
|
|
171
|
+
}: DropdownMenuSwitchItemProps): react_jsx_runtime10.JSX.Element;
|
|
171
172
|
displayName: string;
|
|
172
173
|
};
|
|
173
174
|
//#endregion
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import { useNativeButton } from "../hooks/useNativeButton.mjs";
|
|
4
|
+
import { FloatingLayerProvider } from "../hooks/useFloatingLayer.mjs";
|
|
4
5
|
import { placementMap } from "../utils/placement.mjs";
|
|
5
6
|
import { CLASSNAMES } from "../styles/classNames.mjs";
|
|
6
7
|
import { styles } from "../Menu/sharedStyle.mjs";
|
|
@@ -67,16 +68,22 @@ const DropdownMenuPortal = ({ container, ...rest }) => {
|
|
|
67
68
|
});
|
|
68
69
|
};
|
|
69
70
|
DropdownMenuPortal.displayName = "DropdownMenuPortal";
|
|
70
|
-
const DropdownMenuPositioner = ({ className, placement, hoverTrigger, align, side, sideOffset, ...rest }) => {
|
|
71
|
+
const DropdownMenuPositioner = ({ className, placement, hoverTrigger, align, side, sideOffset, children, ...rest }) => {
|
|
71
72
|
const placementConfig = placement ? placementMap[placement] : void 0;
|
|
73
|
+
const [positionerNode, setPositionerNode] = useState(null);
|
|
72
74
|
return /* @__PURE__ */ jsx(Menu$1.Positioner, {
|
|
73
75
|
...rest,
|
|
74
76
|
align: align ?? placementConfig?.align,
|
|
75
77
|
className: mergeStateClassName(styles.positioner, className),
|
|
76
78
|
"data-hover-trigger": hoverTrigger || void 0,
|
|
77
79
|
"data-placement": placement,
|
|
80
|
+
ref: setPositionerNode,
|
|
78
81
|
side: side ?? placementConfig?.side,
|
|
79
|
-
sideOffset: sideOffset ?? (placementConfig ? 6 : void 0)
|
|
82
|
+
sideOffset: sideOffset ?? (placementConfig ? 6 : void 0),
|
|
83
|
+
children: /* @__PURE__ */ jsx(FloatingLayerProvider, {
|
|
84
|
+
value: positionerNode,
|
|
85
|
+
children
|
|
86
|
+
})
|
|
80
87
|
});
|
|
81
88
|
};
|
|
82
89
|
DropdownMenuPositioner.displayName = "DropdownMenuPositioner";
|