@lobehub/ui 4.1.8 → 4.1.9

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.
Files changed (137) hide show
  1. package/es/Accordion/Accordion.d.mts +2 -2
  2. package/es/Accordion/Accordion.mjs +2 -2
  3. package/es/Accordion/Accordion.mjs.map +1 -1
  4. package/es/Accordion/AccordionItem.d.mts +2 -2
  5. package/es/ActionIcon/ActionIcon.d.mts +2 -2
  6. package/es/Alert/Alert.d.mts +2 -2
  7. package/es/AutoComplete/Select.d.mts +2 -2
  8. package/es/Avatar/AvatarGroup/index.d.mts +2 -2
  9. package/es/Burger/Burger.d.mts +2 -2
  10. package/es/CodeEditor/CodeEditor.d.mts +2 -2
  11. package/es/CodeEditor/CodeEditor.mjs +2 -2
  12. package/es/CodeEditor/CodeEditor.mjs.map +1 -1
  13. package/es/Collapse/Collapse.d.mts +2 -2
  14. package/es/ColorSwatches/ColorSwatches.mjs +2 -2
  15. package/es/ColorSwatches/ColorSwatches.mjs.map +1 -1
  16. package/es/ConfigProvider/index.d.mts +2 -2
  17. package/es/CopyButton/CopyButton.d.mts +2 -2
  18. package/es/DatePicker/DatePicker.d.mts +2 -2
  19. package/es/DraggablePanel/DraggablePanel.mjs +2 -2
  20. package/es/DraggablePanel/DraggablePanel.mjs.map +1 -1
  21. package/es/DraggablePanel/components/DraggablePanelBody.d.mts +2 -2
  22. package/es/DraggablePanel/components/DraggablePanelContainer.d.mts +2 -2
  23. package/es/DraggablePanel/components/DraggablePanelFooter.d.mts +2 -2
  24. package/es/DraggablePanel/components/DraggablePanelHeader.d.mts +2 -2
  25. package/es/DraggablePanel/components/DraggablePanelHeader.mjs +2 -2
  26. package/es/DraggablePanel/components/DraggablePanelHeader.mjs.map +1 -1
  27. package/es/DraggableSideNav/DraggableSideNav.d.mts +2 -2
  28. package/es/DraggableSideNav/DraggableSideNav.mjs +2 -2
  29. package/es/DraggableSideNav/DraggableSideNav.mjs.map +1 -1
  30. package/es/Drawer/Drawer.d.mts +2 -2
  31. package/es/Dropdown/Dropdown.d.mts +2 -2
  32. package/es/EditableText/EditableText.d.mts +2 -2
  33. package/es/EditableText/EditableText.mjs +2 -2
  34. package/es/EditableText/EditableText.mjs.map +1 -1
  35. package/es/EmojiPicker/EmojiPicker.d.mts +2 -2
  36. package/es/EmojiPicker/EmojiPicker.mjs +3 -3
  37. package/es/EmojiPicker/EmojiPicker.mjs.map +1 -1
  38. package/es/Flex/FlexBasic.d.mts +2 -2
  39. package/es/FontLoader/index.d.mts +2 -2
  40. package/es/Footer/Footer.d.mts +2 -2
  41. package/es/Form/components/FormGroup.d.mts +2 -2
  42. package/es/Form/components/FormItem.d.mts +2 -2
  43. package/es/Form/components/FormSubmitFooter.d.mts +2 -2
  44. package/es/FormModal/FormModal.d.mts +2 -2
  45. package/es/Header/Header.d.mts +2 -2
  46. package/es/Highlighter/Highlighter.d.mts +2 -2
  47. package/es/Highlighter/SyntaxHighlighter/index.d.mts +2 -2
  48. package/es/Hotkey/Hotkey.d.mts +2 -2
  49. package/es/HotkeyInput/HotkeyInput.d.mts +2 -2
  50. package/es/HotkeyInput/HotkeyInput.mjs +2 -2
  51. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  52. package/es/Icon/Icon.d.mts +2 -2
  53. package/es/Icon/components/IconProvider.d.mts +3 -3
  54. package/es/Image/PreviewGroup.d.mts +2 -2
  55. package/es/ImageSelect/ImageSelect.mjs +2 -2
  56. package/es/ImageSelect/ImageSelect.mjs.map +1 -1
  57. package/es/Layout/components/LayoutFooter.d.mts +2 -2
  58. package/es/Layout/components/LayoutHeader.d.mts +2 -2
  59. package/es/Layout/components/LayoutMain.d.mts +2 -2
  60. package/es/Layout/components/LayoutSidebar.d.mts +2 -2
  61. package/es/Layout/components/LayoutSidebarInner.d.mts +2 -2
  62. package/es/Layout/components/LayoutToc.d.mts +2 -2
  63. package/es/List/ListItem/index.d.mts +2 -2
  64. package/es/Markdown/Markdown.d.mts +2 -2
  65. package/es/Markdown/Typography.d.mts +2 -2
  66. package/es/Markdown/components/SearchResultCards/index.d.mts +2 -2
  67. package/es/MaskShadow/MaskShadow.d.mts +2 -2
  68. package/es/Menu/Menu.d.mts +2 -2
  69. package/es/Mermaid/Mermaid.d.mts +2 -2
  70. package/es/Mermaid/SyntaxMermaid/index.d.mts +2 -2
  71. package/es/Modal/Modal.d.mts +2 -2
  72. package/es/MotionProvider/index.d.mts +2 -2
  73. package/es/SearchBar/SearchBar.d.mts +2 -2
  74. package/es/SearchBar/SearchBar.mjs +2 -2
  75. package/es/SearchBar/SearchBar.mjs.map +1 -1
  76. package/es/Segmented/Segmented.d.mts +2 -2
  77. package/es/Select/Select.d.mts +2 -2
  78. package/es/SideNav/SideNav.d.mts +2 -2
  79. package/es/SliderWithInput/SliderWithInput.d.mts +2 -2
  80. package/es/SortableList/components/DragHandle.d.mts +2 -2
  81. package/es/SortableList/components/SortableItem.d.mts +2 -2
  82. package/es/ThemeProvider/ThemeProvider.d.mts +2 -2
  83. package/es/Toc/Toc.d.mts +2 -2
  84. package/es/Toc/TocMobile.mjs +2 -2
  85. package/es/Toc/TocMobile.mjs.map +1 -1
  86. package/es/Video/index.d.mts +2 -2
  87. package/es/awesome/Features/Features.d.mts +2 -2
  88. package/es/awesome/Giscus/Giscus.d.mts +2 -2
  89. package/es/awesome/GradientButton/GradientButton.d.mts +2 -2
  90. package/es/awesome/GridBackground/GridBackground.d.mts +2 -2
  91. package/es/awesome/GridBackground/GridShowcase.d.mts +2 -2
  92. package/es/awesome/Hero/Hero.d.mts +2 -2
  93. package/es/awesome/TypewriterEffect/TypewriterEffect.d.mts +2 -2
  94. package/es/brand/LobeChat/index.d.mts +2 -2
  95. package/es/brand/LobeHub/index.d.mts +2 -2
  96. package/es/brand/LogoThree/LogoSpline.d.mts +2 -2
  97. package/es/brand/LogoThree/index.d.mts +2 -2
  98. package/es/chat/BackBottom/BackBottom.d.mts +2 -2
  99. package/es/chat/ChatItem/ChatItem.d.mts +2 -2
  100. package/es/chat/ChatList/ChatList.d.mts +2 -2
  101. package/es/chat/EditableMessage/EditableMessage.d.mts +2 -2
  102. package/es/chat/EditableMessage/EditableMessage.mjs +3 -3
  103. package/es/chat/EditableMessage/EditableMessage.mjs.map +1 -1
  104. package/es/chat/EditableMessageList/EditableMessageList.d.mts +2 -2
  105. package/es/chat/MessageInput/MessageInput.d.mts +2 -2
  106. package/es/chat/MessageModal/MessageModal.d.mts +2 -2
  107. package/es/chat/MessageModal/MessageModal.mjs +3 -3
  108. package/es/chat/MessageModal/MessageModal.mjs.map +1 -1
  109. package/es/chat/TokenTag/TokenTag.mjs +27 -37
  110. package/es/chat/TokenTag/TokenTag.mjs.map +1 -1
  111. package/es/chat/TokenTag/type.d.mts +4 -7
  112. package/es/color/ColorScales/index.d.mts +2 -2
  113. package/es/i18n/context.d.mts +2 -2
  114. package/es/icons/lucideExtra/BotPromptIcon.d.mts +2 -2
  115. package/es/icons/lucideExtra/CreateBotIcon.d.mts +2 -2
  116. package/es/icons/lucideExtra/DiscordIcon.d.mts +2 -2
  117. package/es/icons/lucideExtra/GlobeOffIcon.d.mts +2 -2
  118. package/es/icons/lucideExtra/GroupBotIcon.d.mts +2 -2
  119. package/es/icons/lucideExtra/GroupBotSquareIcon.d.mts +3 -3
  120. package/es/icons/lucideExtra/LeftClickIcon.d.mts +3 -3
  121. package/es/icons/lucideExtra/LeftDoubleClickIcon.d.mts +3 -3
  122. package/es/icons/lucideExtra/McpIcon.d.mts +3 -3
  123. package/es/icons/lucideExtra/ProviderIcon.d.mts +2 -2
  124. package/es/icons/lucideExtra/RightClickIcon.d.mts +3 -3
  125. package/es/icons/lucideExtra/RightDoubleClickIcon.d.mts +3 -3
  126. package/es/icons/lucideExtra/ShapesUploadIcon.d.mts +3 -3
  127. package/es/icons/lucideExtra/TreeDownRightIcon.d.mts +3 -3
  128. package/es/icons/lucideExtra/TreeUpDownRightIcon.d.mts +3 -3
  129. package/es/mdx/Mdx/index.d.mts +2 -2
  130. package/es/mobile/ChatHeader/ChatHeaderTitle.d.mts +2 -2
  131. package/es/mobile/ChatInputArea/components/ChatSendButton.d.mts +2 -2
  132. package/es/mobile/TabBar/TabBar.mjs +2 -2
  133. package/es/mobile/TabBar/TabBar.mjs.map +1 -1
  134. package/es/storybook/StoryBook/index.d.mts +2 -2
  135. package/package.json +1 -1
  136. package/es/chat/TokenTag/style.mjs +0 -34
  137. package/es/chat/TokenTag/style.mjs.map +0 -1
