@forgedevstack/bear 1.3.1 → 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 +30 -0
- package/dist/components/Accordion/components/AccordionItem/AccordionItem.cjs +1 -1
- package/dist/components/Accordion/components/AccordionItem/AccordionItem.js +1 -1
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.js +1 -1
- 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/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/BackTop/BackTop.cjs +1 -1
- package/dist/components/BackTop/BackTop.js +1 -1
- package/dist/components/Banner/Banner.const.cjs +1 -1
- package/dist/components/Banner/Banner.const.js +10 -9
- package/dist/components/Blockquote/Blockquote.cjs +1 -1
- package/dist/components/Blockquote/Blockquote.js +1 -1
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +1 -1
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Chart/BarChart.cjs +1 -1
- package/dist/components/Chart/BarChart.d.ts +1 -2
- package/dist/components/Chart/BarChart.js +74 -61
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.const.cjs +1 -1
- package/dist/components/Chart/Chart.const.d.ts +24 -3
- package/dist/components/Chart/Chart.const.js +39 -16
- package/dist/components/Chart/Chart.d.ts +1 -5
- package/dist/components/Chart/Chart.js +23 -24
- package/dist/components/Chart/Chart.types.d.ts +12 -20
- package/dist/components/Chart/Chart.utils.cjs +1 -1
- package/dist/components/Chart/Chart.utils.d.ts +8 -18
- package/dist/components/Chart/Chart.utils.js +39 -3
- package/dist/components/Chart/FunnelChart.cjs +1 -0
- package/dist/components/Chart/FunnelChart.d.ts +2 -0
- package/dist/components/Chart/FunnelChart.js +61 -0
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.d.ts +1 -2
- package/dist/components/Chart/LineChart.js +80 -70
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.d.ts +1 -2
- package/dist/components/Chart/PieChart.js +140 -105
- package/dist/components/Chart/PieChart.types.d.ts +8 -0
- package/dist/components/Chart/RadarChart.cjs +1 -0
- package/dist/components/Chart/RadarChart.d.ts +2 -0
- package/dist/components/Chart/RadarChart.js +123 -0
- package/dist/components/Chart/index.d.ts +3 -1
- 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/CurrencyInput/CurrencyInput.cjs +1 -1
- package/dist/components/CurrencyInput/CurrencyInput.js +1 -1
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +1 -1
- 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 +4 -12
- package/dist/components/Drawer/Drawer.const.js +7 -55
- package/dist/components/Drawer/Drawer.d.ts +1 -2
- package/dist/components/Drawer/Drawer.js +78 -112
- package/dist/components/Drawer/Drawer.types.d.ts +20 -4
- package/dist/components/Drawer/Drawer.utils.d.ts +0 -4
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.cjs +1 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.d.ts +2 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.js +26 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeader.types.d.ts +20 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.cjs +1 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.d.ts +2 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderClose.js +17 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.cjs +1 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.d.ts +2 -0
- package/dist/components/Drawer/components/DrawerHeader/DrawerHeaderTitle.js +9 -0
- package/dist/components/Drawer/components/DrawerHeader/index.d.ts +2 -0
- package/dist/components/Drawer/components/index.d.ts +1 -0
- package/dist/components/Drawer/helpers/DrawerOptionalHeader.cjs +1 -0
- package/dist/components/Drawer/helpers/DrawerOptionalHeader.d.ts +2 -0
- package/dist/components/Drawer/helpers/DrawerOptionalHeader.js +9 -0
- package/dist/components/Drawer/helpers/index.d.ts +1 -0
- package/dist/components/Drawer/hooks/index.d.ts +1 -0
- package/dist/components/Drawer/hooks/useDrawer.cjs +1 -0
- package/dist/components/Drawer/hooks/useDrawer.d.ts +2 -0
- package/dist/components/Drawer/hooks/useDrawer.js +50 -0
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Editable/Editable.cjs +1 -1
- package/dist/components/Editable/Editable.js +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/FileTree/FileTree.cjs +1 -1
- package/dist/components/FileTree/FileTree.js +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/Gauge/Gauge.cjs +1 -1
- package/dist/components/Gauge/Gauge.const.cjs +1 -1
- package/dist/components/Gauge/Gauge.const.d.ts +5 -0
- package/dist/components/Gauge/Gauge.const.js +11 -6
- package/dist/components/Gauge/Gauge.d.ts +1 -2
- package/dist/components/Gauge/Gauge.js +69 -45
- package/dist/components/Gauge/Gauge.types.d.ts +11 -2
- package/dist/components/Gauge/helpers/GaugeLinearBar.cjs +1 -0
- package/dist/components/Gauge/helpers/GaugeLinearBar.d.ts +2 -0
- package/dist/components/Gauge/helpers/GaugeLinearBar.js +40 -0
- package/dist/components/Heatmap/Heatmap.cjs +1 -1
- package/dist/components/Heatmap/Heatmap.const.cjs +1 -1
- package/dist/components/Heatmap/Heatmap.const.d.ts +2 -0
- package/dist/components/Heatmap/Heatmap.const.js +8 -6
- package/dist/components/Heatmap/Heatmap.js +51 -47
- package/dist/components/Heatmap/Heatmap.types.d.ts +1 -1
- package/dist/components/Icon/Icon.d.ts +2 -39
- package/dist/components/Icon/Icon.types.d.ts +1 -17
- package/dist/components/Icon/icons/action.d.ts +1 -85
- package/dist/components/Icon/icons/bear.d.ts +1 -12
- package/dist/components/Icon/icons/charts.d.ts +1 -0
- package/dist/components/Icon/icons/commerce.d.ts +1 -25
- package/dist/components/Icon/icons/communication.d.ts +1 -48
- package/dist/components/Icon/icons/content.d.ts +1 -53
- package/dist/components/Icon/icons/device.d.ts +1 -27
- package/dist/components/Icon/icons/editor.d.ts +1 -54
- package/dist/components/Icon/icons/file.d.ts +1 -25
- package/dist/components/Icon/icons/index.d.ts +1 -9
- package/dist/components/Icon/icons/media.d.ts +1 -64
- package/dist/components/Icon/icons/misc.d.ts +1 -96
- package/dist/components/Icon/icons/navigation.d.ts +1 -56
- package/dist/components/Icon/icons/social.d.ts +1 -24
- package/dist/components/Icon/icons/status.d.ts +1 -61
- package/dist/components/Icon/index.d.ts +3 -605
- 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/ImageAnnotation/ImageAnnotation.cjs +1 -1
- package/dist/components/ImageAnnotation/ImageAnnotation.js +1 -1
- package/dist/components/JsonViewer/JsonViewer.cjs +1 -1
- package/dist/components/JsonViewer/JsonViewer.js +1 -1
- package/dist/components/MediaPlayer/MediaPlayer.cjs +1 -1
- package/dist/components/MediaPlayer/MediaPlayer.js +1 -1
- 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/PageNav/PageNav.cjs +1 -1
- package/dist/components/PageNav/PageNav.js +1 -1
- package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +1 -1
- 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/PropsPlayground/PropsPlayground.cjs +1 -1
- package/dist/components/PropsPlayground/PropsPlayground.js +1 -1
- package/dist/components/Rating/components/StarIcon/StarIcon.cjs +1 -1
- package/dist/components/Rating/components/StarIcon/StarIcon.js +1 -1
- package/dist/components/Result/Result.utils.cjs +1 -1
- package/dist/components/Result/Result.utils.js +1 -1
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +1 -1
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +1 -1
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +1 -1
- package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarSignature/ToolbarSignature.js +1 -1
- package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/IconRender.js +1 -1
- package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/toolbarItemRender.js +1 -1
- package/dist/components/RingProgress/RingProgress.cjs +1 -1
- package/dist/components/RingProgress/RingProgress.const.cjs +1 -1
- package/dist/components/RingProgress/RingProgress.const.d.ts +3 -0
- package/dist/components/RingProgress/RingProgress.const.js +7 -4
- package/dist/components/RingProgress/RingProgress.js +38 -37
- package/dist/components/RingProgress/RingProgress.types.d.ts +1 -0
- 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/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.js +16 -15
- package/dist/components/Sidebar/Sidebar.types.d.ts +1 -1
- package/dist/components/Sidebar/Sidebar.utils.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.utils.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.utils.js +11 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -1
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +1 -1
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -1
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +55 -51
- package/dist/components/Sidebar/index.d.ts +1 -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/SliderRange/SliderRange.cjs +1 -1
- package/dist/components/SliderRange/SliderRange.js +19 -19
- package/dist/components/Sparkline/Sparkline.cjs +1 -1
- package/dist/components/Sparkline/Sparkline.const.cjs +1 -1
- package/dist/components/Sparkline/Sparkline.const.d.ts +5 -0
- package/dist/components/Sparkline/Sparkline.const.js +9 -4
- package/dist/components/Sparkline/Sparkline.d.ts +1 -2
- package/dist/components/Sparkline/Sparkline.js +75 -53
- package/dist/components/Sparkline/Sparkline.types.d.ts +2 -0
- package/dist/components/Sparkline/Sparkline.utils.cjs +1 -1
- package/dist/components/Sparkline/Sparkline.utils.d.ts +7 -12
- package/dist/components/Sparkline/Sparkline.utils.js +33 -20
- package/dist/components/Sparkline/index.d.ts +2 -2
- 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/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.js +1 -1
- 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/Tabs/TabList.cjs +1 -1
- package/dist/components/Tabs/TabList.js +1 -1
- 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/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.js +1 -1
- package/dist/components/TimelineChart/TimelineChart.cjs +1 -1
- package/dist/components/TimelineChart/TimelineChart.const.cjs +1 -1
- package/dist/components/TimelineChart/TimelineChart.const.d.ts +3 -0
- package/dist/components/TimelineChart/TimelineChart.const.js +7 -4
- package/dist/components/TimelineChart/TimelineChart.js +56 -42
- package/dist/components/TimelineChart/TimelineChart.types.d.ts +1 -1
- 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/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/TreeSelect/TreeSelect.js +1 -1
- package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.cjs +1 -1
- package/dist/components/TreeSelect/components/TreeSelectExpandControl/TreeSelectExpandControl.js +1 -1
- package/dist/components/TreeView/TreeView.cjs +1 -1
- package/dist/components/TreeView/TreeView.js +3 -2
- package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.cjs +1 -1
- package/dist/components/TreeView/components/TreeViewExpandControl/TreeViewExpandControl.js +1 -1
- package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.cjs +1 -1
- package/dist/components/TreeView/components/TreeViewNodeIcon/TreeViewNodeIcon.js +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +39 -11
- package/dist/components/index.js +455 -420
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +50 -0
- package/dist/constants/generals.const.js +154 -108
- 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/icons.cjs +1 -1
- package/dist/icons.d.ts +2 -2
- package/dist/icons.js +1 -6
- package/dist/index.cjs +1 -1
- package/dist/index.js +597 -562
- 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/_drawer.css +213 -0
- package/dist/styles/_effects.css +8 -4
- package/dist/styles/_overlays.css +0 -1
- package/dist/styles/_skeleton.css +90 -0
- package/dist/styles/main.css +4 -0
- package/dist/styles.css +1089 -186
- package/package.json +5 -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/components/Icon/Icon.cjs +0 -1
- package/dist/components/Icon/Icon.const.d.ts +0 -1
- package/dist/components/Icon/Icon.js +0 -45
- package/dist/components/Icon/icons/action.cjs +0 -1
- package/dist/components/Icon/icons/action.js +0 -351
- package/dist/components/Icon/icons/bear.cjs +0 -1
- package/dist/components/Icon/icons/bear.js +0 -47
- package/dist/components/Icon/icons/commerce.cjs +0 -1
- package/dist/components/Icon/icons/commerce.js +0 -124
- package/dist/components/Icon/icons/communication.cjs +0 -1
- package/dist/components/Icon/icons/communication.js +0 -184
- package/dist/components/Icon/icons/content.cjs +0 -1
- package/dist/components/Icon/icons/content.js +0 -231
- package/dist/components/Icon/icons/device.cjs +0 -1
- package/dist/components/Icon/icons/device.js +0 -122
- package/dist/components/Icon/icons/editor.cjs +0 -1
- package/dist/components/Icon/icons/editor.js +0 -285
- package/dist/components/Icon/icons/file.cjs +0 -1
- package/dist/components/Icon/icons/file.js +0 -120
- package/dist/components/Icon/icons/media.cjs +0 -1
- package/dist/components/Icon/icons/media.js +0 -306
- package/dist/components/Icon/icons/misc.cjs +0 -1
- package/dist/components/Icon/icons/misc.js +0 -450
- package/dist/components/Icon/icons/navigation.cjs +0 -1
- package/dist/components/Icon/icons/navigation.js +0 -215
- package/dist/components/Icon/icons/social.cjs +0 -1
- package/dist/components/Icon/icons/social.js +0 -89
- package/dist/components/Icon/icons/status.cjs +0 -1
- package/dist/components/Icon/icons/status.js +0 -271
- package/dist/components/Icon/index.cjs +0 -1
- package/dist/components/Icon/index.js +0 -79
|
@@ -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
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ChatBubbleProps as ChatBubbleComponentProps } from '../ChatBubble/ChatBubble.types';
|
|
3
|
+
import { PromptSuggestionItem } from '../PromptSuggestions/PromptSuggestions.types';
|
|
2
4
|
export interface ChatMessage {
|
|
3
5
|
id: string;
|
|
4
6
|
content: string | ReactNode;
|
|
@@ -9,48 +11,39 @@ export interface ChatMessage {
|
|
|
9
11
|
status?: 'sending' | 'sent' | 'delivered' | 'read' | 'error';
|
|
10
12
|
metadata?: Record<string, unknown>;
|
|
11
13
|
}
|
|
14
|
+
export interface ChatTranslations {
|
|
15
|
+
placeholder: string;
|
|
16
|
+
typingText: string;
|
|
17
|
+
newMessagesLabel: string;
|
|
18
|
+
}
|
|
12
19
|
export interface ChatProps {
|
|
13
20
|
id?: string;
|
|
14
|
-
|
|
21
|
+
testId?: string;
|
|
15
22
|
messages: ChatMessage[];
|
|
16
|
-
/** Callback when user sends a message */
|
|
17
23
|
onSend?: (message: string) => void;
|
|
18
|
-
|
|
24
|
+
onStop?: () => void;
|
|
25
|
+
onAttach?: (files: File[]) => void;
|
|
19
26
|
isLoading?: boolean;
|
|
20
|
-
|
|
27
|
+
isStreaming?: boolean;
|
|
28
|
+
isTyping?: boolean;
|
|
21
29
|
placeholder?: string;
|
|
22
|
-
/** Chat header content */
|
|
23
30
|
header?: ReactNode;
|
|
24
|
-
/** Chat footer content (below input) */
|
|
25
31
|
footer?: ReactNode;
|
|
26
|
-
/** Show timestamps */
|
|
27
32
|
showTimestamps?: boolean;
|
|
28
|
-
/** Show message status */
|
|
29
33
|
showStatus?: boolean;
|
|
30
|
-
/** Show avatars */
|
|
31
34
|
showAvatars?: boolean;
|
|
32
|
-
/** User avatar URL */
|
|
33
35
|
userAvatar?: string;
|
|
34
|
-
/** Bot avatar URL */
|
|
35
36
|
botAvatar?: string;
|
|
36
|
-
/** Typing indicator */
|
|
37
|
-
isTyping?: boolean;
|
|
38
|
-
/** Typing indicator text */
|
|
39
37
|
typingText?: string;
|
|
40
|
-
/** Custom class name */
|
|
41
38
|
className?: string;
|
|
42
|
-
/** Height of the chat container */
|
|
43
39
|
height?: number | string;
|
|
44
|
-
/** Test ID */
|
|
45
|
-
testId?: string;
|
|
46
|
-
/** Disable input */
|
|
47
40
|
disabled?: boolean;
|
|
41
|
+
allowAttach?: boolean;
|
|
42
|
+
suggestions?: PromptSuggestionItem[];
|
|
43
|
+
onSuggestionSelect?: (id: string) => void;
|
|
44
|
+
errorTitle?: string;
|
|
45
|
+
errorMessage?: ReactNode;
|
|
46
|
+
onRetry?: () => void;
|
|
47
|
+
translations?: Partial<ChatTranslations>;
|
|
48
48
|
}
|
|
49
|
-
export
|
|
50
|
-
message: ChatMessage;
|
|
51
|
-
showTimestamp?: boolean;
|
|
52
|
-
showStatus?: boolean;
|
|
53
|
-
showAvatar?: boolean;
|
|
54
|
-
userAvatar?: string;
|
|
55
|
-
botAvatar?: string;
|
|
56
|
-
}
|
|
49
|
+
export type ChatBubbleProps = ChatBubbleComponentProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../../constants/generals.const.cjs"),o=require("./Chat.const.cjs"),n=t=>{const e=typeof t=="number"?`${t}${r.UNIT_PX}`:t;return{[o.CHAT_HEIGHT_VAR]:e}},s=t=>t.scrollHeight-t.scrollTop-t.clientHeight<=o.CHAT_STICK_THRESHOLD;exports.isChatScrollerAtBottom=s;exports.resolveChatHeightVar=n;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UNIT_PX as r } from "../../constants/generals.const.js";
|
|
2
|
+
import { CHAT_HEIGHT_VAR as e, CHAT_STICK_THRESHOLD as n } from "./Chat.const.js";
|
|
3
|
+
const s = (t) => {
|
|
4
|
+
const o = typeof t == "number" ? `${t}${r}` : t;
|
|
5
|
+
return { [e]: o };
|
|
6
|
+
}, i = (t) => t.scrollHeight - t.scrollTop - t.clientHeight <= n;
|
|
7
|
+
export {
|
|
8
|
+
i as isChatScrollerAtBottom,
|
|
9
|
+
s as resolveChatHeightVar
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("../../Flex/Flex.cjs"),r=require("../../Typography/Typography.cjs"),i=require("../../../constants/numbers.const.cjs"),p=a=>{const{text:o}=a,s=Array.from({length:i.TYPING_DOT_COUNT},(t,c)=>c);return e.jsxs(n.Flex,{className:"Bear-ChatTyping",align:"center",gap:2,children:[e.jsx(n.Flex,{className:"Bear-ChatTyping__dots",align:"center",children:s.map(t=>e.jsx(r.Typography,{component:"span",className:"Bear-ChatTyping__dot"},t))}),e.jsx(r.Typography,{variant:"caption",color:"muted",children:o})]})};exports.ChatTypingIndicator=p;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Flex as a } from "../../Flex/Flex.js";
|
|
3
|
+
import { Typography as o } from "../../Typography/Typography.js";
|
|
4
|
+
import { TYPING_DOT_COUNT as m } from "../../../constants/numbers.const.js";
|
|
5
|
+
const d = (n) => {
|
|
6
|
+
const { text: e } = n, i = Array.from({ length: m }, (t, p) => p);
|
|
7
|
+
return /* @__PURE__ */ c(a, { className: "Bear-ChatTyping", align: "center", gap: 2, children: [
|
|
8
|
+
/* @__PURE__ */ r(a, { className: "Bear-ChatTyping__dots", align: "center", children: i.map((t) => /* @__PURE__ */ r(o, { component: "span", className: "Bear-ChatTyping__dot" }, t)) }),
|
|
9
|
+
/* @__PURE__ */ r(o, { variant: "caption", color: "muted", children: e })
|
|
10
|
+
] });
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
d as ChatTypingIndicator
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),d=require("../../constants/generals.const.cjs");require("react");const _=require("../../utils/generateBearId.utils.cjs"),b=require("../../utils/useBearId.cjs"),t=require("./ChatBubble.const.cjs"),c=require("./ChatBubble.utils.cjs"),l=require("./helpers/ChatBubbleSystem.cjs"),T=require("./helpers/ChatBubbleThread.cjs"),h=a=>{const{id:u,showTimestamp:n=t.CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP,showStatus:B=t.CHAT_BUBBLE_DEFAULT_SHOW_STATUS,showAvatar:o=t.CHAT_BUBBLE_DEFAULT_SHOW_AVATAR,...e}=a,i=b.useBearId(d.COMPONENT_NAME_CHAT_BUBBLE),s=_.resolveBearId(u,i);return c.isChatSystemSender(e.message.sender)?r.jsx(l.ChatBubbleSystem,{id:s,testId:e.testId,message:e.message,className:e.className}):r.jsx(T.ChatBubbleThread,{...e,id:s,domId:s,showTimestamp:n,showStatus:B,showAvatar:o})};exports.ChatBubble=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("../../constants/generals.const.cjs"),B=_.BOOLEAN_TRUE,T=_.BOOLEAN_TRUE,A=_.BOOLEAN_TRUE,E={sending:"○",sent:"✓",delivered:"✓✓",read:"✓✓",error:"!"},U="U",L="B",H="2-digit";exports.CHAT_BUBBLE_BOT_INITIAL=L;exports.CHAT_BUBBLE_DEFAULT_SHOW_AVATAR=A;exports.CHAT_BUBBLE_DEFAULT_SHOW_STATUS=T;exports.CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP=B;exports.CHAT_BUBBLE_STATUS_MARK=E;exports.CHAT_BUBBLE_TIME_DIGIT=H;exports.CHAT_BUBBLE_USER_INITIAL=U;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP = true;
|
|
2
|
+
export declare const CHAT_BUBBLE_DEFAULT_SHOW_STATUS = true;
|
|
3
|
+
export declare const CHAT_BUBBLE_DEFAULT_SHOW_AVATAR = true;
|
|
4
|
+
export declare const CHAT_BUBBLE_STATUS_MARK: {
|
|
5
|
+
readonly sending: "○";
|
|
6
|
+
readonly sent: "✓";
|
|
7
|
+
readonly delivered: "✓✓";
|
|
8
|
+
readonly read: "✓✓";
|
|
9
|
+
readonly error: "!";
|
|
10
|
+
};
|
|
11
|
+
export declare const CHAT_BUBBLE_USER_INITIAL = "U";
|
|
12
|
+
export declare const CHAT_BUBBLE_BOT_INITIAL = "B";
|
|
13
|
+
export declare const CHAT_BUBBLE_TIME_DIGIT = "2-digit";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BOOLEAN_TRUE as _ } from "../../constants/generals.const.js";
|
|
2
|
+
const T = _, A = _, E = _, U = {
|
|
3
|
+
sending: "○",
|
|
4
|
+
sent: "✓",
|
|
5
|
+
delivered: "✓✓",
|
|
6
|
+
read: "✓✓",
|
|
7
|
+
error: "!"
|
|
8
|
+
}, L = "U", o = "B", t = "2-digit";
|
|
9
|
+
export {
|
|
10
|
+
o as CHAT_BUBBLE_BOT_INITIAL,
|
|
11
|
+
E as CHAT_BUBBLE_DEFAULT_SHOW_AVATAR,
|
|
12
|
+
A as CHAT_BUBBLE_DEFAULT_SHOW_STATUS,
|
|
13
|
+
T as CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP,
|
|
14
|
+
U as CHAT_BUBBLE_STATUS_MARK,
|
|
15
|
+
t as CHAT_BUBBLE_TIME_DIGIT,
|
|
16
|
+
L as CHAT_BUBBLE_USER_INITIAL
|
|
17
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { COMPONENT_NAME_CHAT_BUBBLE as T } from "../../constants/generals.const.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { resolveBearId as _ } from "../../utils/generateBearId.utils.js";
|
|
5
|
+
import { useBearId as d } from "../../utils/useBearId.js";
|
|
6
|
+
import { CHAT_BUBBLE_DEFAULT_SHOW_TIMESTAMP as A, CHAT_BUBBLE_DEFAULT_SHOW_STATUS as p, CHAT_BUBBLE_DEFAULT_SHOW_AVATAR as E } from "./ChatBubble.const.js";
|
|
7
|
+
import { isChatSystemSender as S } from "./ChatBubble.utils.js";
|
|
8
|
+
import { ChatBubbleSystem as f } from "./helpers/ChatBubbleSystem.js";
|
|
9
|
+
import { ChatBubbleThread as n } from "./helpers/ChatBubbleThread.js";
|
|
10
|
+
const l = (s) => {
|
|
11
|
+
const {
|
|
12
|
+
id: m,
|
|
13
|
+
showTimestamp: o = A,
|
|
14
|
+
showStatus: a = p,
|
|
15
|
+
showAvatar: B = E,
|
|
16
|
+
...e
|
|
17
|
+
} = s, i = d(T), t = _(m, i);
|
|
18
|
+
return S(e.message.sender) ? /* @__PURE__ */ r(f, { id: t, testId: e.testId, message: e.message, className: e.className }) : /* @__PURE__ */ r(
|
|
19
|
+
n,
|
|
20
|
+
{
|
|
21
|
+
...e,
|
|
22
|
+
id: t,
|
|
23
|
+
domId: t,
|
|
24
|
+
showTimestamp: o,
|
|
25
|
+
showStatus: a,
|
|
26
|
+
showAvatar: B
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
l as ChatBubble
|
|
32
|
+
};
|