@forgedevstack/bear 1.3.2 → 1.3.4
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 +145 -288
- package/dist/components/AlertDialog/AlertDialog.cjs +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +67 -84
- 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/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +72 -64
- 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/ChipGroup/ChipGroup.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.cjs +1 -1
- package/dist/components/ChipGroup/ChipGroup.const.d.ts +2 -0
- package/dist/components/ChipGroup/ChipGroup.const.js +6 -4
- package/dist/components/ChipGroup/ChipGroup.js +52 -48
- 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/CommandPalette/CommandItem.cjs +1 -0
- package/dist/components/CommandPalette/CommandItem.d.ts +6 -0
- package/dist/components/CommandPalette/CommandItem.js +39 -0
- package/dist/components/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +129 -144
- 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 +101 -85
- 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 +13 -6
- package/dist/components/EmptyState/EmptyState.const.js +30 -8
- package/dist/components/EmptyState/EmptyState.d.ts +1 -2
- package/dist/components/EmptyState/EmptyState.js +37 -41
- package/dist/components/EmptyState/EmptyState.types.d.ts +3 -1
- 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/HoverCard/HoverCard.cjs +4 -3
- package/dist/components/HoverCard/HoverCard.const.cjs +1 -0
- package/dist/components/HoverCard/HoverCard.const.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.const.js +10 -0
- package/dist/components/HoverCard/HoverCard.js +62 -56
- package/dist/components/HoverCard/HoverCard.types.d.ts +7 -0
- 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/Menu/Menu.cjs +1 -1
- package/dist/components/Menu/Menu.const.cjs +1 -0
- package/dist/components/Menu/Menu.const.d.ts +2 -0
- package/dist/components/Menu/Menu.const.js +12 -0
- package/dist/components/Menu/Menu.d.ts +3 -9
- package/dist/components/Menu/Menu.js +57 -89
- package/dist/components/Menu/Menu.types.d.ts +8 -1
- package/dist/components/Menu/MenuDivider.cjs +1 -0
- package/dist/components/Menu/MenuDivider.d.ts +6 -0
- package/dist/components/Menu/MenuDivider.js +7 -0
- package/dist/components/Menu/MenuItem.cjs +1 -0
- package/dist/components/Menu/MenuItem.d.ts +6 -0
- package/dist/components/Menu/MenuItem.js +46 -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.const.cjs +1 -1
- package/dist/components/Modal/Modal.const.d.ts +1 -0
- package/dist/components/Modal/Modal.const.js +20 -12
- package/dist/components/Modal/Modal.js +62 -59
- package/dist/components/Modal/Modal.types.d.ts +7 -0
- 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/Popover/Popover.cjs +1 -1
- package/dist/components/Popover/Popover.const.cjs +1 -0
- package/dist/components/Popover/Popover.const.d.ts +15 -1
- package/dist/components/Popover/Popover.const.js +29 -0
- package/dist/components/Popover/Popover.js +77 -73
- package/dist/components/Popover/Popover.types.d.ts +7 -0
- 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.const.cjs +1 -1
- package/dist/components/Select/Select.const.d.ts +1 -0
- package/dist/components/Select/Select.const.js +7 -6
- package/dist/components/Select/Select.js +110 -105
- 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/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.const.cjs +1 -1
- package/dist/components/Toast/Toast.const.d.ts +2 -0
- package/dist/components/Toast/Toast.const.js +11 -8
- package/dist/components/Toast/Toast.context.cjs +1 -0
- package/dist/components/Toast/Toast.context.d.ts +3 -0
- package/dist/components/Toast/Toast.context.js +11 -0
- package/dist/components/Toast/Toast.d.ts +4 -3
- package/dist/components/Toast/Toast.icons.cjs +1 -0
- package/dist/components/Toast/Toast.icons.d.ts +4 -0
- package/dist/components/Toast/Toast.icons.js +29 -0
- package/dist/components/Toast/Toast.js +32 -160
- package/dist/components/Toast/ToastContainer.cjs +1 -0
- package/dist/components/Toast/ToastContainer.d.ts +3 -0
- package/dist/components/Toast/ToastContainer.js +39 -0
- package/dist/components/Toast/ToastItem.cjs +1 -0
- package/dist/components/Toast/ToastItem.d.ts +5 -0
- package/dist/components/Toast/ToastItem.js +86 -0
- package/dist/components/ToggleGroup/ToggleGroup.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.d.ts +15 -0
- package/dist/components/ToggleGroup/ToggleGroup.const.js +33 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.context.js +5 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +86 -0
- package/dist/components/ToggleGroup/ToggleGroup.types.d.ts +48 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.cjs +1 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.d.ts +2 -0
- package/dist/components/ToggleGroup/ToggleGroupItem.js +50 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.cjs +1 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.d.ts +1 -0
- package/dist/components/ToggleGroup/hooks/useToggleGroupContext.js +6 -0
- package/dist/components/ToggleGroup/index.d.ts +4 -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/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.const.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.const.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.const.js +18 -0
- package/dist/components/Tooltip/Tooltip.js +59 -61
- package/dist/components/Tooltip/Tooltip.types.d.ts +7 -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 +39 -9
- package/dist/components/index.js +335 -293
- 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 +10 -0
- package/dist/constants/numbers.const.js +64 -53
- 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/index.cjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +6 -4
- 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/hooks/useFocusTrap/index.d.ts +2 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.cjs +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.d.ts +3 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.js +41 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.types.d.ts +8 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.cjs +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.d.ts +1 -0
- package/dist/hooks/useFocusTrap/useFocusTrap.utils.js +23 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +483 -439
- 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 +953 -199
- 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,98 +1,102 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
import { cn as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as p, jsx as w } from "react/jsx-runtime";
|
|
2
|
+
import { useState as A, useRef as h, useCallback as P, useEffect as m } from "react";
|
|
3
|
+
import { createPortal as j } from "react-dom";
|
|
4
|
+
import { cn as v } from "../../utils/cn.js";
|
|
5
|
+
import { TWO as S } from "../../constants/numbers.const.js";
|
|
6
|
+
import { resolveOverlayEffects as B } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.js";
|
|
7
|
+
import { PLACEMENT_BOTTOM as T, POPOVER_DEFAULT_OFFSET as K, POPOVER_ARROW_STYLES as U, POPOVER_EFFECT_CLASS_MAP as O, ALIGN_START as Z, ALIGN_END as q, PLACEMENT_TOP as M, TRANSFORM_TRANSLATE_X_CENTER as J, TRANSFORM_TRANSLATE_X_END as Q, PLACEMENT_RIGHT as $, PLACEMENT_LEFT as ee, TRANSFORM_TRANSLATE_Y_CENTER as te, TRANSFORM_TRANSLATE_Y_END as oe, POPOVER_Z_INDEX as ne } from "./Popover.const.js";
|
|
8
|
+
function re(l, e, s) {
|
|
9
|
+
const t = { position: "fixed", zIndex: ne }, [n] = l.split("-"), r = l.includes(Z), i = l.includes(q);
|
|
10
|
+
return n === T || n === M ? (t.top = n === T ? e.bottom + s : void 0, t.bottom = n === M ? window.innerHeight - e.top + s : void 0, t.left = r ? e.left : i ? e.right : e.left + e.width / S, t.transform = !r && !i ? J : i ? Q : void 0) : (t.left = n === $ ? e.right + s : void 0, t.right = n === ee ? window.innerWidth - e.left + s : void 0, t.bottom = i ? window.innerHeight - e.bottom : void 0, t.top = i ? void 0 : r ? e.top : e.top + e.height / S, t.transform = !r && !i ? te : i ? oe : void 0), t;
|
|
9
11
|
}
|
|
10
|
-
const
|
|
11
|
-
children:
|
|
12
|
-
content:
|
|
13
|
-
placement:
|
|
14
|
-
trigger:
|
|
15
|
-
open:
|
|
16
|
-
onOpenChange:
|
|
17
|
-
className:
|
|
18
|
-
contentClassName:
|
|
19
|
-
arrow:
|
|
20
|
-
closeOnClickOutside:
|
|
21
|
-
closeOnEscape:
|
|
22
|
-
offset:
|
|
12
|
+
const fe = ({
|
|
13
|
+
children: l,
|
|
14
|
+
content: e,
|
|
15
|
+
placement: s = T,
|
|
16
|
+
trigger: t = "click",
|
|
17
|
+
open: n,
|
|
18
|
+
onOpenChange: r,
|
|
19
|
+
className: i,
|
|
20
|
+
contentClassName: R,
|
|
21
|
+
arrow: g = !0,
|
|
22
|
+
closeOnClickOutside: b = !0,
|
|
23
|
+
closeOnEscape: _ = !0,
|
|
24
|
+
offset: L = K,
|
|
25
|
+
openEffect: C,
|
|
26
|
+
closeEffect: F,
|
|
27
|
+
effect: k
|
|
23
28
|
}) => {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
29
|
+
const [y, D] = A(!1), [I, x] = A({}), E = h(null), f = h(null), d = n !== void 0 ? n : y, a = P((o) => {
|
|
30
|
+
D(o), r == null || r(o);
|
|
31
|
+
}, [r]), u = P(() => {
|
|
32
|
+
if (!E.current || !f.current) return;
|
|
33
|
+
const o = E.current.firstElementChild;
|
|
34
|
+
if (!o) return;
|
|
35
|
+
const c = o.getBoundingClientRect();
|
|
36
|
+
x(re(s, c, L));
|
|
37
|
+
}, [s, L]);
|
|
38
|
+
m(() => {
|
|
39
|
+
if (d) {
|
|
40
|
+
u();
|
|
41
|
+
const o = () => u(), c = () => u();
|
|
42
|
+
return window.addEventListener("resize", o), window.addEventListener("scroll", c, !0), () => {
|
|
43
|
+
window.removeEventListener("resize", o), window.removeEventListener("scroll", c, !0);
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}, [d, u]), m(() => {
|
|
47
|
+
if (!d || !b) return;
|
|
48
|
+
const o = (c) => {
|
|
49
|
+
const N = c.target;
|
|
50
|
+
E.current && !E.current.contains(N) && f.current && !f.current.contains(N) && a(!1);
|
|
43
51
|
};
|
|
44
|
-
return
|
|
45
|
-
}, [
|
|
46
|
-
if (!
|
|
47
|
-
const
|
|
48
|
-
|
|
52
|
+
return document.addEventListener("mousedown", o), () => document.removeEventListener("mousedown", o);
|
|
53
|
+
}, [d, b, a]), m(() => {
|
|
54
|
+
if (!d || !_) return;
|
|
55
|
+
const o = (c) => {
|
|
56
|
+
c.key === "Escape" && a(!1);
|
|
49
57
|
};
|
|
50
|
-
return
|
|
51
|
-
}, [
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
bottom: "bear-bottom-full bear-left-1/2 -bear-translate-x-1/2 bear-border-b-zinc-700 bear-border-x-transparent bear-border-t-transparent",
|
|
61
|
-
left: "bear-left-full bear-top-1/2 -bear-translate-y-1/2 bear-border-l-zinc-700 bear-border-y-transparent bear-border-r-transparent",
|
|
62
|
-
right: "bear-right-full bear-top-1/2 -bear-translate-y-1/2 bear-border-r-zinc-700 bear-border-y-transparent bear-border-l-transparent"
|
|
63
|
-
}, D = a.split("-")[0], Y = i && typeof document < "u" && T(
|
|
64
|
-
/* @__PURE__ */ g(
|
|
58
|
+
return document.addEventListener("keydown", o), () => document.removeEventListener("keydown", o);
|
|
59
|
+
}, [d, _, a]);
|
|
60
|
+
const z = () => {
|
|
61
|
+
t === "click" && a(!d);
|
|
62
|
+
}, V = () => {
|
|
63
|
+
t === "hover" && a(!0);
|
|
64
|
+
}, G = () => {
|
|
65
|
+
t === "hover" && a(!1);
|
|
66
|
+
}, H = s.split("-")[0], { openEffect: W } = B({ openEffect: C, closeEffect: F, effect: k }, "fade"), X = O[W] ?? O.fade, Y = d && typeof document < "u" && j(
|
|
67
|
+
/* @__PURE__ */ p(
|
|
65
68
|
"div",
|
|
66
69
|
{
|
|
67
|
-
ref:
|
|
70
|
+
ref: f,
|
|
68
71
|
"data-bear-popover": !0,
|
|
69
|
-
className:
|
|
72
|
+
className: v(
|
|
70
73
|
"bear-bg-zinc-800 bear-border bear-border-zinc-700 bear-rounded-lg bear-shadow-xl bear-p-3",
|
|
71
|
-
|
|
74
|
+
X,
|
|
75
|
+
R
|
|
72
76
|
),
|
|
73
|
-
style:
|
|
77
|
+
style: I,
|
|
74
78
|
children: [
|
|
75
|
-
|
|
76
|
-
|
|
79
|
+
e,
|
|
80
|
+
g && /* @__PURE__ */ w("div", { className: v("bear-absolute bear-w-0 bear-h-0 bear-border-8", U[H]) })
|
|
77
81
|
]
|
|
78
82
|
}
|
|
79
83
|
),
|
|
80
84
|
document.body
|
|
81
85
|
);
|
|
82
|
-
return /* @__PURE__ */
|
|
86
|
+
return /* @__PURE__ */ p(
|
|
83
87
|
"div",
|
|
84
88
|
{
|
|
85
|
-
ref:
|
|
86
|
-
className:
|
|
87
|
-
onMouseEnter:
|
|
88
|
-
onMouseLeave:
|
|
89
|
+
ref: E,
|
|
90
|
+
className: v("bear-relative bear-inline-block", i),
|
|
91
|
+
onMouseEnter: V,
|
|
92
|
+
onMouseLeave: G,
|
|
89
93
|
children: [
|
|
90
|
-
/* @__PURE__ */
|
|
94
|
+
/* @__PURE__ */ w("div", { onClick: z, className: "bear-cursor-pointer", children: l }),
|
|
91
95
|
Y
|
|
92
96
|
]
|
|
93
97
|
}
|
|
94
98
|
);
|
|
95
99
|
};
|
|
96
100
|
export {
|
|
97
|
-
|
|
101
|
+
fe as Popover
|
|
98
102
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { OverlayMotionEffect, OverlayEffectConfig } from '../../hooks/useFixedAnchorPosition';
|
|
2
3
|
export type PopoverPlacement = 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
3
4
|
export interface PopoverProps {
|
|
4
5
|
testId?: string;
|
|
@@ -15,4 +16,10 @@ export interface PopoverProps {
|
|
|
15
16
|
closeOnClickOutside?: boolean;
|
|
16
17
|
closeOnEscape?: boolean;
|
|
17
18
|
offset?: number;
|
|
19
|
+
/** Transition effect when opening */
|
|
20
|
+
openEffect?: OverlayMotionEffect;
|
|
21
|
+
/** Transition effect when closing */
|
|
22
|
+
closeEffect?: OverlayMotionEffect;
|
|
23
|
+
/** Config for open and close transition effects */
|
|
24
|
+
effect?: OverlayEffectConfig;
|
|
18
25
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),T=require("react"),i=require("../../constants/generals.const.cjs"),V=require("../../utils/cn.cjs"),$=require("../../utils/generateBearId.utils.cjs"),Y=require("../../utils/useBearId.cjs"),R=require("../Box/Box.cjs"),d=require("../Button/Button.cjs"),g=require("../Flex/Flex.cjs"),s=require("./PromptComposer.const.cjs"),c=require("./PromptComposer.utils.cjs"),z=require("./helpers/PromptComposerAttachSvg.cjs"),H=require("./helpers/PromptComposerFileChip.cjs"),K=require("./helpers/PromptComposerSendSvg.cjs"),J=require("./helpers/PromptComposerStopSvg.cjs"),Q=x=>{const{id:f,testId:M,value:P,defaultValue:b=s.PROMPT_COMPOSER_DEFAULT_VALUE,onChange:p,onSubmit:a,onStop:_,onAttach:m,files:E,onFileRemove:B,isStreaming:o=s.PROMPT_COMPOSER_DEFAULT_STREAMING,disabled:r=s.PROMPT_COMPOSER_DEFAULT_DISABLED,allowAttach:v=s.PROMPT_COMPOSER_DEFAULT_ATTACH,accept:A,placeholder:I,translations:j,footer:q,className:N}=x,y=Y.useBearId(i.COMPONENT_NAME_PROMPT_COMPOSER),C=$.resolveBearId(f,y),S=T.useRef(null),[D,F]=T.useState(b),n=c.resolvePromptDraft({value:P},D),l={...s.PROMPT_COMPOSER_DEFAULT_TRANSLATIONS,...j},L=`${C}-field`,h=c.canSubmitPrompt(n,r,o),u=e=>{c.shouldUseInternalDraft(P)&&F(e),p==null||p(e)},w=()=>{const e=n.trim();!h||!e||(a==null||a(e),u(i.EMPTY_STRING))},U=()=>{var e;(e=S.current)==null||e.click()},k=e=>{!e||e.length===0||m==null||m(Array.from(e))},G=o&&!!_,O=E??[];return t.jsxs(R.Box,{id:C,"data-testid":M,className:V.cn("Bear-PromptComposer",N),children:[O.length>0&&t.jsx(g.Flex,{className:"Bear-PromptComposer__files",wrap:"wrap",gap:2,children:O.map(e=>t.jsx(H.PromptComposerFileChip,{file:e,disabled:r,onRemove:B},`${e.name}-${e.size}-${e.lastModified}`))}),t.jsxs(g.Flex,{className:"Bear-PromptComposer__row",align:"end",gap:2,children:[v&&t.jsx(d.Button,{type:"button",variant:"ghost",iconOnly:!0,disabled:r||o,"aria-label":l.attachLabel,onClick:U,children:t.jsx(z.PromptComposerAttachSvg,{})}),t.jsx(R.Box,{className:"Bear-PromptComposer__field",children:t.jsx("textarea",{id:L,className:"Bear-PromptComposer__textarea",value:n,placeholder:I??l.placeholder,disabled:r,rows:2,onChange:e=>u(e.target.value),onKeyDown:e=>c.submitPromptDraft({event:e,disabled:r,isStreaming:o,onSubmit:a,draft:n,clearDraft:()=>u(i.EMPTY_STRING)})})}),G?t.jsx(d.Button,{type:"button",variant:"secondary",iconOnly:!0,"aria-label":l.stopLabel,onClick:_,children:t.jsx(J.PromptComposerStopSvg,{})}):t.jsx(d.Button,{type:"button",variant:"primary",iconOnly:!0,disabled:!h,"aria-label":l.sendLabel,onClick:w,children:t.jsx(K.PromptComposerSendSvg,{})})]}),t.jsx("input",{ref:S,type:"file",hidden:!0,multiple:!0,accept:A,disabled:r||o,onChange:e=>{k(e.target.files),e.target.value=i.EMPTY_STRING}}),q]})};exports.PromptComposer=Q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const O=require("../../constants/generals.const.cjs"),_={placeholder:O.PLACEHOLDER_START_TYPING,sendLabel:O.LABEL_SEND,stopLabel:O.LABEL_STOP,attachLabel:O.LABEL_ATTACH},E=O.BOOLEAN_FALSE,T=O.BOOLEAN_FALSE,A=O.BOOLEAN_FALSE,P=O.EMPTY_STRING;exports.PROMPT_COMPOSER_DEFAULT_ATTACH=A;exports.PROMPT_COMPOSER_DEFAULT_DISABLED=E;exports.PROMPT_COMPOSER_DEFAULT_STREAMING=T;exports.PROMPT_COMPOSER_DEFAULT_TRANSLATIONS=_;exports.PROMPT_COMPOSER_DEFAULT_VALUE=P;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PromptComposerTranslations } from './PromptComposer.types';
|
|
2
|
+
export declare const PROMPT_COMPOSER_DEFAULT_TRANSLATIONS: PromptComposerTranslations;
|
|
3
|
+
export declare const PROMPT_COMPOSER_DEFAULT_DISABLED = false;
|
|
4
|
+
export declare const PROMPT_COMPOSER_DEFAULT_STREAMING = false;
|
|
5
|
+
export declare const PROMPT_COMPOSER_DEFAULT_ATTACH = false;
|
|
6
|
+
export declare const PROMPT_COMPOSER_DEFAULT_VALUE = "";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EMPTY_STRING as E, BOOLEAN_FALSE as T, LABEL_ATTACH as _, LABEL_STOP as A, LABEL_SEND as L, PLACEHOLDER_START_TYPING as O } from "../../constants/generals.const.js";
|
|
2
|
+
const R = {
|
|
3
|
+
placeholder: O,
|
|
4
|
+
sendLabel: L,
|
|
5
|
+
stopLabel: A,
|
|
6
|
+
attachLabel: _
|
|
7
|
+
}, S = T, M = T, o = T, t = E;
|
|
8
|
+
export {
|
|
9
|
+
o as PROMPT_COMPOSER_DEFAULT_ATTACH,
|
|
10
|
+
S as PROMPT_COMPOSER_DEFAULT_DISABLED,
|
|
11
|
+
M as PROMPT_COMPOSER_DEFAULT_STREAMING,
|
|
12
|
+
R as PROMPT_COMPOSER_DEFAULT_TRANSLATIONS,
|
|
13
|
+
t as PROMPT_COMPOSER_DEFAULT_VALUE
|
|
14
|
+
};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsxs as C, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as $, useState as j } from "react";
|
|
3
|
+
import { COMPONENT_NAME_PROMPT_COMPOSER as G, EMPTY_STRING as p } from "../../constants/generals.const.js";
|
|
4
|
+
import { cn as z } from "../../utils/cn.js";
|
|
5
|
+
import { resolveBearId as H } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as K } from "../../utils/useBearId.js";
|
|
7
|
+
import { Box as O } from "../Box/Box.js";
|
|
8
|
+
import { Button as c } from "../Button/Button.js";
|
|
9
|
+
import { Flex as S } from "../Flex/Flex.js";
|
|
10
|
+
import { PROMPT_COMPOSER_DEFAULT_VALUE as Y, PROMPT_COMPOSER_DEFAULT_STREAMING as q, PROMPT_COMPOSER_DEFAULT_DISABLED as J, PROMPT_COMPOSER_DEFAULT_ATTACH as Q, PROMPT_COMPOSER_DEFAULT_TRANSLATIONS as W } from "./PromptComposer.const.js";
|
|
11
|
+
import { canSubmitPrompt as X, submitPromptDraft as Z, resolvePromptDraft as ee, shouldUseInternalDraft as te } from "./PromptComposer.utils.js";
|
|
12
|
+
import { PromptComposerAttachSvg as re } from "./helpers/PromptComposerAttachSvg.js";
|
|
13
|
+
import { PromptComposerFileChip as oe } from "./helpers/PromptComposerFileChip.js";
|
|
14
|
+
import { PromptComposerSendSvg as ae } from "./helpers/PromptComposerSendSvg.js";
|
|
15
|
+
import { PromptComposerStopSvg as le } from "./helpers/PromptComposerStopSvg.js";
|
|
16
|
+
const Re = (R) => {
|
|
17
|
+
const {
|
|
18
|
+
id: T,
|
|
19
|
+
testId: b,
|
|
20
|
+
value: d,
|
|
21
|
+
defaultValue: E = Y,
|
|
22
|
+
onChange: s,
|
|
23
|
+
onSubmit: a,
|
|
24
|
+
onStop: f,
|
|
25
|
+
onAttach: m,
|
|
26
|
+
files: M,
|
|
27
|
+
onFileRemove: A,
|
|
28
|
+
isStreaming: o = q,
|
|
29
|
+
disabled: r = J,
|
|
30
|
+
allowAttach: g = Q,
|
|
31
|
+
accept: v,
|
|
32
|
+
placeholder: D,
|
|
33
|
+
translations: I,
|
|
34
|
+
footer: N,
|
|
35
|
+
className: y
|
|
36
|
+
} = R, B = K(G), P = H(T, B), u = $(null), [F, L] = j(E), l = ee({ value: d }, F), n = { ...W, ...I }, w = `${P}-field`, _ = X(l, r, o), i = (e) => {
|
|
37
|
+
te(d) && L(e), s == null || s(e);
|
|
38
|
+
}, x = () => {
|
|
39
|
+
const e = l.trim();
|
|
40
|
+
!_ || !e || (a == null || a(e), i(p));
|
|
41
|
+
}, U = () => {
|
|
42
|
+
var e;
|
|
43
|
+
(e = u.current) == null || e.click();
|
|
44
|
+
}, k = (e) => {
|
|
45
|
+
!e || e.length === 0 || m == null || m(Array.from(e));
|
|
46
|
+
}, V = o && !!f, h = M ?? [];
|
|
47
|
+
return /* @__PURE__ */ C(O, { id: P, "data-testid": b, className: z("Bear-PromptComposer", y), children: [
|
|
48
|
+
h.length > 0 && /* @__PURE__ */ t(S, { className: "Bear-PromptComposer__files", wrap: "wrap", gap: 2, children: h.map((e) => /* @__PURE__ */ t(
|
|
49
|
+
oe,
|
|
50
|
+
{
|
|
51
|
+
file: e,
|
|
52
|
+
disabled: r,
|
|
53
|
+
onRemove: A
|
|
54
|
+
},
|
|
55
|
+
`${e.name}-${e.size}-${e.lastModified}`
|
|
56
|
+
)) }),
|
|
57
|
+
/* @__PURE__ */ C(S, { className: "Bear-PromptComposer__row", align: "end", gap: 2, children: [
|
|
58
|
+
g && /* @__PURE__ */ t(
|
|
59
|
+
c,
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
variant: "ghost",
|
|
63
|
+
iconOnly: !0,
|
|
64
|
+
disabled: r || o,
|
|
65
|
+
"aria-label": n.attachLabel,
|
|
66
|
+
onClick: U,
|
|
67
|
+
children: /* @__PURE__ */ t(re, {})
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
/* @__PURE__ */ t(O, { className: "Bear-PromptComposer__field", children: /* @__PURE__ */ t(
|
|
71
|
+
"textarea",
|
|
72
|
+
{
|
|
73
|
+
id: w,
|
|
74
|
+
className: "Bear-PromptComposer__textarea",
|
|
75
|
+
value: l,
|
|
76
|
+
placeholder: D ?? n.placeholder,
|
|
77
|
+
disabled: r,
|
|
78
|
+
rows: 2,
|
|
79
|
+
onChange: (e) => i(e.target.value),
|
|
80
|
+
onKeyDown: (e) => Z({
|
|
81
|
+
event: e,
|
|
82
|
+
disabled: r,
|
|
83
|
+
isStreaming: o,
|
|
84
|
+
onSubmit: a,
|
|
85
|
+
draft: l,
|
|
86
|
+
clearDraft: () => i(p)
|
|
87
|
+
})
|
|
88
|
+
}
|
|
89
|
+
) }),
|
|
90
|
+
V ? /* @__PURE__ */ t(
|
|
91
|
+
c,
|
|
92
|
+
{
|
|
93
|
+
type: "button",
|
|
94
|
+
variant: "secondary",
|
|
95
|
+
iconOnly: !0,
|
|
96
|
+
"aria-label": n.stopLabel,
|
|
97
|
+
onClick: f,
|
|
98
|
+
children: /* @__PURE__ */ t(le, {})
|
|
99
|
+
}
|
|
100
|
+
) : /* @__PURE__ */ t(
|
|
101
|
+
c,
|
|
102
|
+
{
|
|
103
|
+
type: "button",
|
|
104
|
+
variant: "primary",
|
|
105
|
+
iconOnly: !0,
|
|
106
|
+
disabled: !_,
|
|
107
|
+
"aria-label": n.sendLabel,
|
|
108
|
+
onClick: x,
|
|
109
|
+
children: /* @__PURE__ */ t(ae, {})
|
|
110
|
+
}
|
|
111
|
+
)
|
|
112
|
+
] }),
|
|
113
|
+
/* @__PURE__ */ t(
|
|
114
|
+
"input",
|
|
115
|
+
{
|
|
116
|
+
ref: u,
|
|
117
|
+
type: "file",
|
|
118
|
+
hidden: !0,
|
|
119
|
+
multiple: !0,
|
|
120
|
+
accept: v,
|
|
121
|
+
disabled: r || o,
|
|
122
|
+
onChange: (e) => {
|
|
123
|
+
k(e.target.files), e.target.value = p;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
N
|
|
128
|
+
] });
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
Re as PromptComposer
|
|
132
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { KeyboardEvent, ReactNode } from 'react';
|
|
2
|
+
export interface PromptComposerTranslations {
|
|
3
|
+
placeholder: string;
|
|
4
|
+
sendLabel: string;
|
|
5
|
+
stopLabel: string;
|
|
6
|
+
attachLabel: string;
|
|
7
|
+
}
|
|
8
|
+
export interface PromptComposerProps {
|
|
9
|
+
id?: string;
|
|
10
|
+
testId?: string;
|
|
11
|
+
value?: string;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
onSubmit?: (value: string) => void;
|
|
15
|
+
onStop?: () => void;
|
|
16
|
+
onAttach?: (files: File[]) => void;
|
|
17
|
+
files?: File[];
|
|
18
|
+
onFileRemove?: (file: File) => void;
|
|
19
|
+
isStreaming?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
allowAttach?: boolean;
|
|
22
|
+
accept?: string;
|
|
23
|
+
placeholder?: string;
|
|
24
|
+
translations?: Partial<PromptComposerTranslations>;
|
|
25
|
+
footer?: ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface PromptComposerFileChipProps {
|
|
29
|
+
file: File;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
onRemove?: (file: File) => void;
|
|
32
|
+
}
|
|
33
|
+
export interface UsePromptComposerValueParams {
|
|
34
|
+
value?: string;
|
|
35
|
+
defaultValue?: string;
|
|
36
|
+
onChange?: (value: string) => void;
|
|
37
|
+
}
|
|
38
|
+
export interface PromptComposerKeyParams {
|
|
39
|
+
event: KeyboardEvent<HTMLTextAreaElement>;
|
|
40
|
+
disabled: boolean;
|
|
41
|
+
isStreaming: boolean;
|
|
42
|
+
onSubmit?: (value: string) => void;
|
|
43
|
+
draft: string;
|
|
44
|
+
clearDraft: () => void;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../constants/generals.const.cjs"),c=require("../../constants/keys.const.cjs"),l=t=>{const{event:r,disabled:e,isStreaming:o,onSubmit:n,draft:a,clearDraft:i}=t;if(r.key!==c.KEY_ENTER||r.shiftKey||e||o)return;r.preventDefault();const s=a.trim();s&&(n==null||n(s),i())},f=(t,r)=>t.value??r,m=t=>t===void 0,d=(t,r,e)=>r||e?u.BOOLEAN_FALSE:t.trim().length>0;exports.canSubmitPrompt=d;exports.resolvePromptDraft=f;exports.shouldUseInternalDraft=m;exports.submitPromptDraft=l;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PromptComposerKeyParams, UsePromptComposerValueParams } from './PromptComposer.types';
|
|
2
|
+
export declare const submitPromptDraft: (params: PromptComposerKeyParams) => void;
|
|
3
|
+
export declare const resolvePromptDraft: (params: UsePromptComposerValueParams, internalValue: string) => string;
|
|
4
|
+
export declare const shouldUseInternalDraft: (value: string | undefined) => value is undefined;
|
|
5
|
+
export declare const canSubmitPrompt: (draft: string, disabled: boolean, isStreaming: boolean) => boolean;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BOOLEAN_FALSE as f } from "../../constants/generals.const.js";
|
|
2
|
+
import { KEY_ENTER as m } from "../../constants/keys.const.js";
|
|
3
|
+
const l = (t) => {
|
|
4
|
+
const { event: r, disabled: e, isStreaming: i, onSubmit: n, draft: s, clearDraft: a } = t;
|
|
5
|
+
if (r.key !== m || r.shiftKey || e || i)
|
|
6
|
+
return;
|
|
7
|
+
r.preventDefault();
|
|
8
|
+
const o = s.trim();
|
|
9
|
+
o && (n == null || n(o), a());
|
|
10
|
+
}, p = (t, r) => t.value ?? r, d = (t) => t === void 0, v = (t, r, e) => r || e ? f : t.trim().length > 0;
|
|
11
|
+
export {
|
|
12
|
+
v as canSubmitPrompt,
|
|
13
|
+
p as resolvePromptDraft,
|
|
14
|
+
d as shouldUseInternalDraft,
|
|
15
|
+
l as submitPromptDraft
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../../constants/numbers.const.cjs"),o=()=>e.jsx("svg",{width:t.EIGHTEEN,height:t.EIGHTEEN,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48"})});exports.PromptComposerAttachSvg=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PromptComposerAttachSvg: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { EIGHTEEN as r } from "../../../constants/numbers.const.js";
|
|
3
|
+
const i = () => /* @__PURE__ */ o("svg", { width: r, height: r, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ o("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48" }) });
|
|
4
|
+
export {
|
|
5
|
+
i as PromptComposerAttachSvg
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),s=require("../../Chip/Chip.cjs"),n=i=>{const{file:e,disabled:t,onRemove:o}=i;return r.jsx(s.Chip,{size:"sm",variant:"soft",disabled:t,onDelete:o?()=>o(e):void 0,children:e.name})};exports.PromptComposerFileChip=n;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Chip as m } from "../../Chip/Chip.js";
|
|
3
|
+
const p = (i) => {
|
|
4
|
+
const { file: o, disabled: r, onRemove: e } = i;
|
|
5
|
+
return /* @__PURE__ */ t(
|
|
6
|
+
m,
|
|
7
|
+
{
|
|
8
|
+
size: "sm",
|
|
9
|
+
variant: "soft",
|
|
10
|
+
disabled: r,
|
|
11
|
+
onDelete: e ? () => e(o) : void 0,
|
|
12
|
+
children: o.name
|
|
13
|
+
}
|
|
14
|
+
);
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
p as PromptComposerFileChip
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=require("../../../constants/numbers.const.cjs"),r=()=>e.jsxs("svg",{width:o.EIGHTEEN,height:o.EIGHTEEN,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("path",{d:"M22 2L11 13"}),e.jsx("path",{d:"M22 2L15 22L11 13L2 9L22 2Z"})]});exports.PromptComposerSendSvg=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PromptComposerSendSvg: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { EIGHTEEN as r } from "../../../constants/numbers.const.js";
|
|
3
|
+
const n = () => /* @__PURE__ */ e("svg", { width: r, height: r, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
4
|
+
/* @__PURE__ */ o("path", { d: "M22 2L11 13" }),
|
|
5
|
+
/* @__PURE__ */ o("path", { d: "M22 2L15 22L11 13L2 9L22 2Z" })
|
|
6
|
+
] });
|
|
7
|
+
export {
|
|
8
|
+
n as PromptComposerSendSvg
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../../constants/numbers.const.cjs"),r=()=>e.jsx("svg",{width:t.EIGHTEEN,height:t.EIGHTEEN,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})});exports.PromptComposerStopSvg=r;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PromptComposerStopSvg: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { EIGHTEEN as o } from "../../../constants/numbers.const.js";
|
|
3
|
+
const e = () => /* @__PURE__ */ r("svg", { width: o, height: o, viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ r("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }) });
|
|
4
|
+
export {
|
|
5
|
+
e as PromptComposerStopSvg
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),t=require("../../constants/generals.const.cjs"),p=require("../../utils/cn.cjs");require("react");const I=require("../../utils/generateBearId.utils.cjs"),q=require("../../utils/useBearId.cjs"),S=require("../Chip/Chip.cjs"),N=require("../Flex/Flex.cjs"),P=i=>{const{id:n,testId:d,suggestions:o,selectedId:a,onSelect:r,className:c}=i,l=q.useBearId(t.COMPONENT_NAME_PROMPT_SUGGESTIONS),u=I.resolveBearId(n,l);return s.jsx(N.Flex,{id:u,testId:d,className:p.cn("Bear-PromptSuggestions",c),wrap:"wrap",gap:2,children:o.map(e=>{const m=e.id===a;return s.jsx(S.Chip,{size:"sm",variant:m?t.VARIANT_FILLED:"outlined",color:"primary",disabled:e.disabled,onClick:()=>r==null?void 0:r(e.id),children:e.label},e.id)})})};exports.PromptSuggestions=P;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { COMPONENT_NAME_PROMPT_SUGGESTIONS as n, VARIANT_FILLED as I } from "../../constants/generals.const.js";
|
|
3
|
+
import { cn as f } from "../../utils/cn.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { resolveBearId as N } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as P } from "../../utils/useBearId.js";
|
|
7
|
+
import { Chip as S } from "../Chip/Chip.js";
|
|
8
|
+
import { Flex as E } from "../Flex/Flex.js";
|
|
9
|
+
const B = (i) => {
|
|
10
|
+
const { id: m, testId: t, suggestions: d, selectedId: a, onSelect: o, className: s } = i, p = P(n), l = N(m, p);
|
|
11
|
+
return /* @__PURE__ */ e(
|
|
12
|
+
E,
|
|
13
|
+
{
|
|
14
|
+
id: l,
|
|
15
|
+
testId: t,
|
|
16
|
+
className: f("Bear-PromptSuggestions", s),
|
|
17
|
+
wrap: "wrap",
|
|
18
|
+
gap: 2,
|
|
19
|
+
children: d.map((r) => {
|
|
20
|
+
const c = r.id === a;
|
|
21
|
+
return /* @__PURE__ */ e(
|
|
22
|
+
S,
|
|
23
|
+
{
|
|
24
|
+
size: "sm",
|
|
25
|
+
variant: c ? I : "outlined",
|
|
26
|
+
color: "primary",
|
|
27
|
+
disabled: r.disabled,
|
|
28
|
+
onClick: () => o == null ? void 0 : o(r.id),
|
|
29
|
+
children: r.label
|
|
30
|
+
},
|
|
31
|
+
r.id
|
|
32
|
+
);
|
|
33
|
+
})
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
B as PromptSuggestions
|
|
39
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PromptSuggestionItem {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface PromptSuggestionsProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
testId?: string;
|
|
9
|
+
suggestions: PromptSuggestionItem[];
|
|
10
|
+
selectedId?: string;
|
|
11
|
+
onSelect?: (id: string) => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../../constants/numbers.const.cjs"),n=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../../constants/numbers.const.cjs"),n=require("@forgedevstack/bear-icons/editor"),s={bold:e.jsx(n.BoldIcon,{size:i.SIXTEEN}),italic:e.jsx(n.ItalicIcon,{size:i.SIXTEEN}),underline:e.jsx(n.UnderlineIcon,{size:i.SIXTEEN}),strikethrough:e.jsx(n.StrikethroughIcon,{size:i.SIXTEEN}),heading1:e.jsx(n.Heading1Icon,{size:i.SIXTEEN}),heading2:e.jsx(n.Heading2Icon,{size:i.SIXTEEN}),heading3:e.jsx(n.Heading3Icon,{size:i.SIXTEEN}),bulletList:e.jsx(n.ListBulletIcon,{size:i.SIXTEEN}),orderedList:e.jsx(n.ListNumberedIcon,{size:i.SIXTEEN}),blockquote:e.jsx(n.QuoteIcon,{size:i.SIXTEEN}),code:e.jsx(n.CodeIcon,{size:i.SIXTEEN}),link:e.jsx(n.InsertLinkIcon,{size:i.SIXTEEN}),alignLeft:e.jsx(n.AlignLeftIcon,{size:i.SIXTEEN}),alignCenter:e.jsx(n.AlignCenterIcon,{size:i.SIXTEEN}),alignRight:e.jsx(n.AlignRightIcon,{size:i.SIXTEEN}),alignJustify:e.jsx(n.AlignJustifyIcon,{size:i.SIXTEEN}),image:e.jsx(n.InsertPhotoIcon,{size:i.SIXTEEN}),indent:e.jsx(n.IndentIncreaseIcon,{size:i.SIXTEEN}),outdent:e.jsx(n.IndentDecreaseIcon,{size:i.SIXTEEN}),clearFormat:e.jsx(n.FormatClearIcon,{size:i.SIXTEEN}),table:e.jsx(n.TableIcon,{size:i.SIXTEEN})};exports.RICH_EDITOR_ICONS=s;
|