@@ -5,16 +5,16 @@ import MessageInput_default from "../MessageInput/MessageInput.mjs";
5
5
  import MessageModal_default from "../MessageModal/MessageModal.mjs";
6
6
  import { memo } from "react";
7
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
8
- import useMergeState from "use-merge-value";
8
+ import useControlledState from "use-merge-value";
9
9
  import { cx } from "antd-style";
10
10
 
11
11
  //#region src/chat/EditableMessage/EditableMessage.tsx
12
12
  const EditableMessage = memo(({ value, onChange, classNames = {}, onEditingChange, editing, openModal, onOpenChange, placeholder, showEditWhenEmpty = false, styles: customStyles, className, style, height, variant, editButtonSize, text, fullFeaturedCodeBlock, model, fontSize, language = "markdown", markdownProps }) => {
13
- const [isEdit, setTyping] = useMergeState(false, {
13
+ const [isEdit, setTyping] = useControlledState(false, {
14
14
  onChange: onEditingChange,
15
15
  value: editing
16
16
  });
17
- const [expand, setExpand] = useMergeState(false, {
17
+ const [expand, setExpand] = useControlledState(false, {
18
18
  onChange: onOpenChange,
19
19
  value: openModal
20
20
  });
@@ -1 +1 @@
1
- {"version":3,"file":"EditableMessage.mjs","names":["useControlledState","MessageInput","text","Markdown","MessageModal"],"sources":["../../../src/chat/EditableMessage/EditableMessage.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Markdown from '@/Markdown';\nimport MessageInput from '@/chat/MessageInput';\nimport MessageModal from '@/chat/MessageModal';\n\nimport type { EditableMessageProps } from './type';\n\nconst EditableMessage = memo<EditableMessageProps>(\n ({\n value,\n onChange,\n classNames = {},\n onEditingChange,\n editing,\n openModal,\n onOpenChange,\n placeholder,\n showEditWhenEmpty = false,\n styles: customStyles,\n className,\n style,\n height,\n variant,\n editButtonSize,\n text,\n fullFeaturedCodeBlock,\n model,\n fontSize,\n language = 'markdown',\n markdownProps,\n }) => {\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [expand, setExpand] = useControlledState<boolean>(false, {\n onChange: onOpenChange,\n value: openModal,\n });\n\n const isAutoSize = height === 'auto';\n\n const input = (\n <MessageInput\n className={cx(className, classNames?.input)}\n classNames={classNames}\n defaultValue={value}\n editButtonSize={editButtonSize}\n height={height}\n language={language}\n onCancel={() => setTyping(false)}\n onConfirm={(text) => {\n onChange?.(text);\n setTyping(false);\n }}\n placeholder={placeholder}\n shortcut\n style={{\n ...style,\n ...customStyles?.input,\n }}\n styles={customStyles}\n text={text}\n variant={variant}\n />\n );\n\n if (!value && showEditWhenEmpty) return input;\n\n return (\n <>\n {!expand && isEdit ? (\n input\n ) : (\n <Markdown\n className={cx(className, classNames?.markdown)}\n fontSize={fontSize}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n style={{\n height: isAutoSize ? 'unset' : height,\n ...style,\n ...customStyles?.markdown,\n }}\n variant={'chat'}\n {...markdownProps}\n >\n {value || placeholder || ''}\n </Markdown>\n )}\n {expand && (\n <MessageModal\n editing={isEdit}\n extra={model?.extra}\n footer={model?.footer}\n height={height}\n language={language}\n onChange={onChange}\n onEditingChange={setTyping}\n onOpenChange={(e) => {\n setExpand(e);\n setTyping(false);\n }}\n open={expand}\n placeholder={placeholder}\n text={text}\n value={value}\n />\n )}\n </>\n );\n },\n);\n\nEditableMessage.displayName = 'EditableMessage';\n\nexport default EditableMessage;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,kBAAkB,MACrB,EACC,OACA,UACA,aAAa,EAAE,EACf,iBACA,SACA,WACA,cACA,aACA,oBAAoB,OACpB,QAAQ,cACR,WACA,OACA,QACA,SACA,gBACA,MACA,uBACA,OACA,UACA,WAAW,YACX,oBACI;CACJ,MAAM,CAAC,QAAQ,aAAaA,cAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,QAAQ,aAAaA,cAA4B,OAAO;EAC7D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,aAAa,WAAW;CAE9B,MAAM,QACJ,oBAACC;EACC,WAAW,GAAG,WAAW,YAAY,MAAM;EAC/B;EACZ,cAAc;EACE;EACR;EACE;EACV,gBAAgB,UAAU,MAAM;EAChC,YAAY,WAAS;AACnB,cAAWC,OAAK;AAChB,aAAU,MAAM;;EAEL;EACb;EACA,OAAO;GACL,GAAG;GACH,GAAG,cAAc;GAClB;EACD,QAAQ;EACF;EACG;GACT;AAGJ,KAAI,CAAC,SAAS,kBAAmB,QAAO;AAExC,QACE,8CACG,CAAC,UAAU,SACV,QAEA,oBAACC;EACC,WAAW,GAAG,WAAW,YAAY,SAAS;EACpC;EACa;EACvB,OAAO;GACL,QAAQ,aAAa,UAAU;GAC/B,GAAG;GACH,GAAG,cAAc;GAClB;EACD,SAAS;EACT,GAAI;YAEH,SAAS,eAAe;GAChB,EAEZ,UACC,oBAACC;EACC,SAAS;EACT,OAAO,OAAO;EACd,QAAQ,OAAO;EACP;EACE;EACA;EACV,iBAAiB;EACjB,eAAe,MAAM;AACnB,aAAU,EAAE;AACZ,aAAU,MAAM;;EAElB,MAAM;EACO;EACP;EACC;GACP,IAEH;EAGR;AAED,gBAAgB,cAAc;AAE9B,8BAAe"}
1
+ {"version":3,"file":"EditableMessage.mjs","names":["MessageInput","text","Markdown","MessageModal"],"sources":["../../../src/chat/EditableMessage/EditableMessage.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { memo } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Markdown from '@/Markdown';\nimport MessageInput from '@/chat/MessageInput';\nimport MessageModal from '@/chat/MessageModal';\n\nimport type { EditableMessageProps } from './type';\n\nconst EditableMessage = memo<EditableMessageProps>(\n ({\n value,\n onChange,\n classNames = {},\n onEditingChange,\n editing,\n openModal,\n onOpenChange,\n placeholder,\n showEditWhenEmpty = false,\n styles: customStyles,\n className,\n style,\n height,\n variant,\n editButtonSize,\n text,\n fullFeaturedCodeBlock,\n model,\n fontSize,\n language = 'markdown',\n markdownProps,\n }) => {\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [expand, setExpand] = useControlledState<boolean>(false, {\n onChange: onOpenChange,\n value: openModal,\n });\n\n const isAutoSize = height === 'auto';\n\n const input = (\n <MessageInput\n className={cx(className, classNames?.input)}\n classNames={classNames}\n defaultValue={value}\n editButtonSize={editButtonSize}\n height={height}\n language={language}\n onCancel={() => setTyping(false)}\n onConfirm={(text) => {\n onChange?.(text);\n setTyping(false);\n }}\n placeholder={placeholder}\n shortcut\n style={{\n ...style,\n ...customStyles?.input,\n }}\n styles={customStyles}\n text={text}\n variant={variant}\n />\n );\n\n if (!value && showEditWhenEmpty) return input;\n\n return (\n <>\n {!expand && isEdit ? (\n input\n ) : (\n <Markdown\n className={cx(className, classNames?.markdown)}\n fontSize={fontSize}\n fullFeaturedCodeBlock={fullFeaturedCodeBlock}\n style={{\n height: isAutoSize ? 'unset' : height,\n ...style,\n ...customStyles?.markdown,\n }}\n variant={'chat'}\n {...markdownProps}\n >\n {value || placeholder || ''}\n </Markdown>\n )}\n {expand && (\n <MessageModal\n editing={isEdit}\n extra={model?.extra}\n footer={model?.footer}\n height={height}\n language={language}\n onChange={onChange}\n onEditingChange={setTyping}\n onOpenChange={(e) => {\n setExpand(e);\n setTyping(false);\n }}\n open={expand}\n placeholder={placeholder}\n text={text}\n value={value}\n />\n )}\n </>\n );\n },\n);\n\nEditableMessage.displayName = 'EditableMessage';\n\nexport default EditableMessage;\n"],"mappings":";;;;;;;;;;;AAYA,MAAM,kBAAkB,MACrB,EACC,OACA,UACA,aAAa,EAAE,EACf,iBACA,SACA,WACA,cACA,aACA,oBAAoB,OACpB,QAAQ,cACR,WACA,OACA,QACA,SACA,gBACA,MACA,uBACA,OACA,UACA,WAAW,YACX,oBACI;CACJ,MAAM,CAAC,QAAQ,aAAa,mBAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,QAAQ,aAAa,mBAA4B,OAAO;EAC7D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,aAAa,WAAW;CAE9B,MAAM,QACJ,oBAACA;EACC,WAAW,GAAG,WAAW,YAAY,MAAM;EAC/B;EACZ,cAAc;EACE;EACR;EACE;EACV,gBAAgB,UAAU,MAAM;EAChC,YAAY,WAAS;AACnB,cAAWC,OAAK;AAChB,aAAU,MAAM;;EAEL;EACb;EACA,OAAO;GACL,GAAG;GACH,GAAG,cAAc;GAClB;EACD,QAAQ;EACF;EACG;GACT;AAGJ,KAAI,CAAC,SAAS,kBAAmB,QAAO;AAExC,QACE,8CACG,CAAC,UAAU,SACV,QAEA,oBAACC;EACC,WAAW,GAAG,WAAW,YAAY,SAAS;EACpC;EACa;EACvB,OAAO;GACL,QAAQ,aAAa,UAAU;GAC/B,GAAG;GACH,GAAG,cAAc;GAClB;EACD,SAAS;EACT,GAAI;YAEH,SAAS,eAAe;GAChB,EAEZ,UACC,oBAACC;EACC,SAAS;EACT,OAAO,OAAO;EACd,QAAQ,OAAO;EACP;EACE;EACA;EACV,iBAAiB;EACjB,eAAe,MAAM;AACnB,aAAU,EAAE;AACZ,aAAU,MAAM;;EAElB,MAAM;EACO;EACP;EACC;GACP,IAEH;EAGR;AAED,gBAAgB,cAAc;AAE9B,8BAAe"}
@@ -1,8 +1,8 @@
1
1
  import { EditableMessageListProps } from "./type.mjs";
2
- import * as react114 from "react";
2
+ import * as react113 from "react";
3
3
 
4
4
  //#region src/chat/EditableMessageList/EditableMessageList.d.ts
5
- declare const EditableMessageList: react114.NamedExoticComponent<EditableMessageListProps>;
5
+ declare const EditableMessageList: react113.NamedExoticComponent<EditableMessageListProps>;
6
6
  //#endregion
7
7
  export { EditableMessageList };
8
8
  //# sourceMappingURL=EditableMessageList.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MessageInputProps } from "./type.mjs";
2
- import * as react115 from "react";
2
+ import * as react114 from "react";
3
3
 
4
4
  //#region src/chat/MessageInput/MessageInput.d.ts
5
- declare const MessageInput: react115.NamedExoticComponent<MessageInputProps>;
5
+ declare const MessageInput: react114.NamedExoticComponent<MessageInputProps>;
6
6
  //#endregion
7
7
  export { MessageInput };
8
8
  //# sourceMappingURL=MessageInput.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { MessageModalProps } from "./type.mjs";
2
- import * as react116 from "react";
2
+ import * as react115 from "react";
3
3
 
4
4
  //#region src/chat/MessageModal/MessageModal.d.ts
5
- declare const MessageModal: react116.NamedExoticComponent<MessageModalProps>;
5
+ declare const MessageModal: react115.NamedExoticComponent<MessageModalProps>;
6
6
  //#endregion
7
7
  export { MessageModal };
8
8
  //# sourceMappingURL=MessageModal.d.mts.map
@@ -11,7 +11,7 @@ import { useStyles } from "../MessageInput/style.mjs";
11
11
  import messageModal_default from "../../i18n/resources/en/messageModal.mjs";
12
12
  import { memo, useState } from "react";
13
13
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
- import useMergeState from "use-merge-value";
14
+ import useControlledState from "use-merge-value";
15
15
  import { useResponsive } from "antd-style";
16
16
 
17
17
  //#region src/chat/MessageModal/MessageModal.tsx
@@ -19,11 +19,11 @@ const MessageModal = memo(({ panelRef, editing, open, height = "75vh", onOpenCha
19
19
  const { mobile } = useResponsive();
20
20
  const { styles: textStyles } = useStyles();
21
21
  const { t } = useTranslation(messageModal_default);
22
- const [isEdit, setTyping] = useMergeState(false, {
22
+ const [isEdit, setTyping] = useControlledState(false, {
23
23
  onChange: onEditingChange,
24
24
  value: editing
25
25
  });
26
- const [showModal, setShowModal] = useMergeState(false, {
26
+ const [showModal, setShowModal] = useControlledState(false, {
27
27
  onChange: onOpenChange,
28
28
  value: open
29
29
  });
@@ -1 +1 @@
1
- {"version":3,"file":"MessageModal.mjs","names":["useTextStyles","messageModalMessages","useControlledState","Modal","Flexbox","Button","TextArea","value","CodeEditor","Markdown"],"sources":["../../../src/chat/MessageModal/MessageModal.tsx"],"sourcesContent":["'use client';\n\nimport { useResponsive } from 'antd-style';\nimport { memo, useState } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Button from '@/Button';\nimport CodeEditor from '@/CodeEditor';\nimport { Flexbox } from '@/Flex';\nimport TextArea from '@/Input/TextArea';\nimport Markdown from '@/Markdown';\nimport Modal from '@/Modal';\nimport { useStyles as useTextStyles } from '@/chat/MessageInput/style';\nimport messageModalMessages from '@/i18n/resources/en/messageModal';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport type { MessageModalProps } from './type';\n\nconst MessageModal = memo<MessageModalProps>(\n ({\n panelRef,\n editing,\n open,\n height = '75vh',\n onOpenChange,\n onEditingChange,\n placeholder,\n value,\n language = 'markdown',\n onChange,\n text,\n footer,\n extra,\n }) => {\n const { mobile } = useResponsive();\n const { styles: textStyles } = useTextStyles();\n const { t } = useTranslation(messageModalMessages);\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [showModal, setShowModal] = useControlledState(false, {\n onChange: onOpenChange,\n value: open,\n });\n\n const [temporaryValue, setMessage] = useState(value);\n\n const confirmText = text?.confirm ?? t('messageModal.confirm');\n const cancelText = text?.cancel ?? t('messageModal.cancel');\n const editText = text?.edit ?? t('messageModal.edit');\n\n const modalFooter = isEdit ? (\n <Flexbox direction={'horizontal-reverse'} gap={8}>\n <Button\n onClick={() => {\n setTyping(false);\n onChange?.(temporaryValue);\n setMessage(value);\n }}\n type=\"primary\"\n >\n {confirmText}\n </Button>\n <Button\n onClick={() => {\n setTyping(false);\n setMessage(value);\n }}\n >\n {cancelText}\n </Button>\n </Flexbox>\n ) : (\n footer\n );\n\n return (\n <Modal\n allowFullscreen\n cancelText={cancelText}\n destroyOnHidden\n footer={modalFooter}\n height={height}\n okText={editText}\n onCancel={() => {\n setShowModal(false);\n setTyping(false);\n setMessage(value);\n }}\n onOk={() => setTyping(true)}\n open={showModal}\n panelRef={panelRef}\n title={text?.title}\n >\n {isEdit ? (\n mobile ? (\n <TextArea\n autoSize\n className={textStyles}\n defaultValue={temporaryValue}\n onBlur={(e) => setMessage(e.target.value)}\n onChange={(value) => setMessage(value.target.value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n ) : (\n <CodeEditor\n className={textStyles}\n defaultValue={temporaryValue}\n language={language}\n onBlur={(e) => setMessage(e.target.value)}\n onValueChange={(value) => setMessage(value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n )\n ) : (\n <>\n {extra}\n <Markdown variant={'chat'}>{String(value || placeholder)}</Markdown>\n </>\n )}\n </Modal>\n );\n },\n);\n\nMessageModal.displayName = 'MessageModal';\n\nexport default MessageModal;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAM,eAAe,MAClB,EACC,UACA,SACA,MACA,SAAS,QACT,cACA,iBACA,aACA,OACA,WAAW,YACX,UACA,MACA,QACA,YACI;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,QAAQ,eAAeA,WAAe;CAC9C,MAAM,EAAE,MAAM,eAAeC,qBAAqB;CAClD,MAAM,CAAC,QAAQ,aAAaC,cAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,WAAW,gBAAgBA,cAAmB,OAAO;EAC1D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,gBAAgB,cAAc,SAAS,MAAM;CAEpD,MAAM,cAAc,MAAM,WAAW,EAAE,uBAAuB;CAC9D,MAAM,aAAa,MAAM,UAAU,EAAE,sBAAsB;CAC3D,MAAM,WAAW,MAAM,QAAQ,EAAE,oBAAoB;AA2BrD,QACE,oBAACC;EACC;EACY;EACZ;EACA,QA9BgB,SAClB,qBAACC;GAAQ,WAAW;GAAsB,KAAK;cAC7C,oBAACC;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,eAAe;AAC1B,gBAAW,MAAM;;IAEnB,MAAK;cAEJ;KACM,EACT,oBAACA;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,MAAM;;cAGlB;KACM;IACD,GAEV;EASU;EACR,QAAQ;EACR,gBAAgB;AACd,gBAAa,MAAM;AACnB,aAAU,MAAM;AAChB,cAAW,MAAM;;EAEnB,YAAY,UAAU,KAAK;EAC3B,MAAM;EACI;EACV,OAAO,MAAM;YAEZ,SACC,SACE,oBAACC;GACC;GACA,WAAW;GACX,cAAc;GACd,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,WAAW,YAAU,WAAWC,QAAM,OAAO,MAAM;GACtC;GACb,OAAO;GACP,SAAS;IACT,GAEF,oBAACC;GACC,WAAW;GACX,cAAc;GACJ;GACV,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,gBAAgB,YAAU,WAAWD,QAAM;GAC9B;GACb,OAAO;GACP,SAAS;IACT,GAGJ,8CACG,OACD,oBAACE;GAAS,SAAS;aAAS,OAAO,SAAS,YAAY;IAAY,IACnE;GAEC;EAGb;AAED,aAAa,cAAc;AAE3B,2BAAe"}
1
+ {"version":3,"file":"MessageModal.mjs","names":["useTextStyles","messageModalMessages","Modal","Flexbox","Button","TextArea","value","CodeEditor","Markdown"],"sources":["../../../src/chat/MessageModal/MessageModal.tsx"],"sourcesContent":["'use client';\n\nimport { useResponsive } from 'antd-style';\nimport { memo, useState } from 'react';\nimport useControlledState from 'use-merge-value';\n\nimport Button from '@/Button';\nimport CodeEditor from '@/CodeEditor';\nimport { Flexbox } from '@/Flex';\nimport TextArea from '@/Input/TextArea';\nimport Markdown from '@/Markdown';\nimport Modal from '@/Modal';\nimport { useStyles as useTextStyles } from '@/chat/MessageInput/style';\nimport messageModalMessages from '@/i18n/resources/en/messageModal';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport type { MessageModalProps } from './type';\n\nconst MessageModal = memo<MessageModalProps>(\n ({\n panelRef,\n editing,\n open,\n height = '75vh',\n onOpenChange,\n onEditingChange,\n placeholder,\n value,\n language = 'markdown',\n onChange,\n text,\n footer,\n extra,\n }) => {\n const { mobile } = useResponsive();\n const { styles: textStyles } = useTextStyles();\n const { t } = useTranslation(messageModalMessages);\n const [isEdit, setTyping] = useControlledState(false, {\n onChange: onEditingChange,\n value: editing,\n });\n\n const [showModal, setShowModal] = useControlledState(false, {\n onChange: onOpenChange,\n value: open,\n });\n\n const [temporaryValue, setMessage] = useState(value);\n\n const confirmText = text?.confirm ?? t('messageModal.confirm');\n const cancelText = text?.cancel ?? t('messageModal.cancel');\n const editText = text?.edit ?? t('messageModal.edit');\n\n const modalFooter = isEdit ? (\n <Flexbox direction={'horizontal-reverse'} gap={8}>\n <Button\n onClick={() => {\n setTyping(false);\n onChange?.(temporaryValue);\n setMessage(value);\n }}\n type=\"primary\"\n >\n {confirmText}\n </Button>\n <Button\n onClick={() => {\n setTyping(false);\n setMessage(value);\n }}\n >\n {cancelText}\n </Button>\n </Flexbox>\n ) : (\n footer\n );\n\n return (\n <Modal\n allowFullscreen\n cancelText={cancelText}\n destroyOnHidden\n footer={modalFooter}\n height={height}\n okText={editText}\n onCancel={() => {\n setShowModal(false);\n setTyping(false);\n setMessage(value);\n }}\n onOk={() => setTyping(true)}\n open={showModal}\n panelRef={panelRef}\n title={text?.title}\n >\n {isEdit ? (\n mobile ? (\n <TextArea\n autoSize\n className={textStyles}\n defaultValue={temporaryValue}\n onBlur={(e) => setMessage(e.target.value)}\n onChange={(value) => setMessage(value.target.value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n ) : (\n <CodeEditor\n className={textStyles}\n defaultValue={temporaryValue}\n language={language}\n onBlur={(e) => setMessage(e.target.value)}\n onValueChange={(value) => setMessage(value)}\n placeholder={placeholder}\n value={temporaryValue}\n variant={'borderless'}\n />\n )\n ) : (\n <>\n {extra}\n <Markdown variant={'chat'}>{String(value || placeholder)}</Markdown>\n </>\n )}\n </Modal>\n );\n },\n);\n\nMessageModal.displayName = 'MessageModal';\n\nexport default MessageModal;\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,MAAM,eAAe,MAClB,EACC,UACA,SACA,MACA,SAAS,QACT,cACA,iBACA,aACA,OACA,WAAW,YACX,UACA,MACA,QACA,YACI;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,QAAQ,eAAeA,WAAe;CAC9C,MAAM,EAAE,MAAM,eAAeC,qBAAqB;CAClD,MAAM,CAAC,QAAQ,aAAa,mBAAmB,OAAO;EACpD,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,WAAW,gBAAgB,mBAAmB,OAAO;EAC1D,UAAU;EACV,OAAO;EACR,CAAC;CAEF,MAAM,CAAC,gBAAgB,cAAc,SAAS,MAAM;CAEpD,MAAM,cAAc,MAAM,WAAW,EAAE,uBAAuB;CAC9D,MAAM,aAAa,MAAM,UAAU,EAAE,sBAAsB;CAC3D,MAAM,WAAW,MAAM,QAAQ,EAAE,oBAAoB;AA2BrD,QACE,oBAACC;EACC;EACY;EACZ;EACA,QA9BgB,SAClB,qBAACC;GAAQ,WAAW;GAAsB,KAAK;cAC7C,oBAACC;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,eAAe;AAC1B,gBAAW,MAAM;;IAEnB,MAAK;cAEJ;KACM,EACT,oBAACA;IACC,eAAe;AACb,eAAU,MAAM;AAChB,gBAAW,MAAM;;cAGlB;KACM;IACD,GAEV;EASU;EACR,QAAQ;EACR,gBAAgB;AACd,gBAAa,MAAM;AACnB,aAAU,MAAM;AAChB,cAAW,MAAM;;EAEnB,YAAY,UAAU,KAAK;EAC3B,MAAM;EACI;EACV,OAAO,MAAM;YAEZ,SACC,SACE,oBAACC;GACC;GACA,WAAW;GACX,cAAc;GACd,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,WAAW,YAAU,WAAWC,QAAM,OAAO,MAAM;GACtC;GACb,OAAO;GACP,SAAS;IACT,GAEF,oBAACC;GACC,WAAW;GACX,cAAc;GACJ;GACV,SAAS,MAAM,WAAW,EAAE,OAAO,MAAM;GACzC,gBAAgB,YAAU,WAAWD,QAAM;GAC9B;GACb,OAAO;GACP,SAAS;IACT,GAGJ,8CACG,OACD,oBAACE;GAAS,SAAS;aAAS,OAAO,SAAS,YAAY;IAAY,IACnE;GAEC;EAGb;AAED,aAAa,cAAc;AAE3B,2BAAe"}
@@ -1,64 +1,54 @@
1
1
  'use client';
2
2
 
3
- import FluentEmoji_default from "../../FluentEmoji/FluentEmoji.mjs";
4
- import Button_default from "../../Button/Button.mjs";
3
+ import ActionIcon_default from "../../ActionIcon/ActionIcon.mjs";
5
4
  import { useTranslation } from "../../i18n/useTranslation.mjs";
6
5
  import chat_default from "../../i18n/resources/en/chat.mjs";
7
- import { useStyles } from "./style.mjs";
8
6
  import { useMemo } from "react";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- import { useResponsive } from "antd-style";
11
- import { cva } from "class-variance-authority";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import { Progress } from "antd";
9
+ import { useTheme } from "antd-style";
12
10
  import numeral from "numeral";
13
11
 
14
12
  //#region src/chat/TokenTag/TokenTag.tsx
15
13
  const format = (number) => numeral(number).format("0,0");
16
- const TokenTag = ({ className, shape = "round", mode = "remained", maxValue, value, text, unoptimized, hideText, ref, ...rest }) => {
17
- const { mobile } = useResponsive();
14
+ const TokenTag = ({ mode = "remained", maxValue, value, text, showInfo, size = 20, ...rest }) => {
15
+ const theme = useTheme();
18
16
  const { t } = useTranslation(chat_default);
19
17
  const valueLeft = maxValue - value;
20
- const percent = valueLeft / maxValue;
21
- const showText = !hideText && !mobile;
18
+ const percent = value / maxValue;
22
19
  const remainedText = text?.remained ?? t("tokenTag.remained");
23
20
  const usedText = text?.used ?? t("tokenTag.used");
24
21
  const overloadText = text?.overload ?? t("tokenTag.overload");
25
22
  const data = useMemo(() => {
26
23
  let type;
27
- let emoji;
28
- if (percent > .3) {
24
+ let color;
25
+ if (percent < .7) {
29
26
  type = "normal";
30
- emoji = "😀";
31
- } else if (percent > 0) {
27
+ color = theme.colorText;
28
+ } else if (percent < .9) {
32
29
  type = "low";
33
- emoji = "😅";
30
+ color = theme.colorWarning;
34
31
  } else {
35
32
  type = "overload";
36
- emoji = "🤯";
33
+ color = theme.colorError;
37
34
  }
38
35
  return {
39
- emoji,
36
+ color,
40
37
  type
41
38
  };
42
- }, [percent]);
43
- const { styles, cx: cx$1 } = useStyles();
44
- return /* @__PURE__ */ jsxs(Button_default, {
45
- className: cx$1(useMemo(() => cva(styles.root, {
46
- defaultVariants: { type: "normal" },
47
- variants: { type: {
48
- normal: styles.normal,
49
- low: styles.low,
50
- overload: styles.overload
51
- } }
52
- }), [styles])({ type: data.type }), className),
53
- ref,
54
- shape,
55
- variant: "filled",
56
- ...rest,
57
- children: [/* @__PURE__ */ jsx(FluentEmoji_default, {
58
- emoji: data.emoji,
59
- size: 18,
60
- unoptimized
61
- }), valueLeft > 0 ? [showText ? mode === "remained" ? remainedText : usedText : "", mode === "remained" ? format(valueLeft) : format(value)].join(" ") : overloadText]
39
+ }, [percent, theme]);
40
+ const title = valueLeft > 0 ? [mode === "remained" ? remainedText : usedText, mode === "remained" ? format(valueLeft) : format(value)].join(" ") : overloadText;
41
+ return /* @__PURE__ */ jsx(ActionIcon_default, {
42
+ icon: /* @__PURE__ */ jsx(Progress, {
43
+ percent: percent * 100,
44
+ showInfo: false,
45
+ size: Number(typeof size === "object" ? size?.size || 20 : size) || 20,
46
+ strokeColor: data.color,
47
+ type: "circle"
48
+ }),
49
+ size,
50
+ title: showInfo ? title : void 0,
51
+ ...rest
62
52
  });
63
53
  };
64
54
  TokenTag.displayName = "TokenTag";
@@ -1 +1 @@
1
- {"version":3,"file":"TokenTag.mjs","names":["TokenTag: FC<TokenTagProps>","chatMessages","type: 'normal' | 'low' | 'overload'","Button","cx","FluentEmoji"],"sources":["../../../src/chat/TokenTag/TokenTag.tsx"],"sourcesContent":["'use client';\n\nimport { useResponsive } from 'antd-style';\nimport { cva } from 'class-variance-authority';\nimport numeral from 'numeral';\nimport { type FC, useMemo } from 'react';\n\nimport Button from '@/Button';\nimport FluentEmoji from '@/FluentEmoji';\nimport chatMessages from '@/i18n/resources/en/chat';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport { useStyles } from './style';\nimport type { TokenTagProps } from './type';\n\nconst format = (number: number) => numeral(number).format('0,0');\n\nconst TokenTag: FC<TokenTagProps> = ({\n className,\n shape = 'round',\n mode = 'remained',\n maxValue,\n value,\n text,\n unoptimized,\n hideText,\n ref,\n ...rest\n}) => {\n const { mobile } = useResponsive();\n const { t } = useTranslation(chatMessages);\n const valueLeft = maxValue - value;\n const percent = valueLeft / maxValue;\n const showText = !hideText && !mobile;\n const remainedText = text?.remained ?? t('tokenTag.remained');\n const usedText = text?.used ?? t('tokenTag.used');\n const overloadText = text?.overload ?? t('tokenTag.overload');\n\n const data = useMemo(() => {\n let type: 'normal' | 'low' | 'overload';\n let emoji;\n\n if (percent > 0.3) {\n type = 'normal';\n emoji = '😀';\n } else if (percent > 0) {\n type = 'low';\n emoji = '😅';\n } else {\n type = 'overload';\n emoji = '🤯';\n }\n return {\n emoji,\n type,\n };\n }, [percent]);\n\n const { styles, cx } = useStyles();\n\n const variants = useMemo(\n () =>\n cva(styles.root, {\n defaultVariants: {\n type: 'normal',\n },\n /* eslint-disable sort-keys-fix/sort-keys-fix */\n variants: {\n type: {\n normal: styles.normal,\n low: styles.low,\n overload: styles.overload,\n },\n },\n /* eslint-enable sort-keys-fix/sort-keys-fix */\n }),\n [styles],\n );\n\n return (\n <Button\n className={cx(variants({ type: data.type }), className)}\n ref={ref}\n shape={shape}\n variant={'filled'}\n {...rest}\n >\n <FluentEmoji emoji={data.emoji} size={18} unoptimized={unoptimized} />\n {valueLeft > 0\n ? [\n showText ? (mode === 'remained' ? remainedText : usedText) : '',\n mode === 'remained' ? format(valueLeft) : format(value),\n ].join(' ')\n : overloadText}\n </Button>\n );\n};\n\nTokenTag.displayName = 'TokenTag';\n\nexport default TokenTag;\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,UAAU,WAAmB,QAAQ,OAAO,CAAC,OAAO,MAAM;AAEhE,MAAMA,YAA+B,EACnC,WACA,QAAQ,SACR,OAAO,YACP,UACA,OACA,MACA,aACA,UACA,KACA,GAAG,WACC;CACJ,MAAM,EAAE,WAAW,eAAe;CAClC,MAAM,EAAE,MAAM,eAAeC,aAAa;CAC1C,MAAM,YAAY,WAAW;CAC7B,MAAM,UAAU,YAAY;CAC5B,MAAM,WAAW,CAAC,YAAY,CAAC;CAC/B,MAAM,eAAe,MAAM,YAAY,EAAE,oBAAoB;CAC7D,MAAM,WAAW,MAAM,QAAQ,EAAE,gBAAgB;CACjD,MAAM,eAAe,MAAM,YAAY,EAAE,oBAAoB;CAE7D,MAAM,OAAO,cAAc;EACzB,IAAIC;EACJ,IAAI;AAEJ,MAAI,UAAU,IAAK;AACjB,UAAO;AACP,WAAQ;aACC,UAAU,GAAG;AACtB,UAAO;AACP,WAAQ;SACH;AACL,UAAO;AACP,WAAQ;;AAEV,SAAO;GACL;GACA;GACD;IACA,CAAC,QAAQ,CAAC;CAEb,MAAM,EAAE,QAAQ,aAAO,WAAW;AAqBlC,QACE,qBAACC;EACC,WAAWC,KArBE,cAEb,IAAI,OAAO,MAAM;GACf,iBAAiB,EACf,MAAM,UACP;GAED,UAAU,EACR,MAAM;IACJ,QAAQ,OAAO;IACf,KAAK,OAAO;IACZ,UAAU,OAAO;IAClB,EACF;GAEF,CAAC,EACJ,CAAC,OAAO,CACT,CAI0B,EAAE,MAAM,KAAK,MAAM,CAAC,EAAE,UAAU;EAClD;EACE;EACP,SAAS;EACT,GAAI;aAEJ,oBAACC;GAAY,OAAO,KAAK;GAAO,MAAM;GAAiB;IAAe,EACrE,YAAY,IACT,CACE,WAAY,SAAS,aAAa,eAAe,WAAY,IAC7D,SAAS,aAAa,OAAO,UAAU,GAAG,OAAO,MAAM,CACxD,CAAC,KAAK,IAAI,GACX;GACG;;AAIb,SAAS,cAAc;AAEvB,uBAAe"}
1
+ {"version":3,"file":"TokenTag.mjs","names":["TokenTag: FC<TokenTagProps>","chatMessages","type: 'normal' | 'low' | 'overload'","ActionIcon"],"sources":["../../../src/chat/TokenTag/TokenTag.tsx"],"sourcesContent":["'use client';\n\nimport { Progress } from 'antd';\nimport { useTheme } from 'antd-style';\nimport numeral from 'numeral';\nimport { type FC, useMemo } from 'react';\n\nimport ActionIcon from '@/ActionIcon';\nimport chatMessages from '@/i18n/resources/en/chat';\nimport { useTranslation } from '@/i18n/useTranslation';\n\nimport type { TokenTagProps } from './type';\n\nconst format = (number: number) => numeral(number).format('0,0');\n\nconst TokenTag: FC<TokenTagProps> = ({\n mode = 'remained',\n maxValue,\n value,\n text,\n showInfo,\n size = 20,\n ...rest\n}) => {\n const theme = useTheme();\n const { t } = useTranslation(chatMessages);\n const valueLeft = maxValue - value;\n const percent = value / maxValue;\n const remainedText = text?.remained ?? t('tokenTag.remained');\n const usedText = text?.used ?? t('tokenTag.used');\n const overloadText = text?.overload ?? t('tokenTag.overload');\n\n const data = useMemo(() => {\n let type: 'normal' | 'low' | 'overload';\n let color;\n\n if (percent < 0.7) {\n type = 'normal';\n color = theme.colorText;\n } else if (percent < 0.9) {\n type = 'low';\n color = theme.colorWarning;\n } else {\n type = 'overload';\n color = theme.colorError;\n }\n return {\n color,\n type,\n };\n }, [percent, theme]);\n\n const title =\n valueLeft > 0\n ? [\n mode === 'remained' ? remainedText : usedText,\n mode === 'remained' ? format(valueLeft) : format(value),\n ].join(' ')\n : overloadText;\n\n return (\n <ActionIcon\n icon={\n <Progress\n percent={percent * 100}\n showInfo={false}\n size={Number(typeof size === 'object' ? size?.size || 20 : size) || 20}\n strokeColor={data.color}\n type=\"circle\"\n />\n }\n size={size}\n title={showInfo ? title : undefined}\n {...rest}\n />\n );\n};\n\nTokenTag.displayName = 'TokenTag';\n\nexport default TokenTag;\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,UAAU,WAAmB,QAAQ,OAAO,CAAC,OAAO,MAAM;AAEhE,MAAMA,YAA+B,EACnC,OAAO,YACP,UACA,OACA,MACA,UACA,OAAO,IACP,GAAG,WACC;CACJ,MAAM,QAAQ,UAAU;CACxB,MAAM,EAAE,MAAM,eAAeC,aAAa;CAC1C,MAAM,YAAY,WAAW;CAC7B,MAAM,UAAU,QAAQ;CACxB,MAAM,eAAe,MAAM,YAAY,EAAE,oBAAoB;CAC7D,MAAM,WAAW,MAAM,QAAQ,EAAE,gBAAgB;CACjD,MAAM,eAAe,MAAM,YAAY,EAAE,oBAAoB;CAE7D,MAAM,OAAO,cAAc;EACzB,IAAIC;EACJ,IAAI;AAEJ,MAAI,UAAU,IAAK;AACjB,UAAO;AACP,WAAQ,MAAM;aACL,UAAU,IAAK;AACxB,UAAO;AACP,WAAQ,MAAM;SACT;AACL,UAAO;AACP,WAAQ,MAAM;;AAEhB,SAAO;GACL;GACA;GACD;IACA,CAAC,SAAS,MAAM,CAAC;CAEpB,MAAM,QACJ,YAAY,IACR,CACE,SAAS,aAAa,eAAe,UACrC,SAAS,aAAa,OAAO,UAAU,GAAG,OAAO,MAAM,CACxD,CAAC,KAAK,IAAI,GACX;AAEN,QACE,oBAACC;EACC,MACE,oBAAC;GACC,SAAS,UAAU;GACnB,UAAU;GACV,MAAM,OAAO,OAAO,SAAS,WAAW,MAAM,QAAQ,KAAK,KAAK,IAAI;GACpE,aAAa,KAAK;GAClB,MAAK;IACL;EAEE;EACN,OAAO,WAAW,QAAQ;EAC1B,GAAI;GACJ;;AAIN,SAAS,cAAc;AAEvB,uBAAe"}
@@ -1,19 +1,16 @@
1
- import { ButtonProps } from "../../Button/type.mjs";
2
- import "../../Button/index.mjs";
3
- import { Ref } from "react";
1
+ import { ActionIconProps } from "../../ActionIcon/type.mjs";
2
+ import "../../ActionIcon/index.mjs";
4
3
 
5
4
  //#region src/chat/TokenTag/type.d.ts
6
- interface TokenTagProps extends ButtonProps {
7
- hideText?: boolean;
5
+ interface TokenTagProps extends ActionIconProps {
8
6
  maxValue: number;
9
7
  mode?: 'remained' | 'used';
10
- ref?: Ref<HTMLButtonElement>;
8
+ showInfo?: boolean;
11
9
  text?: {
12
10
  overload?: string;
13
11
  remained?: string;
14
12
  used?: string;
15
13
  };
16
- unoptimized?: boolean;
17
14
  value: number;
18
15
  }
19
16
  //#endregion
@@ -1,5 +1,5 @@
1
1
  import { ColorScaleItem } from "../types.mjs";
2
- import * as react0 from "react";
2
+ import * as react32 from "react";
3
3
 
4
4
  //#region src/color/ColorScales/index.d.ts
5
5
  interface ColorScalesProps {
@@ -16,7 +16,7 @@ interface ColorScalesProps {
16
16
  */
17
17
  scale: ColorScaleItem;
18
18
  }
19
- declare const ColorScales: react0.NamedExoticComponent<ColorScalesProps>;
19
+ declare const ColorScales: react32.NamedExoticComponent<ColorScalesProps>;
20
20
  //#endregion
21
21
  export { ColorScales, ColorScalesProps };
22
22
  //# sourceMappingURL=index.d.mts.map
@@ -1,7 +1,7 @@
1
1
  import { MotionComponentType } from "../MotionProvider/index.mjs";
2
2
  import { I18nContextValue, TranslationKey, TranslationResources, TranslationResourcesInput } from "./types.mjs";
3
3
  import "../ConfigProvider/index.mjs";
4
- import * as react3 from "react";
4
+ import * as react31 from "react";
5
5
  import { ReactNode } from "react";
6
6
 
7
7
  //#region src/i18n/context.d.ts
@@ -11,7 +11,7 @@ interface I18nProviderProps {
11
11
  motion: MotionComponentType;
12
12
  resources?: TranslationResourcesInput;
13
13
  }
14
- declare const I18nProvider: react3.NamedExoticComponent<I18nProviderProps>;
14
+ declare const I18nProvider: react31.NamedExoticComponent<I18nProviderProps>;
15
15
  //#endregion
16
16
  export { I18nProvider, I18nProviderProps };
17
17
  //# sourceMappingURL=context.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react76 from "react";
1
+ import * as react71 from "react";
2
2
  import * as lucide_react0 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/BotPromptIcon.d.ts
5
- declare const BotPromptIcon: react76.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react76.RefAttributes<SVGSVGElement>>;
5
+ declare const BotPromptIcon: react71.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react71.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { BotPromptIcon };
8
8
  //# sourceMappingURL=BotPromptIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react78 from "react";
1
+ import * as react75 from "react";
2
2
  import * as lucide_react1 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/CreateBotIcon.d.ts
5
- declare const CreateBotIcon: react78.ForwardRefExoticComponent<Omit<lucide_react1.LucideProps, "ref"> & react78.RefAttributes<SVGSVGElement>>;
5
+ declare const CreateBotIcon: react75.ForwardRefExoticComponent<Omit<lucide_react1.LucideProps, "ref"> & react75.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { CreateBotIcon };
8
8
  //# sourceMappingURL=CreateBotIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react80 from "react";
1
+ import * as react77 from "react";
2
2
  import * as lucide_react2 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/DiscordIcon.d.ts
5
- declare const DiscordIcon: react80.ForwardRefExoticComponent<Omit<lucide_react2.LucideProps, "ref"> & react80.RefAttributes<SVGSVGElement>>;
5
+ declare const DiscordIcon: react77.ForwardRefExoticComponent<Omit<lucide_react2.LucideProps, "ref"> & react77.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { DiscordIcon };
8
8
  //# sourceMappingURL=DiscordIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react74 from "react";
1
+ import * as react73 from "react";
2
2
  import * as lucide_react0 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/GlobeOffIcon.d.ts
5
- declare const GlobeOffIcon: react74.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react74.RefAttributes<SVGSVGElement>>;
5
+ declare const GlobeOffIcon: react73.ForwardRefExoticComponent<Omit<lucide_react0.LucideProps, "ref"> & react73.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { GlobeOffIcon };
8
8
  //# sourceMappingURL=GlobeOffIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react84 from "react";
1
+ import * as react81 from "react";
2
2
  import * as lucide_react4 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/GroupBotIcon.d.ts
5
- declare const GroupBotIcon: react84.ForwardRefExoticComponent<Omit<lucide_react4.LucideProps, "ref"> & react84.RefAttributes<SVGSVGElement>>;
5
+ declare const GroupBotIcon: react81.ForwardRefExoticComponent<Omit<lucide_react4.LucideProps, "ref"> & react81.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { GroupBotIcon };
8
8
  //# sourceMappingURL=GroupBotIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react88 from "react";
2
- import * as lucide_react6 from "lucide-react";
1
+ import * as react83 from "react";
2
+ import * as lucide_react5 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/GroupBotSquareIcon.d.ts
5
- declare const GroupBotSquareIcon: react88.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react88.RefAttributes<SVGSVGElement>>;
5
+ declare const GroupBotSquareIcon: react83.ForwardRefExoticComponent<Omit<lucide_react5.LucideProps, "ref"> & react83.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { GroupBotSquareIcon };
8
8
  //# sourceMappingURL=GroupBotSquareIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react90 from "react";
2
- import * as lucide_react7 from "lucide-react";
1
+ import * as react79 from "react";
2
+ import * as lucide_react3 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/LeftClickIcon.d.ts
5
- declare const LeftClickIcon: react90.ForwardRefExoticComponent<Omit<lucide_react7.LucideProps, "ref"> & react90.RefAttributes<SVGSVGElement>>;
5
+ declare const LeftClickIcon: react79.ForwardRefExoticComponent<Omit<lucide_react3.LucideProps, "ref"> & react79.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { LeftClickIcon };
8
8
  //# sourceMappingURL=LeftClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react94 from "react";
2
- import * as lucide_react9 from "lucide-react";
1
+ import * as react93 from "react";
2
+ import * as lucide_react10 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/LeftDoubleClickIcon.d.ts
5
- declare const LeftDoubleClickIcon: react94.ForwardRefExoticComponent<Omit<lucide_react9.LucideProps, "ref"> & react94.RefAttributes<SVGSVGElement>>;
5
+ declare const LeftDoubleClickIcon: react93.ForwardRefExoticComponent<Omit<lucide_react10.LucideProps, "ref"> & react93.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { LeftDoubleClickIcon };
8
8
  //# sourceMappingURL=LeftDoubleClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react82 from "react";
2
- import * as lucide_react3 from "lucide-react";
1
+ import * as react87 from "react";
2
+ import * as lucide_react7 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/McpIcon.d.ts
5
- declare const McpIcon: react82.ForwardRefExoticComponent<Omit<lucide_react3.LucideProps, "ref"> & react82.RefAttributes<SVGSVGElement>>;
5
+ declare const McpIcon: react87.ForwardRefExoticComponent<Omit<lucide_react7.LucideProps, "ref"> & react87.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { McpIcon };
8
8
  //# sourceMappingURL=McpIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react92 from "react";
1
+ import * as react89 from "react";
2
2
  import * as lucide_react8 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/ProviderIcon.d.ts
5
- declare const ProviderIcon: react92.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react92.RefAttributes<SVGSVGElement>>;
5
+ declare const ProviderIcon: react89.ForwardRefExoticComponent<Omit<lucide_react8.LucideProps, "ref"> & react89.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { ProviderIcon };
8
8
  //# sourceMappingURL=ProviderIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react96 from "react";
2
- import * as lucide_react10 from "lucide-react";
1
+ import * as react85 from "react";
2
+ import * as lucide_react6 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/RightClickIcon.d.ts
5
- declare const RightClickIcon: react96.ForwardRefExoticComponent<Omit<lucide_react10.LucideProps, "ref"> & react96.RefAttributes<SVGSVGElement>>;
5
+ declare const RightClickIcon: react85.ForwardRefExoticComponent<Omit<lucide_react6.LucideProps, "ref"> & react85.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { RightClickIcon };
8
8
  //# sourceMappingURL=RightClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react98 from "react";
2
- import * as lucide_react11 from "lucide-react";
1
+ import * as react99 from "react";
2
+ import * as lucide_react13 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/RightDoubleClickIcon.d.ts
5
- declare const RightDoubleClickIcon: react98.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react98.RefAttributes<SVGSVGElement>>;
5
+ declare const RightDoubleClickIcon: react99.ForwardRefExoticComponent<Omit<lucide_react13.LucideProps, "ref"> & react99.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { RightDoubleClickIcon };
8
8
  //# sourceMappingURL=RightDoubleClickIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react100 from "react";
2
- import * as lucide_react12 from "lucide-react";
1
+ import * as react95 from "react";
2
+ import * as lucide_react11 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/ShapesUploadIcon.d.ts
5
- declare const ShapesUploadIcon: react100.ForwardRefExoticComponent<Omit<lucide_react12.LucideProps, "ref"> & react100.RefAttributes<SVGSVGElement>>;
5
+ declare const ShapesUploadIcon: react95.ForwardRefExoticComponent<Omit<lucide_react11.LucideProps, "ref"> & react95.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { ShapesUploadIcon };
8
8
  //# sourceMappingURL=ShapesUploadIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react102 from "react";
2
- import * as lucide_react13 from "lucide-react";
1
+ import * as react97 from "react";
2
+ import * as lucide_react12 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/TreeDownRightIcon.d.ts
5
- declare const TreeDownRightIcon: react102.ForwardRefExoticComponent<Omit<lucide_react13.LucideProps, "ref"> & react102.RefAttributes<SVGSVGElement>>;
5
+ declare const TreeDownRightIcon: react97.ForwardRefExoticComponent<Omit<lucide_react12.LucideProps, "ref"> & react97.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { TreeDownRightIcon };
8
8
  //# sourceMappingURL=TreeDownRightIcon.d.mts.map
@@ -1,8 +1,8 @@
1
- import * as react86 from "react";
2
- import * as lucide_react5 from "lucide-react";
1
+ import * as react91 from "react";
2
+ import * as lucide_react9 from "lucide-react";
3
3
 
4
4
  //#region src/icons/lucideExtra/TreeUpDownRightIcon.d.ts
5
- declare const TreeUpDownRightIcon: react86.ForwardRefExoticComponent<Omit<lucide_react5.LucideProps, "ref"> & react86.RefAttributes<SVGSVGElement>>;
5
+ declare const TreeUpDownRightIcon: react91.ForwardRefExoticComponent<Omit<lucide_react9.LucideProps, "ref"> & react91.RefAttributes<SVGSVGElement>>;
6
6
  //#endregion
7
7
  export { TreeUpDownRightIcon };
8
8
  //# sourceMappingURL=TreeUpDownRightIcon.d.mts.map
@@ -1,6 +1,6 @@
1
1
  import { TypographyProps } from "../../Markdown/type.mjs";
2
2
  import "../../Markdown/index.mjs";
3
- import * as react48 from "react";
3
+ import * as react33 from "react";
4
4
  import { ReactNode } from "react";
5
5
  import { Pluggable } from "unified";
6
6
 
@@ -18,7 +18,7 @@ interface MdxProps extends Omit<TypographyProps, 'children'> {
18
18
  remarkPlugins?: Pluggable[];
19
19
  variant?: 'normal' | 'chat';
20
20
  }
21
- declare const Mdx: react48.NamedExoticComponent<MdxProps>;
21
+ declare const Mdx: react33.NamedExoticComponent<MdxProps>;
22
22
  //#endregion
23
23
  export { Mdx, MdxProps };
24
24
  //# sourceMappingURL=index.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ChatHeaderTitleProps } from "./type.mjs";
2
- import * as react107 from "react";
2
+ import * as react106 from "react";
3
3
 
4
4
  //#region src/mobile/ChatHeader/ChatHeaderTitle.d.ts
5
- declare const ChatHeaderTitle: react107.NamedExoticComponent<ChatHeaderTitleProps>;
5
+ declare const ChatHeaderTitle: react106.NamedExoticComponent<ChatHeaderTitleProps>;
6
6
  //#endregion
7
7
  export { ChatHeaderTitle };
8
8
  //# sourceMappingURL=ChatHeaderTitle.d.mts.map
@@ -1,8 +1,8 @@
1
1
  import { ChatSendButtonProps } from "../type.mjs";
2
- import * as react106 from "react";
2
+ import * as react107 from "react";
3
3
 
4
4
  //#region src/mobile/ChatInputArea/components/ChatSendButton.d.ts
5
- declare const ChatSendButton: react106.NamedExoticComponent<ChatSendButtonProps>;
5
+ declare const ChatSendButton: react107.NamedExoticComponent<ChatSendButtonProps>;
6
6
  //#endregion
7
7
  export { ChatSendButton };
8
8
  //# sourceMappingURL=ChatSendButton.d.mts.map
@@ -5,11 +5,11 @@ import SafeArea_default from "../SafeArea/SafeArea.mjs";
5
5
  import { useStyles } from "./style.mjs";
6
6
  import { memo } from "react";
7
7
  import { jsx, jsxs } from "react/jsx-runtime";
8
- import useMergeState from "use-merge-value";
8
+ import useControlledState from "use-merge-value";
9
9
 
10
10
  //#region src/mobile/TabBar/TabBar.tsx
11
11
  const TabBar = memo(({ ref, className, safeArea, items, activeKey, defaultActiveKey, onChange, ...rest }) => {
12
- const [currentActive, setCurrentActive] = useMergeState(defaultActiveKey || items[0].key, {
12
+ const [currentActive, setCurrentActive] = useControlledState(defaultActiveKey || items[0].key, {
13
13
  defaultValue: defaultActiveKey,
14
14
  onChange,
15
15
  value: activeKey
@@ -1 +1 @@
1
- {"version":3,"file":"TabBar.mjs","names":["Flexbox","SafeArea"],"sources":["../../../src/mobile/TabBar/TabBar.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\nimport useMergeState from 'use-merge-value';\n\nimport { Flexbox } from '@/Flex';\nimport SafeArea from '@/mobile/SafeArea';\n\nimport { useStyles } from './style';\nimport type { TabBarProps } from './type';\n\nconst TabBar = memo<TabBarProps>(\n ({ ref, className, safeArea, items, activeKey, defaultActiveKey, onChange, ...rest }) => {\n const [currentActive, setCurrentActive] = useMergeState<string>(\n defaultActiveKey || items[0].key,\n {\n defaultValue: defaultActiveKey,\n onChange,\n value: activeKey,\n },\n );\n const { styles, cx } = useStyles();\n\n return (\n <Flexbox as={'footer'} className={cx(styles.container, className)} ref={ref} {...rest}>\n <Flexbox\n align={'center'}\n className={cx(styles.inner, className)}\n horizontal\n justify={'space-around'}\n >\n {items.map((item) => {\n const active = item.key === currentActive;\n return (\n <Flexbox\n align={'center'}\n className={cx(styles.tab, active && styles.active)}\n gap={4}\n justify={'center'}\n key={item.key}\n onClick={() => {\n setCurrentActive(item.key);\n item?.onClick?.();\n }}\n >\n <Flexbox align={'center'} className={styles.icon} justify={'center'}>\n {typeof item.icon === 'function' ? item.icon(active) : item.icon}\n </Flexbox>\n <div className={styles.title}>\n {typeof item.title === 'function' ? item.title(active) : item.title}\n </div>\n </Flexbox>\n );\n })}\n </Flexbox>\n {safeArea && <SafeArea position={'bottom'} />}\n </Flexbox>\n );\n },\n);\n\nTabBar.displayName = 'MobileTabBar';\n\nexport default TabBar;\n"],"mappings":";;;;;;;;;;AAWA,MAAM,SAAS,MACZ,EAAE,KAAK,WAAW,UAAU,OAAO,WAAW,kBAAkB,UAAU,GAAG,WAAW;CACvF,MAAM,CAAC,eAAe,oBAAoB,cACxC,oBAAoB,MAAM,GAAG,KAC7B;EACE,cAAc;EACd;EACA,OAAO;EACR,CACF;CACD,MAAM,EAAE,QAAQ,OAAO,WAAW;AAElC,QACE,qBAACA;EAAQ,IAAI;EAAU,WAAW,GAAG,OAAO,WAAW,UAAU;EAAO;EAAK,GAAI;aAC/E,oBAACA;GACC,OAAO;GACP,WAAW,GAAG,OAAO,OAAO,UAAU;GACtC;GACA,SAAS;aAER,MAAM,KAAK,SAAS;IACnB,MAAM,SAAS,KAAK,QAAQ;AAC5B,WACE,qBAACA;KACC,OAAO;KACP,WAAW,GAAG,OAAO,KAAK,UAAU,OAAO,OAAO;KAClD,KAAK;KACL,SAAS;KAET,eAAe;AACb,uBAAiB,KAAK,IAAI;AAC1B,YAAM,WAAW;;gBAGnB,oBAACA;MAAQ,OAAO;MAAU,WAAW,OAAO;MAAM,SAAS;gBACxD,OAAO,KAAK,SAAS,aAAa,KAAK,KAAK,OAAO,GAAG,KAAK;OACpD,EACV,oBAAC;MAAI,WAAW,OAAO;gBACpB,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,GAAG,KAAK;OAC1D;OAXD,KAAK,IAYF;KAEZ;IACM,EACT,YAAY,oBAACC,oBAAS,UAAU,WAAY;GACrC;EAGf;AAED,OAAO,cAAc;AAErB,qBAAe"}
1
+ {"version":3,"file":"TabBar.mjs","names":["useMergeState","Flexbox","SafeArea"],"sources":["../../../src/mobile/TabBar/TabBar.tsx"],"sourcesContent":["'use client';\n\nimport { memo } from 'react';\nimport useMergeState from 'use-merge-value';\n\nimport { Flexbox } from '@/Flex';\nimport SafeArea from '@/mobile/SafeArea';\n\nimport { useStyles } from './style';\nimport type { TabBarProps } from './type';\n\nconst TabBar = memo<TabBarProps>(\n ({ ref, className, safeArea, items, activeKey, defaultActiveKey, onChange, ...rest }) => {\n const [currentActive, setCurrentActive] = useMergeState<string>(\n defaultActiveKey || items[0].key,\n {\n defaultValue: defaultActiveKey,\n onChange,\n value: activeKey,\n },\n );\n const { styles, cx } = useStyles();\n\n return (\n <Flexbox as={'footer'} className={cx(styles.container, className)} ref={ref} {...rest}>\n <Flexbox\n align={'center'}\n className={cx(styles.inner, className)}\n horizontal\n justify={'space-around'}\n >\n {items.map((item) => {\n const active = item.key === currentActive;\n return (\n <Flexbox\n align={'center'}\n className={cx(styles.tab, active && styles.active)}\n gap={4}\n justify={'center'}\n key={item.key}\n onClick={() => {\n setCurrentActive(item.key);\n item?.onClick?.();\n }}\n >\n <Flexbox align={'center'} className={styles.icon} justify={'center'}>\n {typeof item.icon === 'function' ? item.icon(active) : item.icon}\n </Flexbox>\n <div className={styles.title}>\n {typeof item.title === 'function' ? item.title(active) : item.title}\n </div>\n </Flexbox>\n );\n })}\n </Flexbox>\n {safeArea && <SafeArea position={'bottom'} />}\n </Flexbox>\n );\n },\n);\n\nTabBar.displayName = 'MobileTabBar';\n\nexport default TabBar;\n"],"mappings":";;;;;;;;;;AAWA,MAAM,SAAS,MACZ,EAAE,KAAK,WAAW,UAAU,OAAO,WAAW,kBAAkB,UAAU,GAAG,WAAW;CACvF,MAAM,CAAC,eAAe,oBAAoBA,mBACxC,oBAAoB,MAAM,GAAG,KAC7B;EACE,cAAc;EACd;EACA,OAAO;EACR,CACF;CACD,MAAM,EAAE,QAAQ,OAAO,WAAW;AAElC,QACE,qBAACC;EAAQ,IAAI;EAAU,WAAW,GAAG,OAAO,WAAW,UAAU;EAAO;EAAK,GAAI;aAC/E,oBAACA;GACC,OAAO;GACP,WAAW,GAAG,OAAO,OAAO,UAAU;GACtC;GACA,SAAS;aAER,MAAM,KAAK,SAAS;IACnB,MAAM,SAAS,KAAK,QAAQ;AAC5B,WACE,qBAACA;KACC,OAAO;KACP,WAAW,GAAG,OAAO,KAAK,UAAU,OAAO,OAAO;KAClD,KAAK;KACL,SAAS;KAET,eAAe;AACb,uBAAiB,KAAK,IAAI;AAC1B,YAAM,WAAW;;gBAGnB,oBAACA;MAAQ,OAAO;MAAU,WAAW,OAAO;MAAM,SAAS;gBACxD,OAAO,KAAK,SAAS,aAAa,KAAK,KAAK,OAAO,GAAG,KAAK;OACpD,EACV,oBAAC;MAAI,WAAW,OAAO;gBACpB,OAAO,KAAK,UAAU,aAAa,KAAK,MAAM,OAAO,GAAG,KAAK;OAC1D;OAXD,KAAK,IAYF;KAEZ;IACM,EACT,YAAY,oBAACC,oBAAS,UAAU,WAAY;GACrC;EAGf;AAED,OAAO,cAAc;AAErB,qBAAe"}
@@ -1,6 +1,6 @@
1
1
  import { FlexboxProps } from "../../Flex/type.mjs";
2
2
  import "../../Flex/index.mjs";
3
- import * as react0 from "react";
3
+ import * as react27 from "react";
4
4
  import { Ref } from "react";
5
5
  import { useControls, useCreateStore } from "leva";
6
6
 
@@ -10,7 +10,7 @@ interface StoryBookProps extends FlexboxProps {
10
10
  noPadding?: boolean;
11
11
  ref?: Ref<HTMLDivElement>;
12
12
  }
13
- declare const StoryBook: react0.NamedExoticComponent<StoryBookProps>;
13
+ declare const StoryBook: react27.NamedExoticComponent<StoryBookProps>;
14
14
  //#endregion
15
15
  export { StoryBook, StoryBookProps, useControls, useCreateStore };
16
16
  //# sourceMappingURL=index.d.mts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "4.1.8",
3
+ "version": "4.1.9",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",