@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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ZERO as e } from "../../constants/numbers.const.js";
|
|
2
|
+
import { CONTEXT_METER_PERCENT_CAP as E, CONTEXT_METER_DANGER_PERCENT as o, CONTEXT_METER_WARN_PERCENT as T } from "./ContextMeter.const.js";
|
|
3
|
+
const _ = (r, n) => {
|
|
4
|
+
if (n <= e)
|
|
5
|
+
return e;
|
|
6
|
+
const t = r / n * E;
|
|
7
|
+
return t < e ? e : t > E ? E : t;
|
|
8
|
+
}, N = (r) => r >= o ? "danger" : r >= T ? "warn" : "ok";
|
|
9
|
+
export {
|
|
10
|
+
_ as resolveContextMeterPercent,
|
|
11
|
+
N as resolveContextMeterTone
|
|
12
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),U=require("react-dom"),C=require("../../context/BearProvider.cjs"),R=require("../../utils/cn.cjs");require("react");const j=require("../../utils/generateBearId.utils.cjs"),W=require("../../utils/useBearId.cjs"),e=require("../../constants/generals.const.cjs"),g=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),$=require("../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.cjs"),V=require("../Backdrop/Backdrop.cjs"),l=require("../Box/Box.cjs"),t=require("./Drawer.const.cjs"),H=require("./helpers/DrawerOptionalHeader.cjs"),Y=require("./hooks/useDrawer.cjs"),z=d=>{const{isOpen:p,onClose:a,title:s,children:N,side:w=t.DRAWER_DEFAULT_SIDE,anchor:T,variant:c=t.DRAWER_DEFAULT_VARIANT,size:L=t.DRAWER_DEFAULT_SIZE,showCloseButton:E=e.BOOLEAN_TRUE,closeOnBackdrop:m=e.BOOLEAN_TRUE,closeOnEscape:q=e.BOOLEAN_TRUE,className:I,container:f,id:x,testId:F}=d,r=c===e.DRAWER_VARIANT_PERMANENT,n=c===e.DRAWER_VARIANT_TEMPORARY,{openEffect:_,closeEffect:u}=$.resolveOverlayEffects(d,g.OVERLAY_OPEN_EFFECT_DEFAULT),P=W.useBearId(e.COMPONENT_NAME_DRAWER),A=j.resolveBearId(x,P),{direction:h}=C.useBearDirectionOptional(),B=T??w,{isMounted:v,isPanelOpen:i}=Y.useDrawer({isOpen:r?e.BOOLEAN_TRUE:p,onClose:a,closeOnEscape:r?e.BOOLEAN_FALSE:q,openEffect:_,closeEffect:u,lockScroll:n,alwaysMounted:r}),y=i?_:u;if(!v)return null;const M=!!s||E,O=`${A}-title`,S=m&&n?()=>a():void 0,b=s?O:void 0,k=r?"complementary":"dialog",D=o.jsxs(l.Box,{id:A,"data-testid":F,className:R.cn("Bear-Drawer",`Bear-Drawer--${c}`),children:[n&&o.jsx(V.Backdrop,{open:i,keepMounted:!0,blur:!0,nested:!0,transitionDuration:t.DRAWER_ANIMATION_MS,className:"Bear-Drawer__backdrop",onClick:S}),o.jsxs(l.Box,{role:k,"aria-modal":n?e.BOOLEAN_TRUE:e.BOOLEAN_FALSE,"aria-labelledby":b,className:R.cn("Bear-Drawer__panel",`Bear-Drawer__panel--${B}`,`Bear-Drawer__panel--${L}`,`Bear-Drawer__panel--effect-${y}`,i&&"Bear-Drawer__panel--open",I),children:[o.jsx(H.DrawerOptionalHeader,{showHeader:M,side:B,title:s,titleId:O,showCloseButton:r?e.BOOLEAN_FALSE:E,onClose:a,direction:h}),o.jsx(l.Box,{className:"Bear-Drawer__body",children:N})]})]});return r?D:U.createPortal(D,f??document.body)};exports.Drawer=z;
|
|
@@ -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("../../constants/numbers.const.cjs"),A=require("../../constants/generals.const.cjs"),E=R.THREE_HUNDRED,_=A.POSITION_RIGHT,D=A.SIZE_MD,T=A.DRAWER_VARIANT_TEMPORARY;exports.DRAWER_ANIMATION_MS=E;exports.DRAWER_DEFAULT_SIDE=_;exports.DRAWER_DEFAULT_SIZE=D;exports.DRAWER_DEFAULT_VARIANT=T;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DrawerProps } from './Drawer.types';
|
|
1
|
+
import { DrawerProps, DrawerVariant } from './Drawer.types';
|
|
2
2
|
export declare const DRAWER_ANIMATION_MS = 300;
|
|
3
3
|
export declare const DRAWER_DEFAULT_SIDE: NonNullable<DrawerProps['side']>;
|
|
4
4
|
export declare const DRAWER_DEFAULT_SIZE: NonNullable<DrawerProps['size']>;
|
|
5
|
+
export declare const DRAWER_DEFAULT_VARIANT: DrawerVariant;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { THREE_HUNDRED as
|
|
2
|
-
import { POSITION_RIGHT as
|
|
3
|
-
const
|
|
1
|
+
import { THREE_HUNDRED as R } from "../../constants/numbers.const.js";
|
|
2
|
+
import { POSITION_RIGHT as A, DRAWER_VARIANT_TEMPORARY as E, SIZE_MD as _ } from "../../constants/generals.const.js";
|
|
3
|
+
const T = R, o = A, t = _, N = E;
|
|
4
4
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
t as DRAWER_DEFAULT_SIZE
|
|
5
|
+
T as DRAWER_ANIMATION_MS,
|
|
6
|
+
o as DRAWER_DEFAULT_SIDE,
|
|
7
|
+
t as DRAWER_DEFAULT_SIZE,
|
|
8
|
+
N as DRAWER_DEFAULT_VARIANT
|
|
8
9
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DrawerProps } from './Drawer.types';
|
|
2
|
-
export declare const Drawer: (props: DrawerProps) => import(
|
|
2
|
+
export declare const Drawer: (props: DrawerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,91 +1,101 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import { useBearDirectionOptional as
|
|
4
|
-
import { cn as
|
|
1
|
+
import { jsxs as R, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal as $ } from "react-dom";
|
|
3
|
+
import { useBearDirectionOptional as x } from "../../context/BearProvider.js";
|
|
4
|
+
import { cn as B } from "../../utils/cn.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { resolveBearId as
|
|
7
|
-
import { useBearId as
|
|
8
|
-
import { BOOLEAN_TRUE as
|
|
9
|
-
import { OVERLAY_OPEN_EFFECT_DEFAULT as
|
|
10
|
-
import { resolveOverlayEffects as
|
|
11
|
-
import { Backdrop as
|
|
12
|
-
import { Box as
|
|
13
|
-
import { DRAWER_DEFAULT_SIDE as
|
|
14
|
-
import { DrawerOptionalHeader as
|
|
15
|
-
import { useDrawer as
|
|
16
|
-
const
|
|
6
|
+
import { resolveBearId as V } from "../../utils/generateBearId.utils.js";
|
|
7
|
+
import { useBearId as g } from "../../utils/useBearId.js";
|
|
8
|
+
import { BOOLEAN_TRUE as r, COMPONENT_NAME_DRAWER as j, BOOLEAN_FALSE as l, DRAWER_VARIANT_TEMPORARY as H, DRAWER_VARIANT_PERMANENT as Y } from "../../constants/generals.const.js";
|
|
9
|
+
import { OVERLAY_OPEN_EFFECT_DEFAULT as z } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
|
|
10
|
+
import { resolveOverlayEffects as Z } from "../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.utils.js";
|
|
11
|
+
import { Backdrop as q } from "../Backdrop/Backdrop.js";
|
|
12
|
+
import { Box as c } from "../Box/Box.js";
|
|
13
|
+
import { DRAWER_DEFAULT_SIDE as G, DRAWER_DEFAULT_VARIANT as J, DRAWER_DEFAULT_SIZE as K, DRAWER_ANIMATION_MS as Q } from "./Drawer.const.js";
|
|
14
|
+
import { DrawerOptionalHeader as X } from "./helpers/DrawerOptionalHeader.js";
|
|
15
|
+
import { useDrawer as ee } from "./hooks/useDrawer.js";
|
|
16
|
+
const Ae = (d) => {
|
|
17
17
|
const {
|
|
18
|
-
isOpen:
|
|
19
|
-
onClose:
|
|
20
|
-
title:
|
|
21
|
-
children:
|
|
22
|
-
side:
|
|
23
|
-
anchor:
|
|
24
|
-
variant:
|
|
25
|
-
size:
|
|
26
|
-
showCloseButton:
|
|
27
|
-
closeOnBackdrop:
|
|
28
|
-
closeOnEscape:
|
|
29
|
-
className:
|
|
30
|
-
container:
|
|
31
|
-
id:
|
|
32
|
-
testId:
|
|
33
|
-
} =
|
|
34
|
-
isOpen:
|
|
35
|
-
onClose:
|
|
36
|
-
closeOnEscape:
|
|
37
|
-
openEffect:
|
|
38
|
-
closeEffect:
|
|
39
|
-
|
|
18
|
+
isOpen: O,
|
|
19
|
+
onClose: t,
|
|
20
|
+
title: a,
|
|
21
|
+
children: u,
|
|
22
|
+
side: N = G,
|
|
23
|
+
anchor: w,
|
|
24
|
+
variant: n = J,
|
|
25
|
+
size: T = K,
|
|
26
|
+
showCloseButton: m = r,
|
|
27
|
+
closeOnBackdrop: I = r,
|
|
28
|
+
closeOnEscape: M = r,
|
|
29
|
+
className: h,
|
|
30
|
+
container: k,
|
|
31
|
+
id: v,
|
|
32
|
+
testId: y
|
|
33
|
+
} = d, e = n === Y, o = n === H, { openEffect: p, closeEffect: _ } = Z(d, z), C = g(j), E = V(v, C), { direction: L } = x(), f = w ?? N, { isMounted: b, isPanelOpen: s } = ee({
|
|
34
|
+
isOpen: e ? r : O,
|
|
35
|
+
onClose: t,
|
|
36
|
+
closeOnEscape: e ? l : M,
|
|
37
|
+
openEffect: p,
|
|
38
|
+
closeEffect: _,
|
|
39
|
+
lockScroll: o,
|
|
40
|
+
alwaysMounted: e
|
|
41
|
+
}), F = s ? p : _;
|
|
40
42
|
if (!b)
|
|
41
43
|
return null;
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"aria-labelledby": o ? p : void 0,
|
|
61
|
-
className: F(
|
|
62
|
-
"Bear-Drawer__panel",
|
|
63
|
-
`Bear-Drawer__panel--${m}`,
|
|
64
|
-
`Bear-Drawer__panel--${u}`,
|
|
65
|
-
`Bear-Drawer__panel--effect-${h}`,
|
|
66
|
-
a && "Bear-Drawer__panel--open",
|
|
67
|
-
A
|
|
44
|
+
const P = !!a || m, A = `${E}-title`, W = I && o ? () => t() : void 0, S = a ? A : void 0, U = e ? "complementary" : "dialog", D = /* @__PURE__ */ R(
|
|
45
|
+
c,
|
|
46
|
+
{
|
|
47
|
+
id: E,
|
|
48
|
+
"data-testid": y,
|
|
49
|
+
className: B("Bear-Drawer", `Bear-Drawer--${n}`),
|
|
50
|
+
children: [
|
|
51
|
+
o && /* @__PURE__ */ i(
|
|
52
|
+
q,
|
|
53
|
+
{
|
|
54
|
+
open: s,
|
|
55
|
+
keepMounted: !0,
|
|
56
|
+
blur: !0,
|
|
57
|
+
nested: !0,
|
|
58
|
+
transitionDuration: Q,
|
|
59
|
+
className: "Bear-Drawer__backdrop",
|
|
60
|
+
onClick: W
|
|
61
|
+
}
|
|
68
62
|
),
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
63
|
+
/* @__PURE__ */ R(
|
|
64
|
+
c,
|
|
65
|
+
{
|
|
66
|
+
role: U,
|
|
67
|
+
"aria-modal": o ? r : l,
|
|
68
|
+
"aria-labelledby": S,
|
|
69
|
+
className: B(
|
|
70
|
+
"Bear-Drawer__panel",
|
|
71
|
+
`Bear-Drawer__panel--${f}`,
|
|
72
|
+
`Bear-Drawer__panel--${T}`,
|
|
73
|
+
`Bear-Drawer__panel--effect-${F}`,
|
|
74
|
+
s && "Bear-Drawer__panel--open",
|
|
75
|
+
h
|
|
76
|
+
),
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ i(
|
|
79
|
+
X,
|
|
80
|
+
{
|
|
81
|
+
showHeader: P,
|
|
82
|
+
side: f,
|
|
83
|
+
title: a,
|
|
84
|
+
titleId: A,
|
|
85
|
+
showCloseButton: e ? l : m,
|
|
86
|
+
onClose: t,
|
|
87
|
+
direction: L
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ i(c, { className: "Bear-Drawer__body", children: u })
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
return e ? D : $(D, k ?? document.body);
|
|
88
98
|
};
|
|
89
99
|
export {
|
|
90
|
-
|
|
100
|
+
Ae as Drawer
|
|
91
101
|
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { OverlayEffectProps, OverlayMotionEffect } from '../../hooks/useFixedAnchorPosition';
|
|
3
3
|
export type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
|
|
4
|
+
export type DrawerVariant = 'temporary' | 'persistent' | 'permanent';
|
|
4
5
|
export interface UseDrawerParams {
|
|
5
6
|
isOpen: boolean;
|
|
6
7
|
onClose: () => void;
|
|
7
8
|
closeOnEscape: boolean;
|
|
8
9
|
openEffect: OverlayMotionEffect;
|
|
9
10
|
closeEffect: OverlayMotionEffect;
|
|
11
|
+
lockScroll: boolean;
|
|
12
|
+
alwaysMounted: boolean;
|
|
10
13
|
}
|
|
11
14
|
export interface UseDrawerResult {
|
|
12
15
|
isMounted: boolean;
|
|
@@ -19,7 +22,7 @@ export interface DrawerProps extends OverlayEffectProps {
|
|
|
19
22
|
children: ReactNode;
|
|
20
23
|
side?: DrawerSide;
|
|
21
24
|
anchor?: DrawerSide;
|
|
22
|
-
variant?:
|
|
25
|
+
variant?: DrawerVariant;
|
|
23
26
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
24
27
|
showCloseButton?: boolean;
|
|
25
28
|
closeOnBackdrop?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),B=require("../../../constants/numbers.const.cjs"),e=require("../../../constants/generals.const.cjs"),F=require("../../../constants/keys.const.cjs"),l=require("../../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.cjs"),m=require("../Drawer.const.cjs"),R=require("../Drawer.utils.cjs"),T=N=>{const{isOpen:o,onClose:a,closeOnEscape:E,openEffect:A,closeEffect:_,lockScroll:L,alwaysMounted:r}=N,[s,i]=n.useState(o||r),[d,c]=n.useState(e.BOOLEAN_FALSE),[f,O]=n.useState(r?e.BOOLEAN_TRUE:e.BOOLEAN_FALSE);n.useEffect(()=>{if(r){i(e.BOOLEAN_TRUE),O(o),c(e.BOOLEAN_FALSE);return}if(o){if(i(e.BOOLEAN_TRUE),c(e.BOOLEAN_FALSE),A===l.OVERLAY_OPEN_EFFECT_NONE){O(e.BOOLEAN_TRUE);return}const t=requestAnimationFrame(()=>O(e.BOOLEAN_TRUE));return()=>cancelAnimationFrame(t)}if(s){O(e.BOOLEAN_FALSE),c(e.BOOLEAN_TRUE);const t=_===l.OVERLAY_OPEN_EFFECT_NONE?B.ZERO:m.DRAWER_ANIMATION_MS,S=setTimeout(()=>{i(e.BOOLEAN_FALSE),c(e.BOOLEAN_FALSE)},t);return()=>clearTimeout(S)}},[r,o,s,A,_]);const u=n.useCallback(t=>{E&&t.key===F.KEY_ESCAPE&&a()},[E,a]);return n.useEffect(()=>{s&&E&&document.addEventListener("keydown",u);const t=L&&s?R.lockBodyScroll():void 0;return()=>{document.removeEventListener("keydown",u),t==null||t()}},[s,u,E,L]),{isMounted:s,isPanelOpen:r?o:f&&!d}};exports.useDrawer=T;
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
import { ZERO as
|
|
3
|
-
import { BOOLEAN_FALSE as o, BOOLEAN_TRUE as
|
|
4
|
-
import { KEY_ESCAPE as
|
|
5
|
-
import { OVERLAY_OPEN_EFFECT_NONE as
|
|
6
|
-
import { DRAWER_ANIMATION_MS as
|
|
7
|
-
import { lockBodyScroll as
|
|
8
|
-
const
|
|
9
|
-
const { isOpen: s, onClose:
|
|
10
|
-
|
|
1
|
+
import { useState as f, useEffect as O, useCallback as L } from "react";
|
|
2
|
+
import { ZERO as S } from "../../../constants/numbers.const.js";
|
|
3
|
+
import { BOOLEAN_FALSE as o, BOOLEAN_TRUE as n } from "../../../constants/generals.const.js";
|
|
4
|
+
import { KEY_ESCAPE as k } from "../../../constants/keys.const.js";
|
|
5
|
+
import { OVERLAY_OPEN_EFFECT_NONE as A } from "../../../hooks/useFixedAnchorPosition/useFixedAnchorPosition.const.js";
|
|
6
|
+
import { DRAWER_ANIMATION_MS as y } from "../Drawer.const.js";
|
|
7
|
+
import { lockBodyScroll as F } from "../Drawer.utils.js";
|
|
8
|
+
const g = (_) => {
|
|
9
|
+
const { isOpen: s, onClose: l, closeOnEscape: i, openEffect: u, closeEffect: p, lockScroll: d, alwaysMounted: r } = _, [t, E] = f(s || r), [M, c] = f(o), [N, m] = f(r ? n : o);
|
|
10
|
+
O(() => {
|
|
11
|
+
if (r) {
|
|
12
|
+
E(n), m(s), c(o);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
11
15
|
if (s) {
|
|
12
|
-
if (
|
|
13
|
-
|
|
16
|
+
if (E(n), c(o), u === A) {
|
|
17
|
+
m(n);
|
|
14
18
|
return;
|
|
15
19
|
}
|
|
16
|
-
const e = requestAnimationFrame(() =>
|
|
20
|
+
const e = requestAnimationFrame(() => m(n));
|
|
17
21
|
return () => cancelAnimationFrame(e);
|
|
18
22
|
}
|
|
19
23
|
if (t) {
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
return () => clearTimeout(
|
|
24
|
+
m(o), c(n);
|
|
25
|
+
const C = setTimeout(() => {
|
|
26
|
+
E(o), c(o);
|
|
27
|
+
}, p === A ? S : y);
|
|
28
|
+
return () => clearTimeout(C);
|
|
25
29
|
}
|
|
26
|
-
}, [s, t, u,
|
|
27
|
-
const
|
|
30
|
+
}, [r, s, t, u, p]);
|
|
31
|
+
const a = L(
|
|
28
32
|
(e) => {
|
|
29
|
-
|
|
33
|
+
i && e.key === k && l();
|
|
30
34
|
},
|
|
31
|
-
[
|
|
35
|
+
[i, l]
|
|
32
36
|
);
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
const e = v();
|
|
37
|
-
return () => {
|
|
38
|
-
document.removeEventListener("keydown", n), e();
|
|
39
|
-
};
|
|
40
|
-
}
|
|
37
|
+
return O(() => {
|
|
38
|
+
t && i && document.addEventListener("keydown", a);
|
|
39
|
+
const e = d && t ? F() : void 0;
|
|
41
40
|
return () => {
|
|
42
|
-
document.removeEventListener("keydown",
|
|
41
|
+
document.removeEventListener("keydown", a), e == null || e();
|
|
43
42
|
};
|
|
44
|
-
}, [t,
|
|
43
|
+
}, [t, a, i, d]), {
|
|
45
44
|
isMounted: t,
|
|
46
|
-
isPanelOpen:
|
|
45
|
+
isPanelOpen: r ? s : N && !M
|
|
47
46
|
};
|
|
48
47
|
};
|
|
49
48
|
export {
|
|
50
|
-
|
|
49
|
+
g as useDrawer
|
|
51
50
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Drawer } from './Drawer';
|
|
2
|
-
export type { DrawerProps } from './Drawer.types';
|
|
2
|
+
export type { DrawerProps, DrawerVariant } from './Drawer.types';
|
|
@@ -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"),o=require("../Box/Box.cjs"),I=require("../Flex/Flex.cjs"),E=require("../Typography/Typography.cjs"),a=require("../../utils/cn.cjs");require("react");const g=require("../../utils/generateBearId.utils.cjs"),N=require("../../utils/useBearId.cjs"),t=require("./EmptyState.const.cjs"),h=d=>{const{icon:l,title:S,description:r,action:c,secondaryAction:n,className:T,size:_=t.EMPTY_STATE_DEFAULT_SIZE,variant:p=t.EMPTY_STATE_DEFAULT_VARIANT,preset:i=t.EMPTY_STATE_DEFAULT_PRESET,id:m,testId:y}=d,u=N.useBearId("EmptyState"),B=g.resolveBearId(m,u),s=t.EMPTY_STATE_SIZE_CLASSES[_],x=t.EMPTY_STATE_PRESET_ICON[i],A=l??e.jsx(x,{className:"bear-w-full bear-h-full"});return e.jsxs(o.Box,{id:B,"data-testid":y,className:a.cn("Bear-EmptyState",p==="card"&&"Bear-EmptyState--card",`Bear-EmptyState--${i}`,s.padding,T),children:[e.jsx(o.Box,{className:a.cn("Bear-EmptyState__icon",s.icon),children:A}),e.jsx(E.Typography,{className:a.cn("Bear-EmptyState__title",s.title),children:S}),r&&e.jsx(E.Typography,{className:a.cn("Bear-EmptyState__description",s.desc),children:r}),(c||n)&&e.jsxs(I.Flex,{className:"Bear-EmptyState__actions",align:"center",gap:3,children:[c,n]})]})};exports.EmptyState=h;
|
|
@@ -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("../../constants/generals.const.cjs"),e=require("./helpers/EmptyStateErrorSvg.cjs"),T=require("./helpers/EmptyStateInboxSvg.cjs"),t=require("./helpers/EmptyStateSearchSvg.cjs"),S=E.SIZE_MD,_=E.VARIANT_DEFAULT,r=E.EMPTY_STATE_PRESET_EMPTY,a={[E.EMPTY_STATE_PRESET_EMPTY]:T.EmptyStateInboxSvg,[E.EMPTY_STATE_PRESET_INBOX]:T.EmptyStateInboxSvg,[E.EMPTY_STATE_PRESET_SEARCH]:t.EmptyStateSearchSvg,[E.EMPTY_STATE_PRESET_ERROR]:e.EmptyStateErrorSvg},A={sm:{icon:"bear-w-12 bear-h-12",title:"bear-text-lg",desc:"bear-text-sm",padding:"bear-py-6 bear-px-4"},md:{icon:"bear-w-16 bear-h-16",title:"bear-text-xl",desc:"bear-text-base",padding:"bear-py-10 bear-px-6"},lg:{icon:"bear-w-20 bear-h-20",title:"bear-text-2xl",desc:"bear-text-lg",padding:"bear-py-14 bear-px-8"}};exports.EMPTY_STATE_DEFAULT_PRESET=r;exports.EMPTY_STATE_DEFAULT_SIZE=S;exports.EMPTY_STATE_DEFAULT_VARIANT=_;exports.EMPTY_STATE_PRESET_ICON=a;exports.EMPTY_STATE_SIZE_CLASSES=A;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { EmptyStatePreset } from './EmptyState.types';
|
|
3
|
+
export declare const EMPTY_STATE_DEFAULT_SIZE: "md";
|
|
4
|
+
export declare const EMPTY_STATE_DEFAULT_VARIANT: "default";
|
|
5
|
+
export declare const EMPTY_STATE_DEFAULT_PRESET: EmptyStatePreset;
|
|
6
|
+
export declare const EMPTY_STATE_PRESET_ICON: Record<EmptyStatePreset, ComponentType<{
|
|
7
|
+
className?: string;
|
|
8
|
+
}>>;
|
|
7
9
|
export declare const EMPTY_STATE_SIZE_CLASSES: {
|
|
8
10
|
readonly sm: {
|
|
9
11
|
readonly icon: "bear-w-12 bear-h-12";
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { SIZE_MD as t, VARIANT_DEFAULT as e, EMPTY_STATE_PRESET_EMPTY as T, EMPTY_STATE_PRESET_ERROR as r, EMPTY_STATE_PRESET_SEARCH as S, EMPTY_STATE_PRESET_INBOX as _ } from "../../constants/generals.const.js";
|
|
2
|
+
import { EmptyStateErrorSvg as a } from "./helpers/EmptyStateErrorSvg.js";
|
|
3
|
+
import { EmptyStateInboxSvg as E } from "./helpers/EmptyStateInboxSvg.js";
|
|
4
|
+
import { EmptyStateSearchSvg as b } from "./helpers/EmptyStateSearchSvg.js";
|
|
5
|
+
const m = t, i = e, x = T, c = {
|
|
6
|
+
[T]: E,
|
|
7
|
+
[_]: E,
|
|
8
|
+
[S]: b,
|
|
9
|
+
[r]: a
|
|
10
|
+
}, n = {
|
|
2
11
|
sm: {
|
|
3
12
|
icon: "bear-w-12 bear-h-12",
|
|
4
13
|
title: "bear-text-lg",
|
|
@@ -19,11 +28,9 @@ const e = "Bear-EmptyState", r = "bear-flex bear-flex-col bear-items-center bear
|
|
|
19
28
|
}
|
|
20
29
|
};
|
|
21
30
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
E as EMPTY_STATE_SIZE_CLASSES,
|
|
28
|
-
t as EMPTY_STATE_TITLE_CLASSES
|
|
31
|
+
x as EMPTY_STATE_DEFAULT_PRESET,
|
|
32
|
+
m as EMPTY_STATE_DEFAULT_SIZE,
|
|
33
|
+
i as EMPTY_STATE_DEFAULT_VARIANT,
|
|
34
|
+
c as EMPTY_STATE_PRESET_ICON,
|
|
35
|
+
n as EMPTY_STATE_SIZE_CLASSES
|
|
29
36
|
};
|
|
@@ -1,54 +1,50 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Box as m } from "../Box/Box.js";
|
|
3
|
+
import { Flex as N } from "../Flex/Flex.js";
|
|
4
|
+
import { Typography as n } from "../Typography/Typography.js";
|
|
5
|
+
import { cn as a } from "../../utils/cn.js";
|
|
4
6
|
import "react";
|
|
5
|
-
import { resolveBearId as
|
|
6
|
-
import { useBearId as
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
className:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
id: n,
|
|
25
|
-
testId: _
|
|
26
|
-
}) => {
|
|
27
|
-
const c = v("EmptyState"), A = u(n, c), a = p[T];
|
|
28
|
-
return /* @__PURE__ */ l(
|
|
29
|
-
"div",
|
|
7
|
+
import { resolveBearId as P } from "../../utils/generateBearId.utils.js";
|
|
8
|
+
import { useBearId as h } from "../../utils/useBearId.js";
|
|
9
|
+
import { EMPTY_STATE_DEFAULT_SIZE as g, EMPTY_STATE_DEFAULT_VARIANT as x, EMPTY_STATE_DEFAULT_PRESET as M, EMPTY_STATE_SIZE_CLASSES as Y, EMPTY_STATE_PRESET_ICON as u } from "./EmptyState.const.js";
|
|
10
|
+
const z = (E) => {
|
|
11
|
+
const {
|
|
12
|
+
icon: p,
|
|
13
|
+
title: d,
|
|
14
|
+
description: r,
|
|
15
|
+
action: o,
|
|
16
|
+
secondaryAction: s,
|
|
17
|
+
className: l,
|
|
18
|
+
size: _ = g,
|
|
19
|
+
variant: T = x,
|
|
20
|
+
preset: i = M,
|
|
21
|
+
id: S,
|
|
22
|
+
testId: y
|
|
23
|
+
} = E, A = h("EmptyState"), f = P(S, A), t = Y[_], B = u[i], I = p ?? /* @__PURE__ */ e(B, { className: "bear-w-full bear-h-full" });
|
|
24
|
+
return /* @__PURE__ */ c(
|
|
25
|
+
m,
|
|
30
26
|
{
|
|
31
|
-
id:
|
|
32
|
-
"data-testid":
|
|
33
|
-
className:
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
id: f,
|
|
28
|
+
"data-testid": y,
|
|
29
|
+
className: a(
|
|
30
|
+
"Bear-EmptyState",
|
|
31
|
+
T === "card" && "Bear-EmptyState--card",
|
|
32
|
+
`Bear-EmptyState--${i}`,
|
|
33
|
+
t.padding,
|
|
34
|
+
l
|
|
39
35
|
),
|
|
40
36
|
children: [
|
|
41
|
-
/* @__PURE__ */ e(
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
|
|
44
|
-
(
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
/* @__PURE__ */ e(m, { className: a("Bear-EmptyState__icon", t.icon), children: I }),
|
|
38
|
+
/* @__PURE__ */ e(n, { className: a("Bear-EmptyState__title", t.title), children: d }),
|
|
39
|
+
r && /* @__PURE__ */ e(n, { className: a("Bear-EmptyState__description", t.desc), children: r }),
|
|
40
|
+
(o || s) && /* @__PURE__ */ c(N, { className: "Bear-EmptyState__actions", align: "center", gap: 3, children: [
|
|
41
|
+
o,
|
|
42
|
+
s
|
|
47
43
|
] })
|
|
48
44
|
]
|
|
49
45
|
}
|
|
50
46
|
);
|
|
51
47
|
};
|
|
52
48
|
export {
|
|
53
|
-
|
|
49
|
+
z as EmptyState
|
|
54
50
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
export type EmptyStatePreset = 'empty' | 'search' | 'inbox' | 'error';
|
|
2
3
|
export interface EmptyStateProps {
|
|
3
4
|
testId?: string;
|
|
4
5
|
id?: string;
|
|
@@ -10,4 +11,5 @@ export interface EmptyStateProps {
|
|
|
10
11
|
className?: string;
|
|
11
12
|
size?: 'sm' | 'md' | 'lg';
|
|
12
13
|
variant?: 'default' | 'card';
|
|
14
|
+
preset?: EmptyStatePreset;
|
|
13
15
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),o=r=>{const{className:t}=r;return e.jsx("svg",{className:t,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})};exports.EmptyStateErrorSvg=o;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
const n = (o) => {
|
|
3
|
+
const { className: e } = o;
|
|
4
|
+
return /* @__PURE__ */ r("svg", { className: e, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", "aria-hidden": "true", children: /* @__PURE__ */ r("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.5, d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) });
|
|
5
|
+
};
|
|
6
|
+
export {
|
|
7
|
+
n as EmptyStateErrorSvg
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=t=>{const{className:o}=t;return e.jsx("svg",{className:o,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"})})};exports.EmptyStateInboxSvg=r;
|