@forgedevstack/bear 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/components/ApprovalCard/ApprovalCard.cjs +1 -0
- package/dist/components/ApprovalCard/ApprovalCard.const.cjs +1 -0
- package/dist/components/ApprovalCard/ApprovalCard.const.d.ts +2 -0
- package/dist/components/ApprovalCard/ApprovalCard.const.js +8 -0
- package/dist/components/ApprovalCard/ApprovalCard.d.ts +2 -0
- package/dist/components/ApprovalCard/ApprovalCard.js +25 -0
- package/dist/components/ApprovalCard/ApprovalCard.types.d.ts +15 -0
- package/dist/components/ApprovalCard/index.d.ts +2 -0
- package/dist/components/ArtifactCard/ArtifactCard.cjs +1 -0
- package/dist/components/ArtifactCard/ArtifactCard.const.cjs +1 -0
- package/dist/components/ArtifactCard/ArtifactCard.const.d.ts +3 -0
- package/dist/components/ArtifactCard/ArtifactCard.const.js +8 -0
- package/dist/components/ArtifactCard/ArtifactCard.d.ts +2 -0
- package/dist/components/ArtifactCard/ArtifactCard.js +43 -0
- package/dist/components/ArtifactCard/ArtifactCard.types.d.ts +15 -0
- package/dist/components/ArtifactCard/index.d.ts +2 -0
- package/dist/components/Banner/Banner.const.cjs +1 -1
- package/dist/components/Banner/Banner.const.js +9 -8
- package/dist/components/Chart/BarChart.cjs +1 -1
- package/dist/components/Chart/BarChart.js +65 -72
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.js +21 -18
- package/dist/components/Chart/Chart.types.d.ts +1 -1
- package/dist/components/Chart/FunnelChart.cjs +1 -1
- package/dist/components/Chart/FunnelChart.js +38 -36
- package/dist/components/Chart/LineChart.cjs +1 -1
- package/dist/components/Chart/LineChart.js +74 -60
- package/dist/components/Chart/PieChart.cjs +1 -1
- package/dist/components/Chart/PieChart.js +102 -82
- package/dist/components/Chart/RadarChart.cjs +1 -1
- package/dist/components/Chart/RadarChart.d.ts +1 -1
- package/dist/components/Chart/RadarChart.js +116 -93
- package/dist/components/Chat/Chat.cjs +1 -1
- package/dist/components/Chat/Chat.const.cjs +1 -1
- package/dist/components/Chat/Chat.const.d.ts +9 -22
- package/dist/components/Chat/Chat.const.js +18 -26
- package/dist/components/Chat/Chat.d.ts +1 -20
- package/dist/components/Chat/Chat.js +107 -162
- package/dist/components/Chat/Chat.types.d.ts +20 -27
- package/dist/components/Chat/Chat.utils.cjs +1 -0
- package/dist/components/Chat/Chat.utils.d.ts +2 -0
- package/dist/components/Chat/Chat.utils.js +10 -0
- package/dist/components/Chat/helpers/ChatTypingIndicator.cjs +1 -0
- package/dist/components/Chat/helpers/ChatTypingIndicator.d.ts +3 -0
- package/dist/components/Chat/helpers/ChatTypingIndicator.js +14 -0
- package/dist/components/Chat/index.d.ts +2 -1
- package/dist/components/ChatBubble/ChatBubble.cjs +1 -0
- package/dist/components/ChatBubble/ChatBubble.const.cjs +1 -0
- package/dist/components/ChatBubble/ChatBubble.const.d.ts +13 -0
- package/dist/components/ChatBubble/ChatBubble.const.js +17 -0
- package/dist/components/ChatBubble/ChatBubble.d.ts +2 -0
- package/dist/components/ChatBubble/ChatBubble.js +32 -0
- package/dist/components/ChatBubble/ChatBubble.types.d.ts +12 -0
- package/dist/components/ChatBubble/ChatBubble.utils.cjs +1 -0
- package/dist/components/ChatBubble/ChatBubble.utils.d.ts +6 -0
- package/dist/components/ChatBubble/ChatBubble.utils.js +15 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleSystem.cjs +1 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleSystem.d.ts +2 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleSystem.js +21 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleThread.cjs +1 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleThread.d.ts +4 -0
- package/dist/components/ChatBubble/helpers/ChatBubbleThread.js +63 -0
- package/dist/components/ChatBubble/index.d.ts +2 -0
- package/dist/components/ChatError/ChatError.cjs +1 -0
- package/dist/components/ChatError/ChatError.const.cjs +1 -0
- package/dist/components/ChatError/ChatError.const.d.ts +2 -0
- package/dist/components/ChatError/ChatError.const.js +8 -0
- package/dist/components/ChatError/ChatError.d.ts +2 -0
- package/dist/components/ChatError/ChatError.js +32 -0
- package/dist/components/ChatError/ChatError.types.d.ts +14 -0
- package/dist/components/ChatError/index.d.ts +2 -0
- package/dist/components/CitationList/CitationList.cjs +1 -0
- package/dist/components/CitationList/CitationList.d.ts +2 -0
- package/dist/components/CitationList/CitationList.js +30 -0
- package/dist/components/CitationList/CitationList.types.d.ts +15 -0
- package/dist/components/CitationList/helpers/CitationListTitle.cjs +1 -0
- package/dist/components/CitationList/helpers/CitationListTitle.d.ts +2 -0
- package/dist/components/CitationList/helpers/CitationListTitle.js +10 -0
- package/dist/components/CitationList/helpers/index.d.ts +1 -0
- package/dist/components/CitationList/index.d.ts +2 -0
- package/dist/components/ContextMeter/ContextMeter.cjs +1 -0
- package/dist/components/ContextMeter/ContextMeter.const.cjs +1 -0
- package/dist/components/ContextMeter/ContextMeter.const.d.ts +6 -0
- package/dist/components/ContextMeter/ContextMeter.const.js +11 -0
- package/dist/components/ContextMeter/ContextMeter.d.ts +2 -0
- package/dist/components/ContextMeter/ContextMeter.js +49 -0
- package/dist/components/ContextMeter/ContextMeter.types.d.ts +11 -0
- package/dist/components/ContextMeter/ContextMeter.utils.cjs +1 -0
- package/dist/components/ContextMeter/ContextMeter.utils.d.ts +2 -0
- package/dist/components/ContextMeter/ContextMeter.utils.js +12 -0
- package/dist/components/ContextMeter/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.const.cjs +1 -1
- package/dist/components/Drawer/Drawer.const.d.ts +2 -1
- package/dist/components/Drawer/Drawer.const.js +7 -6
- package/dist/components/Drawer/Drawer.d.ts +1 -1
- package/dist/components/Drawer/Drawer.js +93 -83
- package/dist/components/Drawer/Drawer.types.d.ts +4 -1
- package/dist/components/Drawer/hooks/useDrawer.cjs +1 -1
- package/dist/components/Drawer/hooks/useDrawer.js +33 -34
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.const.d.ts +8 -6
- package/dist/components/EmptyState/EmptyState.const.js +15 -8
- package/dist/components/EmptyState/EmptyState.d.ts +1 -2
- package/dist/components/EmptyState/EmptyState.js +39 -43
- package/dist/components/EmptyState/EmptyState.types.d.ts +2 -0
- package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.cjs +1 -0
- package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.d.ts +3 -0
- package/dist/components/EmptyState/helpers/EmptyStateErrorSvg.js +8 -0
- package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.cjs +1 -0
- package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.d.ts +3 -0
- package/dist/components/EmptyState/helpers/EmptyStateInboxSvg.js +8 -0
- package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.cjs +1 -0
- package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.d.ts +3 -0
- package/dist/components/EmptyState/helpers/EmptyStateSearchSvg.js +8 -0
- package/dist/components/EmptyState/helpers/index.d.ts +3 -0
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/FloatingChat/FloatingChat.cjs +1 -1
- package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -1
- package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -1
- package/dist/components/FloatingChat/FloatingChat.const.js +25 -7
- package/dist/components/FloatingChat/FloatingChat.d.ts +1 -18
- package/dist/components/FloatingChat/FloatingChat.js +93 -124
- package/dist/components/FloatingChat/FloatingChat.types.d.ts +11 -22
- package/dist/components/FloatingChat/FloatingChat.utils.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.utils.d.ts +2 -0
- package/dist/components/FloatingChat/FloatingChat.utils.js +12 -0
- package/dist/components/FloatingChat/helpers/FloatingChatHeader.cjs +1 -0
- package/dist/components/FloatingChat/helpers/FloatingChatHeader.d.ts +9 -0
- package/dist/components/FloatingChat/helpers/FloatingChatHeader.js +21 -0
- package/dist/components/FloatingChat/helpers/FloatingChatTrigger.cjs +1 -0
- package/dist/components/FloatingChat/helpers/FloatingChatTrigger.d.ts +9 -0
- package/dist/components/FloatingChat/helpers/FloatingChatTrigger.js +17 -0
- package/dist/components/FloatingChat/index.d.ts +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.cjs +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.d.ts +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.js +35 -24
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/productIcons.cjs +1 -0
- package/dist/components/Icon/productIcons.d.ts +7 -0
- package/dist/components/Icon/productIcons.js +25 -0
- package/dist/components/MessageActions/MessageActions.cjs +1 -0
- package/dist/components/MessageActions/MessageActions.const.cjs +1 -0
- package/dist/components/MessageActions/MessageActions.const.d.ts +2 -0
- package/dist/components/MessageActions/MessageActions.const.js +10 -0
- package/dist/components/MessageActions/MessageActions.d.ts +2 -0
- package/dist/components/MessageActions/MessageActions.js +31 -0
- package/dist/components/MessageActions/MessageActions.types.d.ts +16 -0
- package/dist/components/MessageActions/index.d.ts +2 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.js +1 -1
- package/dist/components/ModelSelect/ModelSelect.cjs +1 -0
- package/dist/components/ModelSelect/ModelSelect.const.cjs +1 -0
- package/dist/components/ModelSelect/ModelSelect.const.d.ts +1 -0
- package/dist/components/ModelSelect/ModelSelect.const.js +4 -0
- package/dist/components/ModelSelect/ModelSelect.d.ts +2 -0
- package/dist/components/ModelSelect/ModelSelect.js +41 -0
- package/dist/components/ModelSelect/ModelSelect.types.d.ts +16 -0
- package/dist/components/ModelSelect/index.d.ts +2 -0
- package/dist/components/OverlayPortal/OverlayPortal.const.cjs +1 -1
- package/dist/components/OverlayPortal/OverlayPortal.const.js +6 -5
- package/dist/components/PasswordInput/PasswordInput.cjs +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +5 -5
- package/dist/components/PromptComposer/PromptComposer.cjs +1 -0
- package/dist/components/PromptComposer/PromptComposer.const.cjs +1 -0
- package/dist/components/PromptComposer/PromptComposer.const.d.ts +6 -0
- package/dist/components/PromptComposer/PromptComposer.const.js +14 -0
- package/dist/components/PromptComposer/PromptComposer.d.ts +2 -0
- package/dist/components/PromptComposer/PromptComposer.js +132 -0
- package/dist/components/PromptComposer/PromptComposer.types.d.ts +45 -0
- package/dist/components/PromptComposer/PromptComposer.utils.cjs +1 -0
- package/dist/components/PromptComposer/PromptComposer.utils.d.ts +5 -0
- package/dist/components/PromptComposer/PromptComposer.utils.js +16 -0
- package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.d.ts +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerAttachSvg.js +6 -0
- package/dist/components/PromptComposer/helpers/PromptComposerFileChip.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerFileChip.d.ts +2 -0
- package/dist/components/PromptComposer/helpers/PromptComposerFileChip.js +18 -0
- package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.d.ts +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerSendSvg.js +9 -0
- package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.cjs +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.d.ts +1 -0
- package/dist/components/PromptComposer/helpers/PromptComposerStopSvg.js +6 -0
- package/dist/components/PromptComposer/helpers/index.d.ts +4 -0
- package/dist/components/PromptComposer/index.d.ts +2 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.cjs +1 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.d.ts +2 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.js +39 -0
- package/dist/components/PromptSuggestions/PromptSuggestions.types.d.ts +13 -0
- package/dist/components/PromptSuggestions/index.d.ts +2 -0
- package/dist/components/RichEditor/helpers/IconRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/IconRender.js +16 -16
- package/dist/components/RichEditor/helpers/toolbarItemRender.cjs +1 -1
- package/dist/components/RichEditor/helpers/toolbarItemRender.js +23 -23
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +23 -23
- package/dist/components/Select/helpers/SelectCheckSvg.cjs +1 -0
- package/dist/components/Select/helpers/SelectCheckSvg.d.ts +3 -0
- package/dist/components/Select/helpers/SelectCheckSvg.js +8 -0
- package/dist/components/Select/helpers/SelectChevronDownSvg.cjs +1 -0
- package/dist/components/Select/helpers/SelectChevronDownSvg.d.ts +3 -0
- package/dist/components/Select/helpers/SelectChevronDownSvg.js +8 -0
- package/dist/components/Select/helpers/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.const.cjs +2 -2
- package/dist/components/Skeleton/Skeleton.const.js +5 -6
- package/dist/components/Skeleton/Skeleton.js +59 -59
- package/dist/components/StatCard/StatCard.cjs +1 -1
- package/dist/components/StatCard/StatCard.const.cjs +1 -1
- package/dist/components/StatCard/StatCard.const.d.ts +0 -7
- package/dist/components/StatCard/StatCard.const.js +5 -12
- package/dist/components/StatCard/StatCard.d.ts +1 -2
- package/dist/components/StatCard/StatCard.js +48 -37
- package/dist/components/StatCard/StatCard.utils.cjs +1 -0
- package/dist/components/StatCard/StatCard.utils.d.ts +2 -0
- package/dist/components/StatCard/StatCard.utils.js +7 -0
- package/dist/components/StreamingMessage/StreamingMessage.cjs +1 -0
- package/dist/components/StreamingMessage/StreamingMessage.const.cjs +1 -0
- package/dist/components/StreamingMessage/StreamingMessage.const.d.ts +5 -0
- package/dist/components/StreamingMessage/StreamingMessage.const.js +10 -0
- package/dist/components/StreamingMessage/StreamingMessage.d.ts +2 -0
- package/dist/components/StreamingMessage/StreamingMessage.js +48 -0
- package/dist/components/StreamingMessage/StreamingMessage.types.d.ts +15 -0
- package/dist/components/StreamingMessage/index.d.ts +2 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.cjs +1 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.const.cjs +1 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.const.d.ts +7 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.const.js +14 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.d.ts +2 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.js +39 -0
- package/dist/components/ThemeSwitcher/ThemeSwitcher.types.d.ts +14 -0
- package/dist/components/ThemeSwitcher/index.d.ts +2 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.cjs +1 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.const.cjs +1 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.const.d.ts +4 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.const.js +9 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.d.ts +2 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.js +45 -0
- package/dist/components/ThinkingBlock/ThinkingBlock.types.d.ts +16 -0
- package/dist/components/ThinkingBlock/index.d.ts +2 -0
- package/dist/components/ToolCall/ToolCall.cjs +1 -0
- package/dist/components/ToolCall/ToolCall.const.cjs +1 -0
- package/dist/components/ToolCall/ToolCall.const.d.ts +5 -0
- package/dist/components/ToolCall/ToolCall.const.js +17 -0
- package/dist/components/ToolCall/ToolCall.d.ts +2 -0
- package/dist/components/ToolCall/ToolCall.js +43 -0
- package/dist/components/ToolCall/ToolCall.types.d.ts +20 -0
- package/dist/components/ToolCall/index.d.ts +2 -0
- package/dist/components/Transition/Transition.const.cjs +1 -1
- package/dist/components/Transition/Transition.const.js +12 -6
- package/dist/components/Transition/Transition.types.d.ts +1 -1
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +37 -9
- package/dist/components/index.js +455 -423
- package/dist/constants/generals.const.cjs +1 -1
- package/dist/constants/generals.const.d.ts +46 -0
- package/dist/constants/generals.const.js +158 -115
- package/dist/constants/keys.const.cjs +1 -1
- package/dist/constants/keys.const.js +2 -1
- package/dist/constants/numbers.const.cjs +1 -1
- package/dist/constants/numbers.const.d.ts +7 -0
- package/dist/constants/numbers.const.js +60 -52
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +19 -44
- package/dist/context/BearProvider.js +223 -208
- package/dist/context/bearProvider.types.d.ts +4 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/hooks/useFixedAnchorPosition/index.d.ts +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs +1 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.d.ts +2 -1
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js +12 -11
- package/dist/hooks/useFixedAnchorPosition/useFixedAnchorPosition.types.d.ts +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +595 -563
- package/dist/styles/_ai-chat.css +487 -0
- package/dist/styles/_base.css +2 -0
- package/dist/styles/_chart.css +144 -0
- package/dist/styles/_effects.css +8 -4
- package/dist/styles/_skeleton.css +90 -0
- package/dist/styles/main.css +3 -0
- package/dist/styles.css +734 -32
- package/package.json +1 -1
- package/dist/components/FormSkeleton/FormSkeleton.const.cjs +0 -1
- package/dist/components/FormSkeleton/FormSkeleton.const.d.ts +0 -5
- package/dist/components/FormSkeleton/FormSkeleton.const.js +0 -8
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.const.js +0 -14
- package/dist/node_modules/@forgedevstack/bear-icons/dist/Icon.js +0 -35
- package/dist/node_modules/@forgedevstack/bear-icons/dist/action.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/action.js +0 -26
- package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/cn.utils.js +0 -4
- package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/editor.js +0 -130
- package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/misc.js +0 -12
- package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/navigation.js +0 -18
- package/dist/node_modules/@forgedevstack/bear-icons/dist/status.cjs +0 -1
- package/dist/node_modules/@forgedevstack/bear-icons/dist/status.js +0 -6
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Strong, reliable React UI components. AeroCraft-powered, zero config required. The protective force of ForgeStack.
|
|
4
4
|
|
|
5
|
+
[](https://ko-fi.com/forgestack)
|
|
6
|
+
|
|
7
|
+
Sponsor Bear on [Ko-fi](https://ko-fi.com/forgestack).
|
|
8
|
+
|
|
5
9
|
## Portal
|
|
6
10
|
|
|
7
11
|
Visit the [Bear UI Portal](https://bearui.com/) to explore all components, view live examples, and browse the documentation.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),y=require("../../constants/generals.const.cjs"),g=require("../../utils/cn.cjs");require("react");const j=require("../../utils/generateBearId.utils.cjs"),q=require("../../utils/useBearId.cjs"),h=require("../Box/Box.cjs"),o=require("../Button/Button.cjs"),a=require("../Flex/Flex.cjs"),i=require("../Typography/Typography.cjs"),B=require("./ApprovalCard.const.cjs"),b=c=>{const{id:l,testId:d,title:u,children:r,onApprove:t,onReject:n,translations:p,className:A}=c,x=q.useBearId(y.COMPONENT_NAME_APPROVAL_CARD),v=j.resolveBearId(l,x),s={...B.APPROVAL_CARD_DEFAULT_TRANSLATIONS,...p};return e.jsx(h.Box,{id:v,"data-testid":d,className:g.cn("Bear-ApprovalCard",A),children:e.jsxs(a.Flex,{direction:"column",gap:3,align:"start",children:[e.jsx(i.Typography,{variant:"subtitle1",children:u}),r&&e.jsx(i.Typography,{variant:"body2",children:r}),e.jsxs(a.Flex,{gap:2,children:[n&&e.jsx(o.Button,{type:"button",variant:"outline",size:"sm",onClick:n,children:s.rejectLabel}),t&&e.jsx(o.Button,{type:"button",variant:"primary",size:"sm",onClick:t,children:s.approveLabel})]})]})})};exports.ApprovalCard=b;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/generals.const.cjs"),A={approveLabel:e.LABEL_APPROVE,rejectLabel:e.LABEL_REJECT};exports.APPROVAL_CARD_DEFAULT_TRANSLATIONS=A;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as r, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { COMPONENT_NAME_APPROVAL_CARD as u } from "../../constants/generals.const.js";
|
|
3
|
+
import { cn as b } from "../../utils/cn.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { resolveBearId as C } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as N } from "../../utils/useBearId.js";
|
|
7
|
+
import { Box as y } from "../Box/Box.js";
|
|
8
|
+
import { Button as n } from "../Button/Button.js";
|
|
9
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
10
|
+
import { Typography as p } from "../Typography/Typography.js";
|
|
11
|
+
import { APPROVAL_CARD_DEFAULT_TRANSLATIONS as I } from "./ApprovalCard.const.js";
|
|
12
|
+
const E = (l) => {
|
|
13
|
+
const { id: s, testId: d, title: c, children: t, onApprove: o, onReject: e, translations: A, className: f } = l, v = N(u), h = C(s, v), i = { ...I, ...A };
|
|
14
|
+
return /* @__PURE__ */ r(y, { id: h, "data-testid": d, className: b("Bear-ApprovalCard", f), children: /* @__PURE__ */ a(m, { direction: "column", gap: 3, align: "start", children: [
|
|
15
|
+
/* @__PURE__ */ r(p, { variant: "subtitle1", children: c }),
|
|
16
|
+
t && /* @__PURE__ */ r(p, { variant: "body2", children: t }),
|
|
17
|
+
/* @__PURE__ */ a(m, { gap: 2, children: [
|
|
18
|
+
e && /* @__PURE__ */ r(n, { type: "button", variant: "outline", size: "sm", onClick: e, children: i.rejectLabel }),
|
|
19
|
+
o && /* @__PURE__ */ r(n, { type: "button", variant: "primary", size: "sm", onClick: o, children: i.approveLabel })
|
|
20
|
+
] })
|
|
21
|
+
] }) });
|
|
22
|
+
};
|
|
23
|
+
export {
|
|
24
|
+
E as ApprovalCard
|
|
25
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ApprovalCardTranslations {
|
|
3
|
+
approveLabel: string;
|
|
4
|
+
rejectLabel: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ApprovalCardProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
testId?: string;
|
|
9
|
+
title: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
onApprove?: () => void;
|
|
12
|
+
onReject?: () => void;
|
|
13
|
+
translations?: Partial<ApprovalCardTranslations>;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),T=require("../../constants/generals.const.cjs"),_=require("../../utils/cn.cjs");require("react");const g=require("../../utils/generateBearId.utils.cjs"),q=require("../../utils/useBearId.cjs"),x=require("../Badge/Badge.cjs"),n=require("../Box/Box.cjs"),I=require("../Button/Button.cjs"),h=require("../Flex/Flex.cjs"),j=require("../Typography/Typography.cjs"),a=require("./ArtifactCard.const.cjs"),p=i=>{const{id:c,testId:o,title:d,kind:r=a.ARTIFACT_CARD_DEFAULT_KIND,children:t,onOpen:s,translations:l,className:u}=i,A=q.useBearId(T.COMPONENT_NAME_ARTIFACT_CARD),B=g.resolveBearId(c,A),C={...a.ARTIFACT_CARD_DEFAULT_TRANSLATIONS,...l};return e.jsxs(n.Box,{id:B,"data-testid":o,className:_.cn("Bear-ArtifactCard",`Bear-ArtifactCard--${r}`,u),children:[e.jsxs(h.Flex,{align:"center",justify:"between",gap:2,children:[e.jsx(j.Typography,{variant:"subtitle2",children:d}),e.jsx(x.Badge,{size:"sm",children:r})]}),t&&e.jsx(n.Box,{className:"Bear-ArtifactCard__body",children:t}),s&&e.jsx(I.Button,{type:"button",variant:"ghost",size:"sm",onClick:s,children:C.openLabel})]})};exports.ArtifactCard=p;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("../../constants/generals.const.cjs"),T={openLabel:A.LABEL_OPEN_ARTIFACT},_="doc";exports.ARTIFACT_CARD_DEFAULT_KIND=_;exports.ARTIFACT_CARD_DEFAULT_TRANSLATIONS=T;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { COMPONENT_NAME_ARTIFACT_CARD as C } from "../../constants/generals.const.js";
|
|
3
|
+
import { cn as T } from "../../utils/cn.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import { resolveBearId as _ } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as I } from "../../utils/useBearId.js";
|
|
7
|
+
import { Badge as N } from "../Badge/Badge.js";
|
|
8
|
+
import { Box as a } from "../Box/Box.js";
|
|
9
|
+
import { Button as h } from "../Button/Button.js";
|
|
10
|
+
import { Flex as B } from "../Flex/Flex.js";
|
|
11
|
+
import { Typography as R } from "../Typography/Typography.js";
|
|
12
|
+
import { ARTIFACT_CARD_DEFAULT_KIND as b, ARTIFACT_CARD_DEFAULT_TRANSLATIONS as g } from "./ArtifactCard.const.js";
|
|
13
|
+
const M = (m) => {
|
|
14
|
+
const {
|
|
15
|
+
id: n,
|
|
16
|
+
testId: s,
|
|
17
|
+
title: d,
|
|
18
|
+
kind: t = b,
|
|
19
|
+
children: o,
|
|
20
|
+
onOpen: e,
|
|
21
|
+
translations: c,
|
|
22
|
+
className: l
|
|
23
|
+
} = m, p = I(C), A = _(n, p), f = { ...g, ...c };
|
|
24
|
+
return /* @__PURE__ */ i(
|
|
25
|
+
a,
|
|
26
|
+
{
|
|
27
|
+
id: A,
|
|
28
|
+
"data-testid": s,
|
|
29
|
+
className: T("Bear-ArtifactCard", `Bear-ArtifactCard--${t}`, l),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ i(B, { align: "center", justify: "between", gap: 2, children: [
|
|
32
|
+
/* @__PURE__ */ r(R, { variant: "subtitle2", children: d }),
|
|
33
|
+
/* @__PURE__ */ r(N, { size: "sm", children: t })
|
|
34
|
+
] }),
|
|
35
|
+
o && /* @__PURE__ */ r(a, { className: "Bear-ArtifactCard__body", children: o }),
|
|
36
|
+
e && /* @__PURE__ */ r(h, { type: "button", variant: "ghost", size: "sm", onClick: e, children: f.openLabel })
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
export {
|
|
42
|
+
M as ArtifactCard
|
|
43
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ArtifactCardKind = 'code' | 'doc' | 'preview';
|
|
3
|
+
export interface ArtifactCardTranslations {
|
|
4
|
+
openLabel: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ArtifactCardProps {
|
|
7
|
+
id?: string;
|
|
8
|
+
testId?: string;
|
|
9
|
+
title: string;
|
|
10
|
+
kind?: ArtifactCardKind;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
onOpen?: () => void;
|
|
13
|
+
translations?: Partial<ArtifactCardTranslations>;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/generals.const.cjs"),r=require("@forgedevstack/bear-icons")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../constants/generals.const.cjs"),r=require("@forgedevstack/bear-icons");require("react/jsx-runtime");const a={dismissLabel:e.LABEL_DISMISS},n={info:r.InfoIcon,success:r.CheckCircleIcon,warning:r.WarningIcon,error:r.ErrorIcon},b={static:"",sticky:"bear-sticky bear-top-0 bear-z-40"},s={info:"bear-bg-[var(--bear-info-50,#eff6ff)] bear-text-[var(--bear-info-800,#1e40af)]",success:"bear-bg-[var(--bear-success-50,#f0fdf4)] bear-text-[var(--bear-success-800,#166534)]",warning:"bear-bg-[var(--bear-warning-50,#fffbeb)] bear-text-[var(--bear-warning-800,#92400e)]",error:"bear-bg-[var(--bear-danger-50,#fef2f2)] bear-text-[var(--bear-danger-800,#991b1b)]"};exports.BANNER_DEFAULT_ICON_MAP=n;exports.BANNER_DEFAULT_TRANSLATIONS=a;exports.BANNER_POSITION_CLASSES=b;exports.BANNER_SEVERITY_CLASSES=s;
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { LABEL_DISMISS as r } from "../../constants/generals.const.js";
|
|
2
2
|
import { ErrorIcon as e, WarningIcon as a, CheckCircleIcon as b, InfoIcon as n } from "@forgedevstack/bear-icons";
|
|
3
|
-
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
const f = {
|
|
4
5
|
dismissLabel: r
|
|
5
|
-
},
|
|
6
|
+
}, t = {
|
|
6
7
|
info: n,
|
|
7
8
|
success: b,
|
|
8
9
|
warning: a,
|
|
9
10
|
error: e
|
|
10
|
-
},
|
|
11
|
+
}, i = {
|
|
11
12
|
static: "",
|
|
12
13
|
sticky: "bear-sticky bear-top-0 bear-z-40"
|
|
13
|
-
},
|
|
14
|
+
}, S = {
|
|
14
15
|
info: "bear-bg-[var(--bear-info-50,#eff6ff)] bear-text-[var(--bear-info-800,#1e40af)]",
|
|
15
16
|
success: "bear-bg-[var(--bear-success-50,#f0fdf4)] bear-text-[var(--bear-success-800,#166534)]",
|
|
16
17
|
warning: "bear-bg-[var(--bear-warning-50,#fffbeb)] bear-text-[var(--bear-warning-800,#92400e)]",
|
|
17
18
|
error: "bear-bg-[var(--bear-danger-50,#fef2f2)] bear-text-[var(--bear-danger-800,#991b1b)]"
|
|
18
19
|
};
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
t as BANNER_DEFAULT_ICON_MAP,
|
|
22
|
+
f as BANNER_DEFAULT_TRANSLATIONS,
|
|
23
|
+
i as BANNER_POSITION_CLASSES,
|
|
24
|
+
S as BANNER_SEVERITY_CLASSES
|
|
24
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("../../constants/numbers.const.cjs"),p=require("../../utils/cn.cjs");require("react");const V=require("../../utils/generateBearId.utils.cjs"),w=require("../../utils/useBearId.cjs"),c=require("./Chart.const.cjs"),x=require("./Chart.utils.cjs"),z=g=>{const{data:i,height:m=c.CHART.DEFAULT_HEIGHT,showLabels:h=!0,showValues:v=!1,animated:R=!0,color:$,orientation:b="vertical",barRadius:r=c.CHART.DEFAULT_BAR_RADIUS,barGap:A=c.CHART.DEFAULT_BAR_GAP,stacked:l=!1,className:E,id:N,testId:j,...T}=g,O=w.useBearId("BarChart"),k=V.resolveBearId(N,O),d=i.map(a=>x.getStackTotal(a.stacks,a.value)),q=Math.max(...d,s.ONE),t=b==="vertical",y={"--Bear-Chart-height":`${m}px`,"--Bear-Chart-gap":`${A}rem`};return e.jsx("div",{id:k,"data-testid":j,className:p.cn("Bear-Chart Bear-Chart--bar",t?"Bear-Chart--vertical":"Bear-Chart--horizontal",E),style:y,...T,children:e.jsx("div",{className:"Bear-Chart__track",children:i.map((a,u)=>{const C=l&&a.stacks&&a.stacks.length>s.ZERO?a.stacks:[a.value],o=d[u],I={"--Bear-Chart-size":`${o/q*c.CHART.VIEWBOX}%`};return e.jsxs("div",{className:"Bear-Chart__col",children:[h&&!t&&e.jsx("span",{className:"Bear-Chart__label",children:a.label}),e.jsx("div",{className:"Bear-Chart__plot",children:e.jsx("div",{className:p.cn("Bear-Chart__stack",R&&(t?"animate-grow-up":"animate-grow-right")),style:I,children:C.map((H,n)=>{const S=o>s.ZERO?H/o*c.CHART.VIEWBOX:s.ZERO,L=n===s.ZERO,B=n===C.length-s.ONE,_=l?t?B?`${r}px ${r}px 0 0`:"0":B?`0 ${r}px ${r}px 0`:"0":t?`${r}px ${r}px 0 0`:`0 ${r}px ${r}px 0`,P={"--Bear-Chart-segment":`${S}%`,"--Bear-Chart-color":x.getChartColor(l?n:u,a.color||$),"--Bear-Chart-radius":_};return e.jsx("div",{className:"Bear-Chart__segment",style:P},`${a.label}-${n}`)})})}),v&&e.jsx("span",{className:"Bear-Chart__value",children:o}),h&&t&&e.jsx("span",{className:"Bear-Chart__label",children:a.label})]},a.label)})})})};exports.BarChart=z;
|
|
@@ -1,85 +1,78 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { ONE as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsx as t, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { ONE as _, ZERO as h } from "../../constants/numbers.const.js";
|
|
3
|
+
import { cn as u } from "../../utils/cn.js";
|
|
4
4
|
import "react";
|
|
5
|
+
import { resolveBearId as O } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as P } from "../../utils/useBearId.js";
|
|
5
7
|
import { CHART as s } from "./Chart.const.js";
|
|
6
|
-
import { getStackTotal as
|
|
7
|
-
const
|
|
8
|
+
import { getStackTotal as U, getChartColor as G } from "./Chart.utils.js";
|
|
9
|
+
const Q = ($) => {
|
|
8
10
|
const {
|
|
9
11
|
data: n,
|
|
10
|
-
height:
|
|
11
|
-
showLabels:
|
|
12
|
+
height: g = s.DEFAULT_HEIGHT,
|
|
13
|
+
showLabels: i = !0,
|
|
12
14
|
showValues: v = !1,
|
|
13
15
|
animated: N = !0,
|
|
14
|
-
color:
|
|
15
|
-
orientation:
|
|
16
|
+
color: b,
|
|
17
|
+
orientation: x = "vertical",
|
|
16
18
|
barRadius: r = s.DEFAULT_BAR_RADIUS,
|
|
17
|
-
barGap:
|
|
18
|
-
stacked:
|
|
19
|
-
className:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
barGap: f = s.DEFAULT_BAR_GAP,
|
|
20
|
+
stacked: l = !1,
|
|
21
|
+
className: k,
|
|
22
|
+
id: A,
|
|
23
|
+
testId: E,
|
|
24
|
+
...y
|
|
25
|
+
} = $, I = P("BarChart"), R = O(A, I), m = n.map((a) => U(a.stacks, a.value)), T = Math.max(...m, _), e = x === "vertical", L = {
|
|
26
|
+
"--Bear-Chart-height": `${g}px`,
|
|
27
|
+
"--Bear-Chart-gap": `${f}rem`
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ t(
|
|
23
30
|
"div",
|
|
24
31
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
`${a.label}-${o}`
|
|
67
|
-
);
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
),
|
|
73
|
-
v && /* @__PURE__ */ t("span", { className: "bear-text-xs bear-text-gray-500 dark:bear-text-slate-400", children: c }),
|
|
74
|
-
x && e && /* @__PURE__ */ t("span", { className: "bear-max-w-full bear-truncate bear-text-xs bear-text-gray-600 dark:bear-text-slate-300", children: a.label })
|
|
75
|
-
]
|
|
76
|
-
},
|
|
77
|
-
a.label
|
|
78
|
-
);
|
|
79
|
-
})
|
|
32
|
+
id: R,
|
|
33
|
+
"data-testid": E,
|
|
34
|
+
className: u(
|
|
35
|
+
"Bear-Chart Bear-Chart--bar",
|
|
36
|
+
e ? "Bear-Chart--vertical" : "Bear-Chart--horizontal",
|
|
37
|
+
k
|
|
38
|
+
),
|
|
39
|
+
style: L,
|
|
40
|
+
...y,
|
|
41
|
+
children: /* @__PURE__ */ t("div", { className: "Bear-Chart__track", children: n.map((a, p) => {
|
|
42
|
+
const d = l && a.stacks && a.stacks.length > h ? a.stacks : [a.value], o = m[p], S = {
|
|
43
|
+
"--Bear-Chart-size": `${o / T * s.VIEWBOX}%`
|
|
44
|
+
};
|
|
45
|
+
return /* @__PURE__ */ F("div", { className: "Bear-Chart__col", children: [
|
|
46
|
+
i && !e && /* @__PURE__ */ t("span", { className: "Bear-Chart__label", children: a.label }),
|
|
47
|
+
/* @__PURE__ */ t("div", { className: "Bear-Chart__plot", children: /* @__PURE__ */ t(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
className: u("Bear-Chart__stack", N && (e ? "animate-grow-up" : "animate-grow-right")),
|
|
51
|
+
style: S,
|
|
52
|
+
children: d.map((V, c) => {
|
|
53
|
+
const w = o > h ? V / o * s.VIEWBOX : h, z = c === h, B = c === d.length - _, C = l ? e ? B ? `${r}px ${r}px 0 0` : "0" : B ? `0 ${r}px ${r}px 0` : "0" : e ? `${r}px ${r}px 0 0` : `0 ${r}px ${r}px 0`, D = {
|
|
54
|
+
"--Bear-Chart-segment": `${w}%`,
|
|
55
|
+
"--Bear-Chart-color": G(l ? c : p, a.color || b),
|
|
56
|
+
"--Bear-Chart-radius": C
|
|
57
|
+
};
|
|
58
|
+
return /* @__PURE__ */ t(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: "Bear-Chart__segment",
|
|
62
|
+
style: D
|
|
63
|
+
},
|
|
64
|
+
`${a.label}-${c}`
|
|
65
|
+
);
|
|
66
|
+
})
|
|
67
|
+
}
|
|
68
|
+
) }),
|
|
69
|
+
v && /* @__PURE__ */ t("span", { className: "Bear-Chart__value", children: o }),
|
|
70
|
+
i && e && /* @__PURE__ */ t("span", { className: "Bear-Chart__label", children: a.label })
|
|
71
|
+
] }, a.label);
|
|
72
|
+
}) })
|
|
80
73
|
}
|
|
81
|
-
)
|
|
74
|
+
);
|
|
82
75
|
};
|
|
83
76
|
export {
|
|
84
|
-
|
|
77
|
+
Q as BarChart
|
|
85
78
|
};
|
|
@@ -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");require("react");const A=require("../../utils/generateBearId.utils.cjs"),c=require("../../utils/useBearId.cjs"),a=require("./BarChart.cjs"),s=require("./LineChart.cjs"),n=require("./PieChart.cjs"),E=require("./RadarChart.cjs"),d=require("./FunnelChart.cjs"),e=require("./Chart.const.cjs"),C={[e.CHART_TYPES.BAR]:r=>t.jsx(a.BarChart,{...r}),[e.CHART_TYPES.STACKED]:r=>t.jsx(a.BarChart,{...r,stacked:!0}),[e.CHART_TYPES.LINE]:r=>t.jsx(s.LineChart,{...r}),[e.CHART_TYPES.AREA]:r=>t.jsx(s.LineChart,{...r,fill:!0}),[e.CHART_TYPES.PIE]:r=>t.jsx(n.PieChart,{...r}),[e.CHART_TYPES.DONUT]:r=>t.jsx(n.PieChart,{...r,innerRadius:e.CHART.DEFAULT_INNER_RADIUS}),[e.CHART_TYPES.RADAR]:r=>t.jsx(E.RadarChart,{...r}),[e.CHART_TYPES.FUNNEL]:r=>t.jsx(d.FunnelChart,{...r})},h=r=>{const{type:R=e.CHART_TYPES.BAR,id:i,...T}=r,o=c.useBearId("Chart"),u=A.resolveBearId(i,o);return(C[R]??C[e.CHART_TYPES.BAR])({...T,id:u})};exports.Chart=h;
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
2
|
+
import "react";
|
|
3
|
+
import { resolveBearId as s } from "../../utils/generateBearId.utils.js";
|
|
4
|
+
import { useBearId as C } from "../../utils/useBearId.js";
|
|
5
|
+
import { BarChart as e } from "./BarChart.js";
|
|
6
|
+
import { LineChart as m } from "./LineChart.js";
|
|
7
|
+
import { PieChart as i } from "./PieChart.js";
|
|
8
|
+
import { RadarChart as E } from "./RadarChart.js";
|
|
9
|
+
import { FunnelChart as f } from "./FunnelChart.js";
|
|
10
|
+
import { CHART_TYPES as t, CHART as c } from "./Chart.const.js";
|
|
8
11
|
const a = {
|
|
9
|
-
[t.BAR]: (r) => /* @__PURE__ */ o(
|
|
10
|
-
[t.STACKED]: (r) => /* @__PURE__ */ o(
|
|
11
|
-
[t.LINE]: (r) => /* @__PURE__ */ o(
|
|
12
|
-
[t.AREA]: (r) => /* @__PURE__ */ o(
|
|
13
|
-
[t.PIE]: (r) => /* @__PURE__ */ o(
|
|
14
|
-
[t.DONUT]: (r) => /* @__PURE__ */ o(
|
|
15
|
-
[t.RADAR]: (r) => /* @__PURE__ */ o(
|
|
16
|
-
[t.FUNNEL]: (r) => /* @__PURE__ */ o(
|
|
17
|
-
},
|
|
18
|
-
const { type:
|
|
19
|
-
return (a[
|
|
12
|
+
[t.BAR]: (r) => /* @__PURE__ */ o(e, { ...r }),
|
|
13
|
+
[t.STACKED]: (r) => /* @__PURE__ */ o(e, { ...r, stacked: !0 }),
|
|
14
|
+
[t.LINE]: (r) => /* @__PURE__ */ o(m, { ...r }),
|
|
15
|
+
[t.AREA]: (r) => /* @__PURE__ */ o(m, { ...r, fill: !0 }),
|
|
16
|
+
[t.PIE]: (r) => /* @__PURE__ */ o(i, { ...r }),
|
|
17
|
+
[t.DONUT]: (r) => /* @__PURE__ */ o(i, { ...r, innerRadius: c.DEFAULT_INNER_RADIUS }),
|
|
18
|
+
[t.RADAR]: (r) => /* @__PURE__ */ o(E, { ...r }),
|
|
19
|
+
[t.FUNNEL]: (r) => /* @__PURE__ */ o(f, { ...r })
|
|
20
|
+
}, U = (r) => {
|
|
21
|
+
const { type: R = t.BAR, id: n, ...d } = r, p = C("Chart"), A = s(n, p);
|
|
22
|
+
return (a[R] ?? a[t.BAR])({ ...d, id: A });
|
|
20
23
|
};
|
|
21
24
|
export {
|
|
22
|
-
|
|
25
|
+
U as Chart
|
|
23
26
|
};
|
|
@@ -10,7 +10,7 @@ export interface ChartDataPoint {
|
|
|
10
10
|
}
|
|
11
11
|
export interface ChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
12
12
|
testId?: string;
|
|
13
|
-
type
|
|
13
|
+
type?: ChartType;
|
|
14
14
|
data: ChartDataPoint[];
|
|
15
15
|
height?: number;
|
|
16
16
|
showLabels?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("../../constants/numbers.const.cjs"),s=require("../../utils/cn.cjs");require("react");const N=require("../../utils/generateBearId.utils.cjs"),_=require("../../utils/useBearId.cjs"),b=require("../Box/Box.cjs"),o=require("../Flex/Flex.cjs"),F=require("../Typography/Typography.cjs"),t=require("./Chart.const.cjs"),j=require("./Chart.utils.cjs"),E=l=>{const{data:a,height:c=t.CHART.DEFAULT_HEIGHT,showLabels:u=!0,showValues:i=!0,animated:h=!0,color:d,className:C,id:g,testId:m,...x}=l,B=_.useBearId("FunnelChart"),p=N.resolveBearId(g,B),I=Math.max(...a.map(e=>e.value),n.ONE),q={"--Bear-Chart-height":`${c}px`};return r.jsx(o.Flex,{id:p,"data-testid":m,direction:"column",gap:1,justify:"center",className:s.cn("Bear-Chart Bear-Chart--funnel",C),style:q,...x,children:a.map((e,y)=>{const T={"--Bear-Chart-size":`${Math.max(e.value/I*t.CHART.VIEWBOX,t.CHART.FUNNEL_MIN_WIDTH)}%`,"--Bear-Chart-step-height":`${t.CHART.VIEWBOX/Math.max(a.length,n.ONE)/2}%`,"--Bear-Chart-color":j.getChartColor(y,e.color||d)};return r.jsxs(o.Flex,{direction:"column",align:"center",gap:1,className:"bear-w-full",children:[r.jsx(b.Box,{className:s.cn("Bear-Chart__funnel-step bear-rounded-md",h&&"animate-grow-right"),style:T}),u&&r.jsxs(F.Typography,{variant:"caption",color:"muted",children:[e.label,i?` · ${e.value}`:""]})]},e.label)})})};exports.FunnelChart=E;
|
|
@@ -1,51 +1,53 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
2
2
|
import { ONE as l } from "../../constants/numbers.const.js";
|
|
3
3
|
import { cn as n } from "../../utils/cn.js";
|
|
4
4
|
import "react";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
5
|
+
import { resolveBearId as E } from "../../utils/generateBearId.utils.js";
|
|
6
|
+
import { useBearId as b } from "../../utils/useBearId.js";
|
|
7
|
+
import { Box as v } from "../Box/Box.js";
|
|
8
|
+
import { Flex as s } from "../Flex/Flex.js";
|
|
9
|
+
import { Typography as F } from "../Typography/Typography.js";
|
|
10
|
+
import { CHART as t } from "./Chart.const.js";
|
|
11
|
+
import { getChartColor as T } from "./Chart.utils.js";
|
|
12
|
+
const S = (m) => {
|
|
11
13
|
const {
|
|
12
|
-
data:
|
|
13
|
-
height: i =
|
|
14
|
-
showLabels:
|
|
14
|
+
data: e,
|
|
15
|
+
height: i = t.DEFAULT_HEIGHT,
|
|
16
|
+
showLabels: c = !0,
|
|
15
17
|
showValues: h = !0,
|
|
16
|
-
animated:
|
|
18
|
+
animated: d = !0,
|
|
17
19
|
color: p,
|
|
18
|
-
className:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
className: u,
|
|
21
|
+
id: f,
|
|
22
|
+
testId: g,
|
|
23
|
+
...B
|
|
24
|
+
} = m, C = b("FunnelChart"), x = E(f, C), I = Math.max(...e.map((r) => r.value), l), N = { "--Bear-Chart-height": `${i}px` };
|
|
25
|
+
return /* @__PURE__ */ a(
|
|
26
|
+
s,
|
|
23
27
|
{
|
|
28
|
+
id: x,
|
|
29
|
+
"data-testid": g,
|
|
24
30
|
direction: "column",
|
|
25
31
|
gap: 1,
|
|
26
32
|
justify: "center",
|
|
27
|
-
className: n("Bear-Chart Bear-Chart--funnel
|
|
28
|
-
style:
|
|
29
|
-
...
|
|
30
|
-
children:
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
className: n("Bear-Chart Bear-Chart--funnel", u),
|
|
34
|
+
style: N,
|
|
35
|
+
...B,
|
|
36
|
+
children: e.map((r, y) => {
|
|
37
|
+
const w = {
|
|
38
|
+
"--Bear-Chart-size": `${Math.max(r.value / I * t.VIEWBOX, t.FUNNEL_MIN_WIDTH)}%`,
|
|
39
|
+
"--Bear-Chart-step-height": `${t.VIEWBOX / Math.max(e.length, l) / 2}%`,
|
|
40
|
+
"--Bear-Chart-color": T(y, r.color || p)
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ o(s, { direction: "column", align: "center", gap: 1, className: "bear-w-full", children: [
|
|
43
|
+
/* @__PURE__ */ a(
|
|
44
|
+
v,
|
|
35
45
|
{
|
|
36
|
-
className: n(
|
|
37
|
-
|
|
38
|
-
u && "animate-grow-right"
|
|
39
|
-
),
|
|
40
|
-
style: {
|
|
41
|
-
width: `${x}%`,
|
|
42
|
-
height: `${a.VIEWBOX / Math.max(t.length, l) / 2}%`,
|
|
43
|
-
minHeight: a.FUNNEL_MIN_WIDTH,
|
|
44
|
-
backgroundColor: C
|
|
45
|
-
}
|
|
46
|
+
className: n("Bear-Chart__funnel-step bear-rounded-md", d && "animate-grow-right"),
|
|
47
|
+
style: w
|
|
46
48
|
}
|
|
47
49
|
),
|
|
48
|
-
|
|
50
|
+
c && /* @__PURE__ */ o(F, { variant: "caption", color: "muted", children: [
|
|
49
51
|
r.label,
|
|
50
52
|
h ? ` · ${r.value}` : ""
|
|
51
53
|
] })
|
|
@@ -55,5 +57,5 @@ const L = (c) => {
|
|
|
55
57
|
);
|
|
56
58
|
};
|
|
57
59
|
export {
|
|
58
|
-
|
|
60
|
+
S as FunnelChart
|
|
59
61
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../constants/numbers.const.cjs"),r=require("../../utils/cn.cjs");require("react");const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("../../constants/numbers.const.cjs"),r=require("../../utils/cn.cjs");require("react");const O=require("../../utils/generateBearId.utils.cjs"),b=require("../../utils/useBearId.cjs"),t=require("./Chart.const.cjs"),C=require("./Chart.utils.cjs"),$=I=>{const{data:n,height:T=t.CHART.DEFAULT_HEIGHT,showLabels:x=!0,showDots:B=!0,smooth:j=!0,fill:_=!1,stepped:d=!1,strokeWidth:f=t.CHART.DEFAULT_STROKE_WIDTH,color:a="var(--bear-primary-500, #ec4899)",animated:i=!0,className:y,id:R,testId:g,...A}=I,L=b.useBearId("LineChart"),h=O.resolveBearId(R,L),u=`${h}-gradient`,o=C.calculateLinePoints(n),p=C.generateLinePath(o,j&&!d,d),E=o.length===c.ZERO?"":`${p} L ${t.CHART.VIEWBOX},${t.CHART.VIEWBOX} L 0,${t.CHART.VIEWBOX} Z`,H={"--Bear-Chart-height":`${T}px`};return e.jsxs("div",{id:h,"data-testid":g,className:r.cn("Bear-Chart Bear-Chart--line",y),style:H,...A,children:[e.jsxs("svg",{viewBox:`0 0 ${t.CHART.VIEWBOX} ${t.CHART.VIEWBOX}`,preserveAspectRatio:"none",className:"Bear-Chart__svg",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:u,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[e.jsx("stop",{offset:"0%",stopColor:a,stopOpacity:"0.3"}),e.jsx("stop",{offset:"100%",stopColor:a,stopOpacity:"0"})]})}),_&&e.jsx("path",{d:E,fill:`url(#${u})`,className:r.cn(i&&"animate-fade-in")}),e.jsx("path",{d:p,fill:"none",stroke:a,strokeWidth:f/c.TEN,strokeLinecap:"round",strokeLinejoin:"round",className:r.cn(i&&"animate-draw-line")}),B&&o.map((s,l)=>{var m;return e.jsx("circle",{cx:s.x,cy:s.y,r:t.CHART.DOT_RADIUS,fill:a,className:r.cn(i&&"animate-scale-in"),style:{animationDelay:`${l*c.FIFTY}ms`}},((m=n[l])==null?void 0:m.label)??l)})]}),x&&e.jsx("div",{className:"Bear-Chart__labels",children:n.map(s=>e.jsx("span",{className:"Bear-Chart__label",children:s.label},s.label))})]})};exports.LineChart=$;
|