@forgedevstack/bear 1.3.2 → 1.3.3
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/README.md +4 -0
- package/dist/components/ApprovalCard/ApprovalCard.cjs +1 -0
- package/dist/components/ApprovalCard/ApprovalCard.const.cjs +1 -0
- package/dist/components/ApprovalCard/ApprovalCard.const.d.ts +2 -0
- package/dist/components/ApprovalCard/ApprovalCard.const.js +8 -0
- package/dist/components/ApprovalCard/ApprovalCard.d.ts +2 -0
- package/dist/components/ApprovalCard/ApprovalCard.js +25 -0
- package/dist/components/ApprovalCard/ApprovalCard.types.d.ts +15 -0
- package/dist/components/ApprovalCard/index.d.ts +2 -0
- package/dist/components/ArtifactCard/ArtifactCard.cjs +1 -0
- package/dist/components/ArtifactCard/ArtifactCard.const.cjs +1 -0
- package/dist/components/ArtifactCard/ArtifactCard.const.d.ts +3 -0
- package/dist/components/ArtifactCard/ArtifactCard.const.js +8 -0
- package/dist/components/ArtifactCard/ArtifactCard.d.ts +2 -0
- package/dist/components/ArtifactCard/ArtifactCard.js +43 -0
- package/dist/components/ArtifactCard/ArtifactCard.types.d.ts +15 -0
- package/dist/components/ArtifactCard/index.d.ts +2 -0
- package/dist/components/Banner/Banner.const.cjs +1 -1
- package/dist/components/Banner/Banner.const.js +9 -8
- package/dist/components/Chart/BarChart.cjs +1 -1
- package/dist/components/Chart/BarChart.js +65 -72
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.js +21 -18
- package/dist/components/Chart/Chart.types.d.ts +1 -1
- package/dist/components/Chart/FunnelChart.cjs +1 -1
- package/dist/components/Chart/FunnelChart.js +38 -36
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.js +74 -60
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.js +102 -82
- package/dist/components/Chart/RadarChart.cjs +1 -1
- package/dist/components/Chart/RadarChart.d.ts +1 -1
- package/dist/components/Chart/RadarChart.js +116 -93
- package/dist/components/Chat/Chat.cjs +1 -1
- package/dist/components/Chat/Chat.const.cjs +1 -1
- package/dist/components/Chat/Chat.const.d.ts +9 -22
- package/dist/components/Chat/Chat.const.js +18 -26
- package/dist/components/Chat/Chat.d.ts +1 -20
- package/dist/components/Chat/Chat.js +107 -162
- package/dist/components/Chat/Chat.types.d.ts +20 -27
- package/dist/components/Chat/Chat.utils.cjs +1 -0
- package/dist/components/Chat/Chat.utils.d.ts +2 -0
- package/dist/components/Chat/Chat.utils.js +10 -0
- package/dist/components/Chat/helpers/ChatTypingIndicator.cjs +1 -0
- package/dist/components/Chat/helpers/ChatTypingIndicator.d.ts +3 -0
- package/dist/components/Chat/helpers/ChatTypingIndicator.js +14 -0
- package/dist/components/Chat/index.d.ts +2 -1
- package/dist/components/ChatBubble/ChatBubble.cjs +1 -0
- package/dist/components/ChatBubble/ChatBubble.const.cjs +1 -0
- package/dist/components/ChatBubble/ChatBubble.const.d.ts +13 -0
- package/dist/components/ChatBubble/ChatBubble.const.js +17 -0
- package/dist/components/ChatBubble/ChatBubble.d.ts +2 -0
- package/dist/components/ChatBubble/ChatBubble.js +32 -0
- package/dist/components/ChatBubble/ChatBubble.types.d.ts +12 -0
- package/dist/components/ChatBubble/ChatBubble.utils.cjs +1 -0
- package/dist/components/ChatBubble/ChatBubble.utils.d.ts +6 -0
- package/dist/components/ChatBubble/ChatBubble.utils.js +15 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleSystem.cjs +1 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleSystem.d.ts +2 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleSystem.js +21 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleThread.cjs +1 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleThread.d.ts +4 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleThread.js +63 -0
- package/dist/components/ChatBubble/index.d.ts +2 -0
- package/dist/components/ChatError/ChatError.cjs +1 -0
- package/dist/components/ChatError/ChatError.const.cjs +1 -0
- package/dist/components/ChatError/ChatError.const.d.ts +2 -0
- package/dist/components/ChatError/ChatError.const.js +8 -0
- package/dist/components/ChatError/ChatError.d.ts +2 -0
- package/dist/components/ChatError/ChatError.js +32 -0
- package/dist/components/ChatError/ChatError.types.d.ts +14 -0
- package/dist/components/ChatError/index.d.ts +2 -0
- package/dist/components/CitationList/CitationList.cjs +1 -0
- package/dist/components/CitationList/CitationList.d.ts +2 -0
- package/dist/components/CitationList/CitationList.js +30 -0
- package/dist/components/CitationList/CitationList.types.d.ts +15 -0
- package/dist/components/CitationList/helpers/CitationListTitle.cjs +1 -0
- package/dist/components/CitationList/helpers/CitationListTitle.d.ts +2 -0
- package/dist/components/CitationList/helpers/CitationListTitle.js +10 -0
- package/dist/components/CitationList/helpers/index.d.ts +1 -0
- package/dist/components/CitationList/index.d.ts +2 -0
- package/dist/components/ContextMeter/ContextMeter.cjs +1 -0
- package/dist/components/ContextMeter/ContextMeter.const.cjs +1 -0
- package/dist/components/ContextMeter/ContextMeter.const.d.ts +6 -0
- package/dist/components/ContextMeter/ContextMeter.const.js +11 -0
- package/dist/components/ContextMeter/ContextMeter.d.ts +2 -0
- package/dist/components/ContextMeter/ContextMeter.js +49 -0
- package/dist/components/ContextMeter/ContextMeter.types.d.ts +11 -0
- package/dist/components/ContextMeter/ContextMeter.utils.cjs +1 -0
- package/dist/components/ContextMeter/ContextMeter.utils.d.ts +2 -0
- package/dist/components/ContextMeter/ContextMeter.utils.js +12 -0
- package/dist/components/ContextMeter/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.const.cjs +1 -1
- package/dist/components/Drawer/Drawer.const.d.ts +2 -1
- package/dist/components/Drawer/Drawer.const.js +7 -6
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js +93 -83
- package/dist/components/Drawer/Drawer.types.d.ts +4 -1
- package/dist/components/Drawer/hooks/useDrawer.cjs +1 -1
- package/dist/components/Drawer/hooks/useDrawer.js +33 -34
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.d.ts +8 -6
- package/dist/components/EmptyState/EmptyState.const.js +15 -8
- package/dist/components/EmptyState/EmptyState.d.ts +1 -2
- package/dist/components/EmptyState/EmptyState.js +39 -43
- package/dist/components/EmptyState/EmptyState.types.d.ts +2 -0
- package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.cjs +1 -0
- package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.d.ts +3 -0
- package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.js +8 -0
- package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.cjs +1 -0
- package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.d.ts +3 -0
- package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.js +8 -0
- package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.cjs +1 -0
- package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.d.ts +3 -0
- package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.js +8 -0
- package/dist/components/EmptyState/helpers/index.d.ts +3 -0
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
- package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -1
- package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -1
- package/dist/components/FloatingChat/FloatingChat.const.js +25 -7
- package/dist/components/FloatingChat/FloatingChat.d.ts +1 -18
- package/dist/components/FloatingChat/FloatingChat.js +93 -124
- package/dist/components/FloatingChat/FloatingChat.types.d.ts +11 -22
- package/dist/components/FloatingChat/FloatingChat.utils.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.utils.d.ts +2 -0
- package/dist/components/FloatingChat/FloatingChat.utils.js +12 -0
- package/dist/components/FloatingChat/helpers/FloatingChatHeader.cjs +1 -0
- package/dist/components/FloatingChat/helpers/FloatingChatHeader.d.ts +9 -0
- package/dist/components/FloatingChat/helpers/FloatingChatHeader.js +21 -0
- package/dist/components/FloatingChat/helpers/FloatingChatTrigger.cjs +1 -0
- package/dist/components/FloatingChat/helpers/FloatingChatTrigger.d.ts +9 -0
- package/dist/components/FloatingChat/helpers/FloatingChatTrigger.js +17 -0
- package/dist/components/FloatingChat/index.d.ts +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.cjs +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.d.ts +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.js +35 -24
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/productIcons.cjs +1 -0
- package/dist/components/Icon/productIcons.d.ts +7 -0
- package/dist/components/Icon/productIcons.js +25 -0
- package/dist/components/MessageActions/MessageActions.cjs +1 -0
- package/dist/components/MessageActions/MessageActions.const.cjs +1 -0
- package/dist/components/MessageActions/MessageActions.const.d.ts +2 -0
- package/dist/components/MessageActions/MessageActions.const.js +10 -0
- package/dist/components/MessageActions/MessageActions.d.ts +2 -0
- package/dist/components/MessageActions/MessageActions.js +31 -0
- package/dist/components/MessageActions/MessageActions.types.d.ts +16 -0
- package/dist/components/MessageActions/index.d.ts +2 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/ModelSelect/ModelSelect.cjs +1 -0
- package/dist/components/ModelSelect/ModelSelect.const.cjs +1 -0
- package/dist/components/ModelSelect/ModelSelect.const.d.ts +1 -0
- package/dist/components/ModelSelect/ModelSelect.const.js +4 -0
- package/dist/components/ModelSelect/ModelSelect.d.ts +2 -0
- package/dist/components/ModelSelect/ModelSelect.js +41 -0
- package/dist/components/ModelSelect/ModelSelect.types.d.ts +16 -0
- package/dist/components/ModelSelect/index.d.ts +2 -0
- package/dist/components/OverlayPortal/OverlayPortal.const.cjs +1 -1
- package/dist/components/OverlayPortal/OverlayPortal.const.js +6 -5
- package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +5 -5
- package/dist/components/PromptComposer/PromptComposer.cjs +1 -0
- package/dist/components/PromptComposer/PromptComposer.const.cjs +1 -0
- package/dist/components/PromptComposer/PromptComposer.const.d.ts +6 -0
- package/dist/components/PromptComposer/PromptComposer.const.js +14 -0
- package/dist/components/PromptComposer/PromptComposer.d.ts +2 -0
- package/dist/components/PromptComposer/PromptComposer.js +132 -0
- package/dist/components/PromptComposer/PromptComposer.types.d.ts +45 -0
- package/dist/components/PromptComposer/PromptComposer.utils.cjs +1 -0
- package/dist/components/PromptComposer/PromptComposer.utils.d.ts +5 -0
- package/dist/components/PromptComposer/PromptComposer.utils.js +16 -0
- package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.d.ts +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.js +6 -0
- package/dist/components/PromptComposer/helpers/PromptComposerFileChip.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerFileChip.d.ts +2 -0
- package/dist/components/PromptComposer/helpers/PromptComposerFileChip.js +18 -0
- package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.d.ts +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.js +9 -0
- package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.d.ts +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.js +6 -0
- package/dist/components/PromptComposer/helpers/index.d.ts +4 -0
- package/dist/components/PromptComposer/index.d.ts +2 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.cjs +1 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.d.ts +2 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.js +39 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.types.d.ts +13 -0
- package/dist/components/PromptSuggestions/index.d.ts +2 -0
- package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/IconRender.js +16 -16
- package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/toolbarItemRender.js +23 -23
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +23 -23
- package/dist/components/Select/helpers/SelectCheckSvg.cjs +1 -0
- package/dist/components/Select/helpers/SelectCheckSvg.d.ts +3 -0
- package/dist/components/Select/helpers/SelectCheckSvg.js +8 -0
- package/dist/components/Select/helpers/SelectChevronDownSvg.cjs +1 -0
- package/dist/components/Select/helpers/SelectChevronDownSvg.d.ts +3 -0
- package/dist/components/Select/helpers/SelectChevronDownSvg.js +8 -0
- package/dist/components/Select/helpers/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.const.cjs +2 -2
- package/dist/components/Skeleton/Skeleton.const.js +5 -6
- package/dist/components/Skeleton/Skeleton.js +59 -59
- package/dist/components/StatCard/StatCard.cjs +1 -1
- package/dist/components/StatCard/StatCard.const.cjs +1 -1
- package/dist/components/StatCard/StatCard.const.d.ts +0 -7
- package/dist/components/StatCard/StatCard.const.js +5 -12
- package/dist/components/StatCard/StatCard.d.ts +1 -2
- package/dist/components/StatCard/StatCard.js +48 -37
- package/dist/components/StatCard/StatCard.utils.cjs +1 -0
- package/dist/components/StatCard/StatCard.utils.d.ts +2 -0
- package/dist/components/StatCard/StatCard.utils.js +7 -0
- package/dist/components/StreamingMessage/StreamingMessage.cjs +1 -0
- package/dist/components/StreamingMessage/StreamingMessage.const.cjs +1 -0
- package/dist/components/StreamingMessage/StreamingMessage.const.d.ts +5 -0
- package/dist/components/StreamingMessage/StreamingMessage.const.js +10 -0
- package/dist/components/StreamingMessage/StreamingMessage.d.ts +2 -0
- package/dist/components/StreamingMessage/StreamingMessage.js +48 -0
- package/dist/components/StreamingMessage/StreamingMessage.types.d.ts +15 -0
- package/dist/components/StreamingMessage/index.d.ts +2 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.cjs +1 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.const.cjs +1 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.const.d.ts +7 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.const.js +14 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +2 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.js +39 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.types.d.ts +14 -0
- package/dist/components/ThemeSwitcher/index.d.ts +2 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.cjs +1 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.const.cjs +1 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.const.d.ts +4 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.const.js +9 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.d.ts +2 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.js +45 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.types.d.ts +16 -0
- package/dist/components/ThinkingBlock/index.d.ts +2 -0
- package/dist/components/ToolCall/ToolCall.cjs +1 -0
- package/dist/components/ToolCall/ToolCall.const.cjs +1 -0
- package/dist/components/ToolCall/ToolCall.const.d.ts +5 -0
- package/dist/components/ToolCall/ToolCall.const.js +17 -0
- package/dist/components/ToolCall/ToolCall.d.ts +2 -0
- package/dist/components/ToolCall/ToolCall.js +43 -0
- package/dist/components/ToolCall/ToolCall.types.d.ts +20 -0
- package/dist/components/ToolCall/index.d.ts +2 -0
- package/dist/components/Transition/Transition.const.cjs +1 -1
- package/dist/components/Transition/Transition.const.js +12 -6
- package/dist/components/Transition/Transition.types.d.ts +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +37 -9
- package/dist/components/index.js +455 -423
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +46 -0
- package/dist/constants/generals.const.js +158 -115
- package/dist/constants/keys.const.cjs +1 -1
- package/dist/constants/keys.const.js +2 -1
- package/dist/constants/numbers.const.cjs +1 -1
- package/dist/constants/numbers.const.d.ts +7 -0
- package/dist/constants/numbers.const.js +60 -52
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +19 -44
- package/dist/context/BearProvider.js +223 -208
- package/dist/context/bearProvider.types.d.ts +4 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/hooks/useFixedAnchorPosition/index.d.ts +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.d.ts +2 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js +12 -11
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.types.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +595 -563
- package/dist/styles/_ai-chat.css +487 -0
- package/dist/styles/_base.css +2 -0
- package/dist/styles/_chart.css +144 -0
- package/dist/styles/_effects.css +8 -4
- package/dist/styles/_skeleton.css +90 -0
- package/dist/styles/main.css +3 -0
- package/dist/styles.css +734 -32
- package/package.json +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.const.cjs +0 -1
- package/dist/components/FormSkeleton/FormSkeleton.const.d.ts +0 -5
- package/dist/components/FormSkeleton/FormSkeleton.const.js +0 -8
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.js +0 -14
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.js +0 -35
- package/dist/node_modules/@forgedevstack/bear-icons/dist/action.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/action.js +0 -26
- package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.js +0 -4
- package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.js +0 -130
- package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.js +0 -12
- package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.js +0 -18
- package/dist/node_modules/@forgedevstack/bear-icons/dist/status.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/status.js +0 -6
|
@@ -1,100 +1,123 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { ZERO as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsx as s, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import { ZERO as m, ONE as f } from "../../constants/numbers.const.js";
|
|
3
|
+
import { cn as A } from "../../utils/cn.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { resolveBearId as O } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as $ } from "../../utils/useBearId.js";
|
|
7
|
+
import { CHART as a } from "./Chart.const.js";
|
|
8
|
+
import { polarToCartesian as i, getChartColor as R } from "./Chart.utils.js";
|
|
9
|
+
const P = (g) => {
|
|
8
10
|
const {
|
|
9
|
-
data:
|
|
10
|
-
height:
|
|
11
|
-
showLabels:
|
|
12
|
-
showValues:
|
|
13
|
-
animated:
|
|
14
|
-
color:
|
|
15
|
-
className:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}), S = E.map((e) => `${e.x},${e.y}`).join(" "), U = Array.from({ length: r.RADAR_RINGS }, (e, a) => {
|
|
24
|
-
const t = (a + d) / r.RADAR_RINGS * r.OUTER_RADIUS;
|
|
25
|
-
return Array.from({ length: m }, (l, D) => {
|
|
26
|
-
const L = r.DEFAULT_START_ANGLE + D * s;
|
|
27
|
-
return c(L, t);
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
return /* @__PURE__ */ n("div", { className: u("Bear-Chart Bear-Chart--radar bear-flex bear-flex-col bear-items-center", x), style: { height: f }, ...y, children: /* @__PURE__ */ T("svg", { viewBox: `0 0 ${r.VIEWBOX} ${r.VIEWBOX}`, className: "bear-h-full bear-w-full", children: [
|
|
31
|
-
U.map((e, a) => /* @__PURE__ */ n(
|
|
32
|
-
"polygon",
|
|
33
|
-
{
|
|
34
|
-
points: e.map((t) => `${t.x},${t.y}`).join(" "),
|
|
35
|
-
fill: "none",
|
|
36
|
-
stroke: "var(--bear-border-default, #e5e5e5)",
|
|
37
|
-
strokeWidth: 0.4
|
|
38
|
-
},
|
|
39
|
-
a
|
|
40
|
-
)),
|
|
41
|
-
o.map((e, a) => {
|
|
42
|
-
const t = r.DEFAULT_START_ANGLE + a * s, l = c(t, r.OUTER_RADIUS);
|
|
43
|
-
return /* @__PURE__ */ n(
|
|
44
|
-
"line",
|
|
45
|
-
{
|
|
46
|
-
x1: r.CENTER,
|
|
47
|
-
y1: r.CENTER,
|
|
48
|
-
x2: l.x,
|
|
49
|
-
y2: l.y,
|
|
50
|
-
stroke: "var(--bear-border-default, #e5e5e5)",
|
|
51
|
-
strokeWidth: 0.4
|
|
52
|
-
},
|
|
53
|
-
e.label
|
|
54
|
-
);
|
|
55
|
-
}),
|
|
56
|
-
/* @__PURE__ */ n(
|
|
57
|
-
"polygon",
|
|
11
|
+
data: l,
|
|
12
|
+
height: x = a.DEFAULT_HEIGHT,
|
|
13
|
+
showLabels: S = !0,
|
|
14
|
+
showValues: C = !1,
|
|
15
|
+
animated: I = !0,
|
|
16
|
+
color: c,
|
|
17
|
+
className: h,
|
|
18
|
+
id: N,
|
|
19
|
+
testId: E,
|
|
20
|
+
...p
|
|
21
|
+
} = g, U = $("RadarChart"), T = O(N, U), d = l.length, _ = { "--Bear-Chart-height": `${x}px` };
|
|
22
|
+
if (d === m)
|
|
23
|
+
return /* @__PURE__ */ s(
|
|
24
|
+
"div",
|
|
58
25
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
className: u(b && "animate-scale-in")
|
|
26
|
+
id: T,
|
|
27
|
+
"data-testid": E,
|
|
28
|
+
className: A("Bear-Chart Bear-Chart--radar Bear-Chart--empty", h),
|
|
29
|
+
style: _,
|
|
30
|
+
...p
|
|
65
31
|
}
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
e.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
32
|
+
);
|
|
33
|
+
const B = Math.max(...l.map((e) => e.value), f), n = a.FULL_SWEEP / d, u = l.map((e, r) => {
|
|
34
|
+
const t = a.DEFAULT_START_ANGLE + r * n, o = e.value / B * a.OUTER_RADIUS;
|
|
35
|
+
return i(t, o);
|
|
36
|
+
}), D = u.map((e) => `${e.x},${e.y}`).join(" "), L = Array.from({ length: a.RADAR_RINGS }, (e, r) => {
|
|
37
|
+
const t = (r + f) / a.RADAR_RINGS * a.OUTER_RADIUS;
|
|
38
|
+
return Array.from({ length: d }, (o, b) => {
|
|
39
|
+
const v = a.DEFAULT_START_ANGLE + b * n;
|
|
40
|
+
return i(v, t);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
return /* @__PURE__ */ s(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
id: T,
|
|
47
|
+
"data-testid": E,
|
|
48
|
+
className: A("Bear-Chart Bear-Chart--radar", h),
|
|
49
|
+
style: _,
|
|
50
|
+
...p,
|
|
51
|
+
children: /* @__PURE__ */ y("svg", { viewBox: `0 0 ${a.VIEWBOX} ${a.VIEWBOX}`, className: "Bear-Chart__svg", children: [
|
|
52
|
+
L.map((e, r) => /* @__PURE__ */ s(
|
|
53
|
+
"polygon",
|
|
54
|
+
{
|
|
55
|
+
points: e.map((t) => `${t.x},${t.y}`).join(" "),
|
|
56
|
+
fill: "none",
|
|
57
|
+
stroke: "var(--bear-border-default, #e5e5e5)",
|
|
58
|
+
strokeWidth: 0.4
|
|
59
|
+
},
|
|
60
|
+
r
|
|
61
|
+
)),
|
|
62
|
+
l.map((e, r) => {
|
|
63
|
+
const t = a.DEFAULT_START_ANGLE + r * n, o = i(t, a.OUTER_RADIUS);
|
|
64
|
+
return /* @__PURE__ */ s(
|
|
65
|
+
"line",
|
|
66
|
+
{
|
|
67
|
+
x1: a.CENTER,
|
|
68
|
+
y1: a.CENTER,
|
|
69
|
+
x2: o.x,
|
|
70
|
+
y2: o.y,
|
|
71
|
+
stroke: "var(--bear-border-default, #e5e5e5)",
|
|
72
|
+
strokeWidth: 0.4
|
|
73
|
+
},
|
|
74
|
+
e.label
|
|
75
|
+
);
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ s(
|
|
78
|
+
"polygon",
|
|
79
|
+
{
|
|
80
|
+
points: D,
|
|
81
|
+
fill: R(m, c),
|
|
82
|
+
fillOpacity: 0.25,
|
|
83
|
+
stroke: R(m, c),
|
|
84
|
+
strokeWidth: 0.8,
|
|
85
|
+
className: A(I && "animate-scale-in")
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
u.map((e, r) => /* @__PURE__ */ s(
|
|
89
|
+
"circle",
|
|
90
|
+
{
|
|
91
|
+
cx: e.x,
|
|
92
|
+
cy: e.y,
|
|
93
|
+
r: a.DOT_RADIUS,
|
|
94
|
+
fill: R(r, l[r].color || c)
|
|
95
|
+
},
|
|
96
|
+
l[r].label
|
|
97
|
+
)),
|
|
98
|
+
S && l.map((e, r) => {
|
|
99
|
+
const t = a.DEFAULT_START_ANGLE + r * n, o = i(t, a.OUTER_RADIUS + a.RADAR_LABEL_OFFSET);
|
|
100
|
+
return /* @__PURE__ */ y(
|
|
101
|
+
"text",
|
|
102
|
+
{
|
|
103
|
+
x: o.x,
|
|
104
|
+
y: o.y,
|
|
105
|
+
textAnchor: "middle",
|
|
106
|
+
dominantBaseline: "middle",
|
|
107
|
+
className: "bear-fill-[var(--bear-text-secondary)]",
|
|
108
|
+
fontSize: 4,
|
|
109
|
+
children: [
|
|
110
|
+
e.label,
|
|
111
|
+
C ? ` ${e.value}` : ""
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
`${e.label}-label`
|
|
115
|
+
);
|
|
116
|
+
})
|
|
117
|
+
] })
|
|
118
|
+
}
|
|
119
|
+
);
|
|
97
120
|
};
|
|
98
121
|
export {
|
|
99
|
-
|
|
122
|
+
P as RadarChart
|
|
100
123
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),a=require("react"),r=require("../../constants/generals.const.cjs"),Z=require("../../utils/cn.cjs"),$=require("../../utils/generateBearId.utils.cjs"),ee=require("../../utils/useBearId.cjs"),te=require("../../utils/liveRegion.utils.cjs"),o=require("../Box/Box.cjs"),se=require("../Button/Button.cjs"),re=require("../ChatBubble/ChatBubble.cjs"),oe=require("../ChatError/ChatError.cjs"),ne=require("../PromptComposer/PromptComposer.cjs"),ae=require("../PromptSuggestions/PromptSuggestions.cjs"),n=require("./Chat.const.cjs"),S=require("./Chat.utils.cjs"),ce=require("./helpers/ChatTypingIndicator.cjs"),ie=E=>{const{id:C,testId:p,messages:c,onSend:L,onStop:O,onAttach:x,isLoading:N=r.BOOLEAN_FALSE,isStreaming:f=r.BOOLEAN_FALSE,isTyping:R=r.BOOLEAN_FALSE,placeholder:q,header:T,footer:H,showTimestamps:I=n.CHAT_DEFAULT_SHOW_TIMESTAMPS,showStatus:j=n.CHAT_DEFAULT_SHOW_STATUS,showAvatars:v=n.CHAT_DEFAULT_SHOW_AVATARS,userAvatar:F,botAvatar:b,typingText:y,className:w,height:U=n.CHAT_DEFAULTS.HEIGHT,disabled:P=n.CHAT_DEFAULT_DISABLED,allowAttach:D,suggestions:l,onSuggestionSelect:M,errorTitle:W,errorMessage:g,onRetry:V,translations:k}=E,z=ee.useBearId(r.COMPONENT_NAME_CHAT),G=$.resolveBearId(C,z),u=a.useRef(null),h=a.useRef(r.BOOLEAN_TRUE),A=a.useRef(null),[J,d]=a.useState(r.BOOLEAN_FALSE),_={...n.CHAT_DEFAULT_TRANSLATIONS,...k},B=f||N,s=c[c.length-1],K=B&&typeof(s==null?void 0:s.content)=="string"?s.content:void 0,Q=te.getBearLiveRegionProps("info"),m=()=>{const e=u.current;e&&(e.scrollTop=e.scrollHeight,h.current=r.BOOLEAN_TRUE,d(r.BOOLEAN_FALSE))},X=()=>{const e=u.current;if(!e)return;const i=S.isChatScrollerAtBottom(e);h.current=i,i&&d(r.BOOLEAN_FALSE)};return a.useEffect(()=>{const e=(s==null?void 0:s.id)??null,i=A.current===null,Y=e!==null&&e!==A.current;if(A.current=e,!!Y){if(i||h.current){m();return}d(r.BOOLEAN_TRUE)}},[c,s==null?void 0:s.id]),t.jsxs(o.Box,{id:G,"data-testid":p,className:Z.cn("Bear-Chat",w),style:S.resolveChatHeightVar(U),children:[T&&t.jsx(o.Box,{className:"Bear-Chat__header",children:T}),t.jsxs(o.Box,{ref:u,className:"Bear-Chat__messages",onScroll:X,children:[t.jsx(o.Box,{className:"Bear-Chat__live",...Q,children:K}),c.map(e=>t.jsx(re.ChatBubble,{message:e,showTimestamp:I,showStatus:j,showAvatar:v,userAvatar:F,botAvatar:b},e.id)),R&&!B&&t.jsx(ce.ChatTypingIndicator,{text:y??_.typingText}),g&&t.jsx(oe.ChatError,{title:W,onRetry:V,children:g}),J&&t.jsx(se.Button,{type:"button",variant:"primary",size:"sm",className:"Bear-Chat__new-messages",onClick:m,children:_.newMessagesLabel})]}),l&&l.length>0&&t.jsx(o.Box,{className:"Bear-Chat__suggestions",children:t.jsx(ae.PromptSuggestions,{suggestions:l,onSelect:M})}),t.jsxs(o.Box,{className:"Bear-Chat__composer",children:[t.jsx(ne.PromptComposer,{onSubmit:L,onStop:O,onAttach:x,isStreaming:B,disabled:P,allowAttach:D,placeholder:q??_.placeholder}),H]})]})};exports.Chat=ie;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../constants/numbers.const.cjs"),T=require("../../constants/generals.const.cjs"),A={PLACEHOLDER:T.PLACEHOLDER_START_TYPING,HEIGHT:_.FOUR_HUNDRED,TYPING_TEXT:"is typing..."},E={placeholder:A.PLACEHOLDER,typingText:A.TYPING_TEXT,newMessagesLabel:T.LABEL_NEW_MESSAGES},H=_.CHAT_STICK_THRESHOLD_PX,S=T.BOOLEAN_TRUE,L=T.BOOLEAN_TRUE,C=T.BOOLEAN_TRUE,D=T.BOOLEAN_FALSE,O="--Bear-Chat-height";exports.CHAT_DEFAULTS=A;exports.CHAT_DEFAULT_DISABLED=D;exports.CHAT_DEFAULT_SHOW_AVATARS=C;exports.CHAT_DEFAULT_SHOW_STATUS=L;exports.CHAT_DEFAULT_SHOW_TIMESTAMPS=S;exports.CHAT_DEFAULT_TRANSLATIONS=E;exports.CHAT_HEIGHT_VAR=O;exports.CHAT_STICK_THRESHOLD=H;
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
+
import { ChatTranslations } from './Chat.types';
|
|
1
2
|
export declare const CHAT_DEFAULTS: {
|
|
2
|
-
readonly PLACEHOLDER: "
|
|
3
|
+
readonly PLACEHOLDER: "Start typing...";
|
|
3
4
|
readonly HEIGHT: 400;
|
|
4
5
|
readonly TYPING_TEXT: "is typing...";
|
|
5
6
|
};
|
|
6
|
-
export declare const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare const SENDER_COLORS: {
|
|
14
|
-
readonly user: {
|
|
15
|
-
readonly bg: "var(--bear-primary-500)";
|
|
16
|
-
readonly text: "white";
|
|
17
|
-
};
|
|
18
|
-
readonly bot: {
|
|
19
|
-
readonly bg: "var(--bear-bg-secondary)";
|
|
20
|
-
readonly text: "var(--bear-text-primary)";
|
|
21
|
-
};
|
|
22
|
-
readonly system: {
|
|
23
|
-
readonly bg: "transparent";
|
|
24
|
-
readonly text: "var(--bear-text-tertiary, var(--bear-text-muted))";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
7
|
+
export declare const CHAT_DEFAULT_TRANSLATIONS: ChatTranslations;
|
|
8
|
+
export declare const CHAT_STICK_THRESHOLD = 16;
|
|
9
|
+
export declare const CHAT_DEFAULT_SHOW_TIMESTAMPS = true;
|
|
10
|
+
export declare const CHAT_DEFAULT_SHOW_STATUS = true;
|
|
11
|
+
export declare const CHAT_DEFAULT_SHOW_AVATARS = true;
|
|
12
|
+
export declare const CHAT_DEFAULT_DISABLED = false;
|
|
13
|
+
export declare const CHAT_HEIGHT_VAR = "--Bear-Chat-height";
|
|
@@ -1,29 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { FOUR_HUNDRED as _, CHAT_STICK_THRESHOLD_PX as E } from "../../constants/numbers.const.js";
|
|
2
|
+
import { BOOLEAN_TRUE as T, BOOLEAN_FALSE as H, LABEL_NEW_MESSAGES as L, PLACEHOLDER_START_TYPING as S } from "../../constants/generals.const.js";
|
|
3
|
+
const A = {
|
|
4
|
+
PLACEHOLDER: S,
|
|
5
|
+
HEIGHT: _,
|
|
4
6
|
TYPING_TEXT: "is typing..."
|
|
5
|
-
},
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
error: "!"
|
|
11
|
-
}, t = {
|
|
12
|
-
user: {
|
|
13
|
-
bg: "var(--bear-primary-500)",
|
|
14
|
-
text: "white"
|
|
15
|
-
},
|
|
16
|
-
bot: {
|
|
17
|
-
bg: "var(--bear-bg-secondary)",
|
|
18
|
-
text: "var(--bear-text-primary)"
|
|
19
|
-
},
|
|
20
|
-
system: {
|
|
21
|
-
bg: "transparent",
|
|
22
|
-
text: "var(--bear-text-tertiary, var(--bear-text-muted))"
|
|
23
|
-
}
|
|
24
|
-
};
|
|
7
|
+
}, D = {
|
|
8
|
+
placeholder: A.PLACEHOLDER,
|
|
9
|
+
typingText: A.TYPING_TEXT,
|
|
10
|
+
newMessagesLabel: L
|
|
11
|
+
}, o = E, O = T, s = T, R = T, n = H, e = "--Bear-Chat-height";
|
|
25
12
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
A as CHAT_DEFAULTS,
|
|
14
|
+
n as CHAT_DEFAULT_DISABLED,
|
|
15
|
+
R as CHAT_DEFAULT_SHOW_AVATARS,
|
|
16
|
+
s as CHAT_DEFAULT_SHOW_STATUS,
|
|
17
|
+
O as CHAT_DEFAULT_SHOW_TIMESTAMPS,
|
|
18
|
+
D as CHAT_DEFAULT_TRANSLATIONS,
|
|
19
|
+
e as CHAT_HEIGHT_VAR,
|
|
20
|
+
o as CHAT_STICK_THRESHOLD
|
|
29
21
|
};
|
|
@@ -1,21 +1,2 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
1
|
import { ChatProps } from './Chat.types';
|
|
3
|
-
|
|
4
|
-
* Chat - Chat interface component
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* ```tsx
|
|
8
|
-
* const [messages, setMessages] = useState<ChatMessage[]>([
|
|
9
|
-
* { id: '1', content: 'Hello!', sender: 'bot', timestamp: new Date() },
|
|
10
|
-
* ]);
|
|
11
|
-
*
|
|
12
|
-
* <Chat
|
|
13
|
-
* messages={messages}
|
|
14
|
-
* onSend={(msg) => setMessages([...messages, { id: Date.now().toString(), content: msg, sender: 'user' }])}
|
|
15
|
-
* isTyping={false}
|
|
16
|
-
* showAvatars
|
|
17
|
-
* />
|
|
18
|
-
* ```
|
|
19
|
-
*/
|
|
20
|
-
export declare const Chat: FC<ChatProps>;
|
|
21
|
-
export default Chat;
|
|
2
|
+
export declare const Chat: (props: ChatProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,180 +1,125 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import "../Box/Box.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
1
|
+
import { jsxs as A, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as T, useState as Z, useEffect as $ } from "react";
|
|
3
|
+
import { BOOLEAN_FALSE as o, COMPONENT_NAME_CHAT as tt, BOOLEAN_TRUE as u } from "../../constants/generals.const.js";
|
|
4
|
+
import { cn as et } from "../../utils/cn.js";
|
|
5
|
+
import { resolveBearId as rt } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as ot } from "../../utils/useBearId.js";
|
|
7
|
+
import { getBearLiveRegionProps as st } from "../../utils/liveRegion.utils.js";
|
|
8
|
+
import { Box as s } from "../Box/Box.js";
|
|
9
|
+
import { Button as nt } from "../Button/Button.js";
|
|
10
|
+
import { ChatBubble as at } from "../ChatBubble/ChatBubble.js";
|
|
11
|
+
import { ChatError as it } from "../ChatError/ChatError.js";
|
|
12
|
+
import { PromptComposer as lt } from "../PromptComposer/PromptComposer.js";
|
|
13
|
+
import { PromptSuggestions as ct } from "../PromptSuggestions/PromptSuggestions.js";
|
|
14
|
+
import { CHAT_DEFAULT_SHOW_TIMESTAMPS as mt, CHAT_DEFAULT_SHOW_STATUS as ht, CHAT_DEFAULT_SHOW_AVATARS as pt, CHAT_DEFAULTS as dt, CHAT_DEFAULT_DISABLED as At, CHAT_DEFAULT_TRANSLATIONS as Tt } from "./Chat.const.js";
|
|
15
|
+
import { resolveChatHeightVar as ut, isChatScrollerAtBottom as ft } from "./Chat.utils.js";
|
|
16
|
+
import { ChatTypingIndicator as _t } from "./helpers/ChatTypingIndicator.js";
|
|
17
|
+
const Dt = (S) => {
|
|
18
|
+
const {
|
|
19
|
+
id: C,
|
|
20
|
+
testId: B,
|
|
21
|
+
messages: n,
|
|
22
|
+
onSend: E,
|
|
23
|
+
onStop: N,
|
|
24
|
+
onAttach: H,
|
|
25
|
+
isLoading: L = o,
|
|
26
|
+
isStreaming: v = o,
|
|
27
|
+
isTyping: I = o,
|
|
28
|
+
placeholder: w,
|
|
29
|
+
header: f,
|
|
30
|
+
footer: O,
|
|
31
|
+
showTimestamps: R = mt,
|
|
32
|
+
showStatus: y = ht,
|
|
33
|
+
showAvatars: b = pt,
|
|
34
|
+
userAvatar: x,
|
|
35
|
+
botAvatar: D,
|
|
36
|
+
typingText: F,
|
|
37
|
+
className: U,
|
|
38
|
+
height: P = dt.HEIGHT,
|
|
39
|
+
disabled: M = At,
|
|
40
|
+
allowAttach: W,
|
|
41
|
+
suggestions: i,
|
|
42
|
+
onSuggestionSelect: j,
|
|
43
|
+
errorTitle: V,
|
|
44
|
+
errorMessage: _,
|
|
45
|
+
onRetry: k,
|
|
46
|
+
translations: z
|
|
47
|
+
} = S, G = ot(tt), q = rt(C, G), l = T(null), c = T(u), m = T(null), [J, h] = Z(o), p = { ...Tt, ...z }, d = v || L, e = n[n.length - 1], K = d && typeof (e == null ? void 0 : e.content) == "string" ? e.content : void 0, Q = st("info"), g = () => {
|
|
48
|
+
const t = l.current;
|
|
49
|
+
t && (t.scrollTop = t.scrollHeight, c.current = u, h(o));
|
|
50
|
+
}, X = () => {
|
|
51
|
+
const t = l.current;
|
|
52
|
+
if (!t)
|
|
53
|
+
return;
|
|
54
|
+
const a = ft(t);
|
|
55
|
+
c.current = a, a && h(o);
|
|
56
|
+
};
|
|
57
|
+
return $(() => {
|
|
58
|
+
const t = (e == null ? void 0 : e.id) ?? null, a = m.current === null, Y = t !== null && t !== m.current;
|
|
59
|
+
if (m.current = t, !!Y) {
|
|
60
|
+
if (a || c.current) {
|
|
61
|
+
g();
|
|
62
|
+
return;
|
|
30
63
|
}
|
|
31
|
-
|
|
32
|
-
const x = n ? u : p, f = e.status ? V[e.status] : null;
|
|
33
|
-
return /* @__PURE__ */ a(
|
|
34
|
-
"div",
|
|
35
|
-
{
|
|
36
|
-
className: d(
|
|
37
|
-
"flex gap-2 mb-3",
|
|
38
|
-
n ? "flex-row-reverse" : "flex-row"
|
|
39
|
-
),
|
|
40
|
-
children: [
|
|
41
|
-
b && /* @__PURE__ */ r(
|
|
42
|
-
j,
|
|
43
|
-
{
|
|
44
|
-
src: x,
|
|
45
|
-
initials: ((s = e.name) == null ? void 0 : s[0]) || (n ? "U" : "B"),
|
|
46
|
-
size: "sm",
|
|
47
|
-
className: "flex-shrink-0"
|
|
48
|
-
}
|
|
49
|
-
),
|
|
50
|
-
/* @__PURE__ */ a("div", { className: d("flex flex-col max-w-[70%]", n ? "items-end" : "items-start"), children: [
|
|
51
|
-
e.name && /* @__PURE__ */ r(m, { variant: "caption", className: "mb-1 opacity-60", children: e.name }),
|
|
52
|
-
/* @__PURE__ */ r(
|
|
53
|
-
"div",
|
|
54
|
-
{
|
|
55
|
-
className: d(
|
|
56
|
-
"px-4 py-2 rounded-2xl",
|
|
57
|
-
n ? "rounded-br-sm" : "rounded-bl-sm"
|
|
58
|
-
),
|
|
59
|
-
style: {
|
|
60
|
-
backgroundColor: i.bg,
|
|
61
|
-
color: i.text
|
|
62
|
-
},
|
|
63
|
-
children: typeof e.content == "string" ? /* @__PURE__ */ r(m, { variant: "body2", children: e.content }) : e.content
|
|
64
|
-
}
|
|
65
|
-
),
|
|
66
|
-
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 mt-1", children: [
|
|
67
|
-
o && e.timestamp && /* @__PURE__ */ r(m, { variant: "caption", className: "opacity-50 text-xs", children: e.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) }),
|
|
68
|
-
l && f && n && /* @__PURE__ */ r(
|
|
69
|
-
"span",
|
|
70
|
-
{
|
|
71
|
-
className: d(
|
|
72
|
-
"text-xs",
|
|
73
|
-
e.status === "read" ? "text-blue-500" : "opacity-50",
|
|
74
|
-
e.status === "error" && "text-red-500"
|
|
75
|
-
),
|
|
76
|
-
children: f
|
|
77
|
-
}
|
|
78
|
-
)
|
|
79
|
-
] })
|
|
80
|
-
] })
|
|
81
|
-
]
|
|
64
|
+
h(u);
|
|
82
65
|
}
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
/* @__PURE__ */ a("div", { className: "flex gap-1 px-4 py-3 bg-gray-100 dark:bg-gray-800 rounded-2xl rounded-bl-sm", children: [
|
|
86
|
-
/* @__PURE__ */ r("span", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "0ms" } }),
|
|
87
|
-
/* @__PURE__ */ r("span", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "150ms" } }),
|
|
88
|
-
/* @__PURE__ */ r("span", { className: "w-2 h-2 bg-gray-400 rounded-full animate-bounce", style: { animationDelay: "300ms" } })
|
|
89
|
-
] }),
|
|
90
|
-
/* @__PURE__ */ r(m, { variant: "caption", className: "opacity-50", children: e })
|
|
91
|
-
] }), ee = ({
|
|
92
|
-
messages: e,
|
|
93
|
-
onSend: o,
|
|
94
|
-
isLoading: l = !1,
|
|
95
|
-
placeholder: b = g.PLACEHOLDER,
|
|
96
|
-
header: u,
|
|
97
|
-
footer: p,
|
|
98
|
-
showTimestamps: n = !0,
|
|
99
|
-
showStatus: h = !0,
|
|
100
|
-
showAvatars: i = !0,
|
|
101
|
-
userAvatar: x,
|
|
102
|
-
botAvatar: f,
|
|
103
|
-
isTyping: s = !1,
|
|
104
|
-
typingText: C,
|
|
105
|
-
className: S,
|
|
106
|
-
height: v = g.HEIGHT,
|
|
107
|
-
testId: T,
|
|
108
|
-
disabled: y = !1
|
|
109
|
-
}) => {
|
|
110
|
-
const { mode: D } = H(), I = D === "dark", [c, w] = B(""), E = R(null);
|
|
111
|
-
_(() => {
|
|
112
|
-
var t;
|
|
113
|
-
(t = E.current) == null || t.scrollIntoView({ behavior: "smooth" });
|
|
114
|
-
}, [e, s]);
|
|
115
|
-
const N = k(() => {
|
|
116
|
-
c.trim() && o && !y && !l && (o(c.trim()), w(""));
|
|
117
|
-
}, [c, o, y, l]), A = k((t) => {
|
|
118
|
-
t.key === "Enter" && !t.shiftKey && (t.preventDefault(), N());
|
|
119
|
-
}, [N]);
|
|
120
|
-
return /* @__PURE__ */ a(
|
|
121
|
-
"div",
|
|
66
|
+
}, [n, e == null ? void 0 : e.id]), /* @__PURE__ */ A(
|
|
67
|
+
s,
|
|
122
68
|
{
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
S
|
|
128
|
-
),
|
|
129
|
-
style: { height: typeof v == "number" ? `${v}px` : v },
|
|
130
|
-
"data-testid": T,
|
|
69
|
+
id: q,
|
|
70
|
+
"data-testid": B,
|
|
71
|
+
className: et("Bear-Chat", U),
|
|
72
|
+
style: ut(P),
|
|
131
73
|
children: [
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
-
|
|
135
|
-
|
|
74
|
+
f && /* @__PURE__ */ r(s, { className: "Bear-Chat__header", children: f }),
|
|
75
|
+
/* @__PURE__ */ A(s, { ref: l, className: "Bear-Chat__messages", onScroll: X, children: [
|
|
76
|
+
/* @__PURE__ */ r(s, { className: "Bear-Chat__live", ...Q, children: K }),
|
|
77
|
+
n.map((t) => /* @__PURE__ */ r(
|
|
78
|
+
at,
|
|
136
79
|
{
|
|
137
80
|
message: t,
|
|
138
|
-
showTimestamp:
|
|
139
|
-
showStatus:
|
|
140
|
-
showAvatar:
|
|
81
|
+
showTimestamp: R,
|
|
82
|
+
showStatus: y,
|
|
83
|
+
showAvatar: b,
|
|
141
84
|
userAvatar: x,
|
|
142
|
-
botAvatar:
|
|
85
|
+
botAvatar: D
|
|
143
86
|
},
|
|
144
87
|
t.id
|
|
145
88
|
)),
|
|
146
|
-
|
|
147
|
-
/* @__PURE__ */ r(
|
|
89
|
+
I && !d && /* @__PURE__ */ r(_t, { text: F ?? p.typingText }),
|
|
90
|
+
_ && /* @__PURE__ */ r(it, { title: V, onRetry: k, children: _ }),
|
|
91
|
+
J && /* @__PURE__ */ r(
|
|
92
|
+
nt,
|
|
93
|
+
{
|
|
94
|
+
type: "button",
|
|
95
|
+
variant: "primary",
|
|
96
|
+
size: "sm",
|
|
97
|
+
className: "Bear-Chat__new-messages",
|
|
98
|
+
onClick: g,
|
|
99
|
+
children: p.newMessagesLabel
|
|
100
|
+
}
|
|
101
|
+
)
|
|
148
102
|
] }),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
{
|
|
165
|
-
variant: "primary",
|
|
166
|
-
onClick: N,
|
|
167
|
-
disabled: !c.trim() || y || l,
|
|
168
|
-
children: /* @__PURE__ */ r(G.SendIcon, { size: 18 })
|
|
169
|
-
}
|
|
170
|
-
)
|
|
171
|
-
] }),
|
|
172
|
-
p && /* @__PURE__ */ r("div", { className: "mt-2", children: p })
|
|
103
|
+
i && i.length > 0 && /* @__PURE__ */ r(s, { className: "Bear-Chat__suggestions", children: /* @__PURE__ */ r(ct, { suggestions: i, onSelect: j }) }),
|
|
104
|
+
/* @__PURE__ */ A(s, { className: "Bear-Chat__composer", children: [
|
|
105
|
+
/* @__PURE__ */ r(
|
|
106
|
+
lt,
|
|
107
|
+
{
|
|
108
|
+
onSubmit: E,
|
|
109
|
+
onStop: N,
|
|
110
|
+
onAttach: H,
|
|
111
|
+
isStreaming: d,
|
|
112
|
+
disabled: M,
|
|
113
|
+
allowAttach: W,
|
|
114
|
+
placeholder: w ?? p.placeholder
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
O
|
|
173
118
|
] })
|
|
174
119
|
]
|
|
175
120
|
}
|
|
176
121
|
);
|
|
177
122
|
};
|
|
178
123
|
export {
|
|
179
|
-
|
|
124
|
+
Dt as Chat
|
|
180
125
|
};
|