@forgedevstack/bear 1.0.7 → 1.0.9
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/dist/components/ActivityItem/ActivityItem.cjs +1 -1
- package/dist/components/ActivityItem/ActivityItem.js +1 -0
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -1
- package/dist/components/Alert/Alert.const.d.ts +4 -0
- package/dist/components/Alert/Alert.const.js +10 -15
- package/dist/components/Alert/Alert.js +43 -38
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.js +19 -14
- package/dist/components/BackTop/BackTop.cjs +1 -0
- package/dist/components/BackTop/BackTop.const.cjs +1 -0
- package/dist/components/BackTop/BackTop.const.d.ts +34 -0
- package/dist/components/BackTop/BackTop.const.js +29 -0
- package/dist/components/BackTop/BackTop.d.ts +21 -0
- package/dist/components/BackTop/BackTop.js +87 -0
- package/dist/components/BackTop/BackTop.types.d.ts +28 -0
- package/dist/components/BackTop/index.d.ts +3 -0
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.constants.d.ts +4 -4
- package/dist/components/Badge/Badge.js +15 -14
- package/dist/components/Badge/Badge.types.d.ts +3 -3
- package/dist/components/BearLogo/EmberLogo.cjs +1 -1
- package/dist/components/BearLogo/EmberLogo.js +3 -2
- package/dist/components/BottomNavigation/BottomNavigation.cjs +1 -1
- package/dist/components/BottomNavigation/BottomNavigation.js +3 -2
- package/dist/components/BottomSheet/BottomSheet.cjs +1 -1
- package/dist/components/BottomSheet/BottomSheet.js +39 -38
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +38 -48
- package/dist/components/Button/Button.constants.d.ts +22 -3
- package/dist/components/Button/Button.constants.js +51 -50
- package/dist/components/Button/Button.d.ts +14 -7
- package/dist/components/Button/Button.js +123 -45
- package/dist/components/Button/Button.types.d.ts +22 -4
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +3 -2
- package/dist/components/Card/Card.const.d.ts +2 -2
- package/dist/components/Card/Card.types.d.ts +2 -2
- package/dist/components/Carousel/Carousel.cjs +1 -1
- package/dist/components/Carousel/Carousel.const.cjs +1 -0
- package/dist/components/Carousel/Carousel.const.d.ts +12 -0
- package/dist/components/Carousel/Carousel.const.js +9 -0
- package/dist/components/Carousel/Carousel.d.ts +14 -3
- package/dist/components/Carousel/Carousel.js +222 -75
- package/dist/components/Carousel/Carousel.types.d.ts +32 -2
- package/dist/components/Carousel/index.d.ts +1 -1
- package/dist/components/Chat/Chat.cjs +1 -0
- package/dist/components/Chat/Chat.const.cjs +1 -0
- package/dist/components/Chat/Chat.const.d.ts +26 -0
- package/dist/components/Chat/Chat.const.js +29 -0
- package/dist/components/Chat/Chat.d.ts +21 -0
- package/dist/components/Chat/Chat.js +179 -0
- package/dist/components/Chat/Chat.types.d.ts +55 -0
- package/dist/components/Chat/index.d.ts +2 -0
- package/dist/components/Chip/Chip.cjs +1 -1
- package/dist/components/Chip/Chip.js +3 -2
- package/dist/components/CodeEditor/CodeEditor.cjs +5 -0
- package/dist/components/CodeEditor/CodeEditor.const.cjs +1 -0
- package/dist/components/CodeEditor/CodeEditor.const.d.ts +21 -0
- package/dist/components/CodeEditor/CodeEditor.const.js +119 -0
- package/dist/components/CodeEditor/CodeEditor.d.ts +22 -0
- package/dist/components/CodeEditor/CodeEditor.js +250 -0
- package/dist/components/CodeEditor/CodeEditor.types.d.ts +80 -0
- package/dist/components/CodeEditor/CodeEditor.utils.cjs +1 -0
- package/dist/components/CodeEditor/CodeEditor.utils.d.ts +6 -0
- package/dist/components/CodeEditor/CodeEditor.utils.js +75 -0
- package/dist/components/CodeEditor/index.d.ts +2 -0
- package/dist/components/Columns/Columns.cjs +1 -1
- package/dist/components/Columns/Columns.js +9 -8
- package/dist/components/Confetti/Confetti.cjs +1 -0
- package/dist/components/Confetti/Confetti.const.cjs +1 -0
- package/dist/components/Confetti/Confetti.const.d.ts +16 -0
- package/dist/components/Confetti/Confetti.const.js +36 -0
- package/dist/components/Confetti/Confetti.d.ts +23 -0
- package/dist/components/Confetti/Confetti.js +94 -0
- package/dist/components/Confetti/Confetti.types.d.ts +50 -0
- package/dist/components/Confetti/index.d.ts +4 -0
- package/dist/components/Confetti/useConfetti.cjs +1 -0
- package/dist/components/Confetti/useConfetti.d.ts +13 -0
- package/dist/components/Confetti/useConfetti.js +12 -0
- package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.d.ts +27 -0
- package/dist/components/CountdownTimer/CountdownTimer.const.js +35 -0
- package/dist/components/CountdownTimer/CountdownTimer.d.ts +7 -0
- package/dist/components/CountdownTimer/CountdownTimer.js +115 -0
- package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +56 -0
- package/dist/components/CountdownTimer/index.d.ts +2 -0
- package/dist/components/Cropper/Cropper.cjs +1 -0
- package/dist/components/Cropper/Cropper.const.cjs +1 -0
- package/dist/components/Cropper/Cropper.const.d.ts +31 -0
- package/dist/components/Cropper/Cropper.const.js +33 -0
- package/dist/components/Cropper/Cropper.d.ts +21 -0
- package/dist/components/Cropper/Cropper.js +362 -0
- package/dist/components/Cropper/Cropper.types.d.ts +72 -0
- package/dist/components/Cropper/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.cjs +1 -1
- package/dist/components/DataTable/DataTable.js +5 -4
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.js +3 -2
- package/dist/components/DiffViewer/DiffViewer.cjs +1 -0
- package/dist/components/DiffViewer/DiffViewer.const.cjs +1 -0
- package/dist/components/DiffViewer/DiffViewer.const.d.ts +18 -0
- package/dist/components/DiffViewer/DiffViewer.const.js +21 -0
- package/dist/components/DiffViewer/DiffViewer.d.ts +18 -0
- package/dist/components/DiffViewer/DiffViewer.js +127 -0
- package/dist/components/DiffViewer/DiffViewer.types.d.ts +40 -0
- package/dist/components/DiffViewer/DiffViewer.utils.cjs +3 -0
- package/dist/components/DiffViewer/DiffViewer.utils.d.ts +9 -0
- package/dist/components/DiffViewer/DiffViewer.utils.js +39 -0
- package/dist/components/DiffViewer/index.d.ts +2 -0
- package/dist/components/Divider/Divider.cjs +1 -1
- package/dist/components/Divider/Divider.js +15 -14
- package/dist/components/Dock/Dock.cjs +1 -0
- package/dist/components/Dock/Dock.const.cjs +1 -0
- package/dist/components/Dock/Dock.const.d.ts +25 -0
- package/dist/components/Dock/Dock.const.js +22 -0
- package/dist/components/Dock/Dock.d.ts +7 -0
- package/dist/components/Dock/Dock.js +144 -0
- package/dist/components/Dock/Dock.types.d.ts +42 -0
- package/dist/components/Dock/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +35 -35
- package/dist/components/EmptyState/EmptyState.cjs +1 -1
- package/dist/components/EmptyState/EmptyState.js +7 -6
- package/dist/components/FloatingChat/FloatingChat.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.const.cjs +1 -0
- package/dist/components/FloatingChat/FloatingChat.const.d.ts +12 -0
- package/dist/components/FloatingChat/FloatingChat.const.js +15 -0
- package/dist/components/FloatingChat/FloatingChat.d.ts +19 -0
- package/dist/components/FloatingChat/FloatingChat.js +144 -0
- package/dist/components/FloatingChat/FloatingChat.types.d.ts +44 -0
- package/dist/components/FloatingChat/index.d.ts +2 -0
- package/dist/components/GradientText/GradientText.cjs +1 -0
- package/dist/components/GradientText/GradientText.const.cjs +1 -0
- package/dist/components/GradientText/GradientText.const.d.ts +15 -0
- package/dist/components/GradientText/GradientText.const.js +36 -0
- package/dist/components/GradientText/GradientText.d.ts +7 -0
- package/dist/components/GradientText/GradientText.js +52 -0
- package/dist/components/GradientText/GradientText.types.d.ts +27 -0
- package/dist/components/GradientText/index.d.ts +2 -0
- package/dist/components/Highlight/Highlight.cjs +1 -1
- package/dist/components/Highlight/Highlight.const.cjs +1 -0
- package/dist/components/Highlight/Highlight.const.d.ts +8 -0
- package/dist/components/Highlight/Highlight.const.js +15 -0
- package/dist/components/Highlight/Highlight.d.ts +4 -0
- package/dist/components/Highlight/Highlight.js +32 -24
- package/dist/components/Highlight/Highlight.types.d.ts +9 -1
- package/dist/components/Highlight/index.d.ts +1 -1
- package/dist/components/Icon/Icon.cjs +1 -1
- package/dist/components/Icon/Icon.js +17 -16
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.js +12 -11
- package/dist/components/JsonViewer/JsonViewer.cjs +1 -0
- package/dist/components/JsonViewer/JsonViewer.const.cjs +1 -0
- package/dist/components/JsonViewer/JsonViewer.const.d.ts +4 -0
- package/dist/components/JsonViewer/JsonViewer.const.js +24 -0
- package/dist/components/JsonViewer/JsonViewer.d.ts +17 -0
- package/dist/components/JsonViewer/JsonViewer.js +195 -0
- package/dist/components/JsonViewer/JsonViewer.types.d.ts +54 -0
- package/dist/components/JsonViewer/index.d.ts +2 -0
- package/dist/components/Kanban/Kanban.cjs +1 -1
- package/dist/components/Kanban/Kanban.js +18 -17
- package/dist/components/Kbd/Kbd.cjs +1 -1
- package/dist/components/Kbd/Kbd.js +17 -16
- package/dist/components/Map/Map.cjs +1 -0
- package/dist/components/Map/Map.const.cjs +1 -0
- package/dist/components/Map/Map.const.d.ts +20 -0
- package/dist/components/Map/Map.const.js +26 -0
- package/dist/components/Map/Map.d.ts +20 -0
- package/dist/components/Map/Map.js +259 -0
- package/dist/components/Map/Map.types.d.ts +81 -0
- package/dist/components/Map/index.d.ts +2 -0
- package/dist/components/Marquee/Marquee.cjs +1 -0
- package/dist/components/Marquee/Marquee.const.cjs +1 -0
- package/dist/components/Marquee/Marquee.const.d.ts +11 -0
- package/dist/components/Marquee/Marquee.const.js +12 -0
- package/dist/components/Marquee/Marquee.d.ts +7 -0
- package/dist/components/Marquee/Marquee.js +106 -0
- package/dist/components/Marquee/Marquee.types.d.ts +32 -0
- package/dist/components/Marquee/index.d.ts +2 -0
- package/dist/components/Masonry/Masonry.cjs +1 -0
- package/dist/components/Masonry/Masonry.const.cjs +1 -0
- package/dist/components/Masonry/Masonry.const.d.ts +9 -0
- package/dist/components/Masonry/Masonry.const.js +9 -0
- package/dist/components/Masonry/Masonry.d.ts +7 -0
- package/dist/components/Masonry/Masonry.js +51 -0
- package/dist/components/Masonry/Masonry.types.d.ts +21 -0
- package/dist/components/Masonry/index.d.ts +2 -0
- package/dist/components/NavigableSelect/NavigableSelect.cjs +1 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.cjs +1 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.d.ts +23 -0
- package/dist/components/NavigableSelect/NavigableSelect.const.js +33 -0
- package/dist/components/NavigableSelect/NavigableSelect.d.ts +7 -0
- package/dist/components/NavigableSelect/NavigableSelect.js +361 -0
- package/dist/components/NavigableSelect/NavigableSelect.types.d.ts +56 -0
- package/dist/components/NavigableSelect/index.d.ts +2 -0
- package/dist/components/Progress/Progress.cjs +1 -1
- package/dist/components/Progress/Progress.js +3 -2
- package/dist/components/QRCode/QRCode.cjs +1 -0
- package/dist/components/QRCode/QRCode.const.cjs +1 -0
- package/dist/components/QRCode/QRCode.const.d.ts +21 -0
- package/dist/components/QRCode/QRCode.const.js +11 -0
- package/dist/components/QRCode/QRCode.d.ts +29 -0
- package/dist/components/QRCode/QRCode.js +68 -0
- package/dist/components/QRCode/QRCode.types.d.ts +32 -0
- package/dist/components/QRCode/QRCode.utils.cjs +1 -0
- package/dist/components/QRCode/QRCode.utils.d.ts +12 -0
- package/dist/components/QRCode/QRCode.utils.js +74 -0
- package/dist/components/QRCode/index.d.ts +3 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -1
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +3 -2
- package/dist/components/ScrollArea/ScrollArea.cjs +1 -1
- package/dist/components/ScrollArea/ScrollArea.js +3 -2
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.js +13 -12
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +3 -2
- package/dist/components/Spinner/Spinner.types.d.ts +2 -2
- package/dist/components/Spotlight/Spotlight.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.const.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.const.d.ts +18 -0
- package/dist/components/Spotlight/Spotlight.const.js +9 -0
- package/dist/components/Spotlight/Spotlight.d.ts +7 -0
- package/dist/components/Spotlight/Spotlight.js +220 -0
- package/dist/components/Spotlight/Spotlight.types.d.ts +51 -0
- package/dist/components/Spotlight/index.d.ts +2 -0
- package/dist/components/StatCard/StatCard.cjs +1 -1
- package/dist/components/StatCard/StatCard.js +9 -8
- package/dist/components/Statistic/Statistic.cjs +1 -1
- package/dist/components/Statistic/Statistic.js +7 -6
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +11 -10
- package/dist/components/Terminal/Terminal.cjs +1 -0
- package/dist/components/Terminal/Terminal.const.cjs +1 -0
- package/dist/components/Terminal/Terminal.const.d.ts +32 -0
- package/dist/components/Terminal/Terminal.const.js +42 -0
- package/dist/components/Terminal/Terminal.d.ts +27 -0
- package/dist/components/Terminal/Terminal.js +155 -0
- package/dist/components/Terminal/Terminal.types.d.ts +49 -0
- package/dist/components/Terminal/index.d.ts +2 -0
- package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.cjs +1 -1
- package/dist/components/TimePicker/components/TimePickerColumnsDropdown/TimePickerColumnsDropdown.js +16 -15
- package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
- package/dist/components/TimePicker/helpers/ClockFaceSvg.js +13 -12
- package/dist/components/Tour/Tour.cjs +1 -0
- package/dist/components/Tour/Tour.const.cjs +1 -0
- package/dist/components/Tour/Tour.const.d.ts +25 -0
- package/dist/components/Tour/Tour.const.js +38 -0
- package/dist/components/Tour/Tour.d.ts +17 -0
- package/dist/components/Tour/Tour.js +179 -0
- package/dist/components/Tour/Tour.types.d.ts +80 -0
- package/dist/components/Tour/index.d.ts +4 -0
- package/dist/components/Tour/useTour.cjs +1 -0
- package/dist/components/Tour/useTour.d.ts +14 -0
- package/dist/components/Tour/useTour.js +27 -0
- package/dist/components/Transition/Transition.cjs +1 -0
- package/dist/components/Transition/Transition.const.cjs +1 -0
- package/dist/components/Transition/Transition.const.d.ts +15 -0
- package/dist/components/Transition/Transition.const.js +73 -0
- package/dist/components/Transition/Transition.d.ts +37 -0
- package/dist/components/Transition/Transition.js +107 -0
- package/dist/components/Transition/Transition.types.d.ts +69 -0
- package/dist/components/Transition/index.d.ts +2 -0
- package/dist/components/Typewriter/Typewriter.cjs +1 -0
- package/dist/components/Typewriter/Typewriter.const.cjs +1 -0
- package/dist/components/Typewriter/Typewriter.const.d.ts +22 -0
- package/dist/components/Typewriter/Typewriter.const.js +11 -0
- package/dist/components/Typewriter/Typewriter.d.ts +7 -0
- package/dist/components/Typewriter/Typewriter.js +88 -0
- package/dist/components/Typewriter/Typewriter.types.d.ts +32 -0
- package/dist/components/Typewriter/index.d.ts +2 -0
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.d.ts +5 -1
- package/dist/components/Typography/Typography.js +93 -57
- package/dist/components/Typography/Typography.types.d.ts +29 -2
- package/dist/components/Watermark/Watermark.cjs +1 -0
- package/dist/components/Watermark/Watermark.const.cjs +1 -0
- package/dist/components/Watermark/Watermark.const.d.ts +30 -0
- package/dist/components/Watermark/Watermark.const.js +18 -0
- package/dist/components/Watermark/Watermark.d.ts +7 -0
- package/dist/components/Watermark/Watermark.js +96 -0
- package/dist/components/Watermark/Watermark.types.d.ts +35 -0
- package/dist/components/Watermark/index.d.ts +2 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +46 -2
- package/dist/components/index.js +288 -237
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +110 -5
- package/dist/context/BearProvider.js +198 -53
- package/dist/context/defaultTheme.cjs +1 -1
- package/dist/context/defaultTheme.js +11 -11
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/index.js +61 -39
- package/dist/hooks/useAnimate.cjs +1 -0
- package/dist/hooks/useAnimate.d.ts +61 -0
- package/dist/hooks/useAnimate.js +125 -0
- package/dist/hooks/useBearComponent/index.d.ts +2 -0
- package/dist/hooks/useBearComponent/useBearComponent.cjs +1 -0
- package/dist/hooks/useBearComponent/useBearComponent.d.ts +71 -0
- package/dist/hooks/useBearComponent/useBearComponent.js +54 -0
- package/dist/hooks/useBearComponent/useBearComponent.types.d.ts +40 -0
- package/dist/hooks/useIdle/index.d.ts +2 -0
- package/dist/hooks/useIdle/useIdle.cjs +1 -0
- package/dist/hooks/useIdle/useIdle.d.ts +22 -0
- package/dist/hooks/useIdle/useIdle.js +66 -0
- package/dist/hooks/useIdle/useIdle.types.d.ts +29 -0
- package/dist/hooks/useLongPress/index.d.ts +2 -0
- package/dist/hooks/useLongPress/useLongPress.cjs +1 -0
- package/dist/hooks/useLongPress/useLongPress.d.ts +17 -0
- package/dist/hooks/useLongPress/useLongPress.js +44 -0
- package/dist/hooks/useLongPress/useLongPress.types.d.ts +26 -0
- package/dist/hooks/useOnline/index.d.ts +2 -0
- package/dist/hooks/useOnline/useOnline.cjs +1 -0
- package/dist/hooks/useOnline/useOnline.d.ts +16 -0
- package/dist/hooks/useOnline/useOnline.js +25 -0
- package/dist/hooks/useOnline/useOnline.types.d.ts +15 -0
- package/dist/hooks/usePageVisibility/index.d.ts +2 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.cjs +1 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.d.ts +19 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.js +26 -0
- package/dist/hooks/usePageVisibility/usePageVisibility.types.d.ts +15 -0
- package/dist/hooks/useResponsive.cjs +1 -0
- package/dist/hooks/useResponsive.d.ts +35 -0
- package/dist/hooks/useResponsive.js +74 -0
- package/dist/hooks/useSpotlight/index.d.ts +2 -0
- package/dist/hooks/useSpotlight/useSpotlight.cjs +1 -0
- package/dist/hooks/useSpotlight/useSpotlight.d.ts +24 -0
- package/dist/hooks/useSpotlight/useSpotlight.js +49 -0
- package/dist/hooks/useSpotlight/useSpotlight.types.d.ts +23 -0
- package/dist/hooks/useWebSocket/index.d.ts +2 -0
- package/dist/hooks/useWebSocket/useWebSocket.cjs +1 -0
- package/dist/hooks/useWebSocket/useWebSocket.d.ts +22 -0
- package/dist/hooks/useWebSocket/useWebSocket.js +75 -0
- package/dist/hooks/useWebSocket/useWebSocket.types.d.ts +44 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +363 -288
- package/dist/styles.css +1 -1
- package/dist/types/component.types.d.ts +125 -42
- package/dist/types/theme.types.d.ts +82 -0
- package/dist/utils/createSlots.cjs +1 -0
- package/dist/utils/createSlots.d.ts +70 -0
- package/dist/utils/createSlots.js +65 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +4 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as d, useEffect as p, useCallback as A } from "react";
|
|
3
3
|
import { createPortal as E } from "react-dom";
|
|
4
|
-
import { cn as
|
|
4
|
+
import { cn as x } from "../../utils/cn.js";
|
|
5
5
|
import { XIcon as I } from "../Icon/index.js";
|
|
6
|
-
const
|
|
6
|
+
const m = 300, D = {
|
|
7
7
|
left: {
|
|
8
8
|
sm: "bear-w-64",
|
|
9
9
|
md: "bear-w-80",
|
|
@@ -47,47 +47,47 @@ const d = 300, D = {
|
|
|
47
47
|
isOpen: l,
|
|
48
48
|
onClose: b,
|
|
49
49
|
title: o,
|
|
50
|
-
children:
|
|
50
|
+
children: g,
|
|
51
51
|
side: e = "right",
|
|
52
|
-
size:
|
|
53
|
-
showCloseButton:
|
|
52
|
+
size: y = "md",
|
|
53
|
+
showCloseButton: u = !0,
|
|
54
54
|
closeOnBackdrop: v = !0,
|
|
55
|
-
closeOnEscape:
|
|
56
|
-
className:
|
|
55
|
+
closeOnEscape: c = !0,
|
|
56
|
+
className: k
|
|
57
57
|
}) => {
|
|
58
|
-
const [r,
|
|
59
|
-
|
|
58
|
+
const [r, f] = d(l), [h, n] = d(!1), [N, w] = d(!1);
|
|
59
|
+
p(() => {
|
|
60
60
|
if (l) {
|
|
61
|
-
|
|
62
|
-
const a = requestAnimationFrame(() =>
|
|
61
|
+
f(!0), n(!1);
|
|
62
|
+
const a = requestAnimationFrame(() => w(!0));
|
|
63
63
|
return () => cancelAnimationFrame(a);
|
|
64
64
|
}
|
|
65
65
|
if (r) {
|
|
66
|
-
|
|
66
|
+
w(!1), n(!0);
|
|
67
67
|
const a = setTimeout(() => {
|
|
68
|
-
|
|
69
|
-
},
|
|
68
|
+
f(!1), n(!1);
|
|
69
|
+
}, m);
|
|
70
70
|
return () => clearTimeout(a);
|
|
71
71
|
}
|
|
72
72
|
}, [l, r]);
|
|
73
|
-
const
|
|
73
|
+
const s = A(
|
|
74
74
|
(a) => {
|
|
75
|
-
|
|
75
|
+
c && a.key === "Escape" && b();
|
|
76
76
|
},
|
|
77
|
-
[
|
|
77
|
+
[c, b]
|
|
78
78
|
);
|
|
79
|
-
if (
|
|
80
|
-
document.removeEventListener("keydown",
|
|
81
|
-
}), [r,
|
|
79
|
+
if (p(() => (r && (document.addEventListener("keydown", s), document.body.style.overflow = "hidden"), () => {
|
|
80
|
+
document.removeEventListener("keydown", s), document.body.style.overflow = "";
|
|
81
|
+
}), [r, s]), !r) return null;
|
|
82
82
|
const C = /* @__PURE__ */ i("div", { className: "bear-fixed bear-inset-0 bear-z-50", children: [
|
|
83
83
|
/* @__PURE__ */ t(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
86
|
-
className:
|
|
86
|
+
className: x(
|
|
87
87
|
"bear-absolute bear-inset-0 bear-bg-black/60 bear-backdrop-blur-sm bear-transition-opacity",
|
|
88
88
|
h ? "bear-opacity-0" : "bear-opacity-100"
|
|
89
89
|
),
|
|
90
|
-
style: { transitionDuration: `${
|
|
90
|
+
style: { transitionDuration: `${m}ms` },
|
|
91
91
|
onClick: v ? b : void 0,
|
|
92
92
|
"aria-hidden": "true"
|
|
93
93
|
}
|
|
@@ -98,41 +98,41 @@ const d = 300, D = {
|
|
|
98
98
|
role: "dialog",
|
|
99
99
|
"aria-modal": "true",
|
|
100
100
|
"aria-labelledby": o ? "drawer-title" : void 0,
|
|
101
|
-
className:
|
|
102
|
-
"bear-absolute bear-bg-
|
|
103
|
-
"bear-border-
|
|
101
|
+
className: x(
|
|
102
|
+
"bear-absolute bear-bg-white dark:bear-bg-neutral-900 bear-shadow-2xl",
|
|
103
|
+
"bear-border-neutral-200 dark:bear-border-neutral-700 bear-overflow-hidden",
|
|
104
104
|
"bear-transform bear-transition-transform",
|
|
105
105
|
e === "left" && "bear-border-r",
|
|
106
106
|
e === "right" && "bear-border-l",
|
|
107
107
|
e === "top" && "bear-border-b",
|
|
108
108
|
e === "bottom" && "bear-border-t",
|
|
109
109
|
M[e],
|
|
110
|
-
D[e][
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
D[e][y],
|
|
111
|
+
N && !h ? j[e] : T[e],
|
|
112
|
+
k
|
|
113
113
|
),
|
|
114
|
-
style: { transitionDuration: `${
|
|
114
|
+
style: { transitionDuration: `${m}ms` },
|
|
115
115
|
children: [
|
|
116
|
-
(o ||
|
|
116
|
+
(o || u) && /* @__PURE__ */ i("div", { className: "bear-flex bear-items-center bear-justify-between bear-px-4 bear-py-3 bear-border-b bear-border-neutral-200 dark:bear-border-neutral-700", children: [
|
|
117
117
|
o && /* @__PURE__ */ t(
|
|
118
118
|
"h2",
|
|
119
119
|
{
|
|
120
120
|
id: "drawer-title",
|
|
121
|
-
className: "bear-text-lg bear-font-semibold bear-text-white",
|
|
121
|
+
className: "bear-text-lg bear-font-semibold bear-text-neutral-900 dark:bear-text-white",
|
|
122
122
|
children: o
|
|
123
123
|
}
|
|
124
124
|
),
|
|
125
|
-
|
|
125
|
+
u && /* @__PURE__ */ t(
|
|
126
126
|
"button",
|
|
127
127
|
{
|
|
128
128
|
onClick: b,
|
|
129
|
-
className: "bear-p-1 bear-rounded-lg bear-text-
|
|
129
|
+
className: "bear-p-1 bear-rounded-lg bear-text-neutral-500 dark:bear-text-neutral-400 hover:bear-text-neutral-900 dark:hover:bear-text-white hover:bear-bg-neutral-100 dark:hover:bear-bg-neutral-700 bear-transition-colors",
|
|
130
130
|
"aria-label": "Close drawer",
|
|
131
131
|
children: /* @__PURE__ */ t(I, { className: "bear-w-5 bear-h-5" })
|
|
132
132
|
}
|
|
133
133
|
)
|
|
134
134
|
] }),
|
|
135
|
-
/* @__PURE__ */ t("div", { className: "bear-flex-1 bear-overflow-y-auto bear-p-4 bear-text-
|
|
135
|
+
/* @__PURE__ */ t("div", { className: "bear-flex-1 bear-overflow-y-auto bear-p-4 bear-text-neutral-700 dark:bear-text-neutral-300", children: g })
|
|
136
136
|
]
|
|
137
137
|
}
|
|
138
138
|
)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../utils/cn.cjs");require("react");const x=({className:b})=>e.jsx("svg",{className:b,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",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"})}),o=({icon:b,title:c,description:s,action:l,secondaryAction:n,className:i,size:a="md",variant:d="default"})=>{const r={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"}};return e.jsxs("div",{className:t.cn("bear-flex bear-flex-col bear-items-center bear-text-center",r[a].padding,d==="card"&&"bear-bg-zinc-800/50 bear-rounded-xl bear-border bear-border-zinc-700",i),children:[e.jsx("div",{className:t.cn("bear-text-zinc-600 bear-mb-4",r[a].icon),children:b||e.jsx(x,{className:"bear-w-full bear-h-full"})}),e.jsx("h3",{className:t.cn("bear-font-semibold bear-text-white bear-mb-2",r[a].title),children:c}),s&&e.jsx("p",{className:t.cn("bear-text-zinc-400 bear-max-w-md bear-mb-6",r[a].desc),children:s}),(l||n)&&e.jsxs("div",{className:"bear-flex bear-items-center bear-gap-3",children:[l,n]})]})};exports.EmptyState=o;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { cn as t } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const m = ({ className: b }) => /* @__PURE__ */ e("svg", { className: b, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("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" }) }), f = ({
|
|
4
5
|
icon: b,
|
|
5
|
-
title:
|
|
6
|
+
title: i,
|
|
6
7
|
description: l,
|
|
7
8
|
action: d,
|
|
8
9
|
secondaryAction: n,
|
|
9
|
-
className:
|
|
10
|
+
className: s,
|
|
10
11
|
size: a = "md",
|
|
11
12
|
variant: o = "default"
|
|
12
13
|
}) => {
|
|
@@ -19,10 +20,10 @@ const m = ({ className: b }) => /* @__PURE__ */ e("svg", { className: b, fill: "
|
|
|
19
20
|
"bear-flex bear-flex-col bear-items-center bear-text-center",
|
|
20
21
|
r[a].padding,
|
|
21
22
|
o === "card" && "bear-bg-zinc-800/50 bear-rounded-xl bear-border bear-border-zinc-700",
|
|
22
|
-
|
|
23
|
+
s
|
|
23
24
|
), children: [
|
|
24
25
|
/* @__PURE__ */ e("div", { className: t("bear-text-zinc-600 bear-mb-4", r[a].icon), children: b || /* @__PURE__ */ e(m, { className: "bear-w-full bear-h-full" }) }),
|
|
25
|
-
/* @__PURE__ */ e("h3", { className: t("bear-font-semibold bear-text-white bear-mb-2", r[a].title), children:
|
|
26
|
+
/* @__PURE__ */ e("h3", { className: t("bear-font-semibold bear-text-white bear-mb-2", r[a].title), children: i }),
|
|
26
27
|
l && /* @__PURE__ */ e("p", { className: t("bear-text-zinc-400 bear-max-w-md bear-mb-6", r[a].desc), children: l }),
|
|
27
28
|
(d || n) && /* @__PURE__ */ c("div", { className: "bear-flex bear-items-center bear-gap-3", children: [
|
|
28
29
|
d,
|
|
@@ -31,5 +32,5 @@ const m = ({ className: b }) => /* @__PURE__ */ e("svg", { className: b, fill: "
|
|
|
31
32
|
] });
|
|
32
33
|
};
|
|
33
34
|
export {
|
|
34
|
-
|
|
35
|
+
f as EmptyState
|
|
35
36
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),G=require("react-dom"),r=require("../../utils/cn.cjs"),U=require("../../context/BearProvider.cjs"),g=require("../Button/Button.cjs"),P=require("../Avatar/Avatar.cjs"),o=require("../Typography/Typography.cjs"),M=require("../Badge/Badge.cjs"),l=require("../Icon/index.cjs"),$=require("../Chat/Chat.cjs"),t=require("./FloatingChat.const.cjs"),Z=({messages:d,onSend:j,isLoading:b=!1,isTyping:S=!1,title:h=t.FLOATING_CHAT_DEFAULTS.TITLE,subtitle:_=t.FLOATING_CHAT_DEFAULTS.SUBTITLE,avatar:w,position:m=t.FLOATING_CHAT_DEFAULTS.POSITION,bottom:x=t.FLOATING_CHAT_DEFAULTS.BOTTOM,side:u=t.FLOATING_CHAT_DEFAULTS.SIDE,defaultOpen:E=!1,open:F,onOpenChange:s,trigger:T,badgeCount:i,header:y,welcomeMessage:p=t.FLOATING_CHAT_DEFAULTS.WELCOME_MESSAGE,poweredBy:A,className:L,testId:D})=>{const{mode:q}=U.useBear(),B=q==="dark",[C,v]=c.useState(E),[N,n]=c.useState(!1),a=F??C,I=c.useCallback(()=>{const f=!a;n(!0),v(f),s==null||s(f),setTimeout(()=>n(!1),300)},[a,s]),H=c.useCallback(()=>{n(!0),v(!1),s==null||s(!1),setTimeout(()=>n(!1),300)},[s]),k=d.length===0&&p?[{id:"welcome",content:p,sender:"bot",timestamp:new Date}]:d,z={bottom:`${x}px`,[m==="bottom-right"?"right":"left"]:`${u}px`},O={bottom:`${x+70}px`,[m==="bottom-right"?"right":"left"]:`${u}px`,width:t.CHAT_WINDOW_SIZE.width,height:t.CHAT_WINDOW_SIZE.height},W=e.jsxs("div",{className:r.cn("Bear-FloatingChat",L),"data-testid":D,children:[(a||N)&&e.jsxs("div",{className:r.cn("fixed z-50 rounded-2xl overflow-hidden shadow-2xl","transition-all duration-300 ease-out",a&&!N?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-4 scale-95 pointer-events-none"),style:O,children:[y?e.jsx("div",{className:r.cn("px-4 py-3",B?"bg-gray-800":"bg-[var(--bear-primary-500)]"),children:y}):e.jsxs("div",{className:r.cn("px-4 py-3 flex items-center gap-3","bg-[var(--bear-primary-500)] text-white"),children:[e.jsx(P.Avatar,{src:w,initials:h[0],size:"sm",className:"ring-2 ring-white/20"}),e.jsxs("div",{className:"flex-1",children:[e.jsx(o.Typography,{variant:"subtitle2",className:"text-white font-semibold",children:h}),e.jsx(o.Typography,{variant:"caption",className:"text-white/70",children:_})]}),e.jsx(g.Button,{variant:"ghost",size:"sm",onClick:H,className:"!text-white hover:!bg-white/10",children:e.jsx(l.BearIcons.XIcon,{size:18})})]}),e.jsx($.Chat,{messages:k,onSend:j,isLoading:b,isTyping:S,showAvatars:!1,height:t.CHAT_WINDOW_SIZE.height-140,className:"!rounded-none !border-0"}),A&&e.jsx("div",{className:"px-3 py-2 text-center border-t border-gray-200 dark:border-gray-700",children:e.jsxs(o.Typography,{variant:"caption",className:"opacity-50",children:["Powered by ",A]})})]}),e.jsx("div",{className:"fixed z-50",style:z,children:T?e.jsx("div",{onClick:I,children:T}):e.jsxs("div",{className:"relative",children:[e.jsx(g.Button,{variant:"primary",onClick:I,className:r.cn("!w-14 !h-14 !rounded-full !p-0 shadow-lg","transition-transform duration-200",a&&"rotate-180"),children:a?e.jsx(l.BearIcons.XIcon,{size:24}):e.jsx(l.BearIcons.ChatIcon,{size:24})}),!a&&i&&i>0&&e.jsx(M.Badge,{variant:"danger",size:"sm",className:"absolute -top-1 -right-1 !min-w-[20px] !h-5",children:i>99?"99+":i})]})})]});return typeof document>"u"?null:G.createPortal(W,document.body)};exports.FloatingChat=Z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={POSITION:"bottom-right",BOTTOM:20,SIDE:20,TITLE:"Chat",SUBTITLE:"We typically reply in a few minutes",WELCOME_MESSAGE:"Hi! How can we help you today?"},T={width:380,height:520};exports.CHAT_WINDOW_SIZE=T;exports.FLOATING_CHAT_DEFAULTS=t;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const FLOATING_CHAT_DEFAULTS: {
|
|
2
|
+
readonly POSITION: "bottom-right";
|
|
3
|
+
readonly BOTTOM: 20;
|
|
4
|
+
readonly SIDE: 20;
|
|
5
|
+
readonly TITLE: "Chat";
|
|
6
|
+
readonly SUBTITLE: "We typically reply in a few minutes";
|
|
7
|
+
readonly WELCOME_MESSAGE: "Hi! How can we help you today?";
|
|
8
|
+
};
|
|
9
|
+
export declare const CHAT_WINDOW_SIZE: {
|
|
10
|
+
readonly width: 380;
|
|
11
|
+
readonly height: 520;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
POSITION: "bottom-right",
|
|
3
|
+
BOTTOM: 20,
|
|
4
|
+
SIDE: 20,
|
|
5
|
+
TITLE: "Chat",
|
|
6
|
+
SUBTITLE: "We typically reply in a few minutes",
|
|
7
|
+
WELCOME_MESSAGE: "Hi! How can we help you today?"
|
|
8
|
+
}, T = {
|
|
9
|
+
width: 380,
|
|
10
|
+
height: 520
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
T as CHAT_WINDOW_SIZE,
|
|
14
|
+
t as FLOATING_CHAT_DEFAULTS
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { FloatingChatProps } from './FloatingChat.types';
|
|
3
|
+
/**
|
|
4
|
+
* FloatingChat - Floating chat widget bubble
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <FloatingChat
|
|
9
|
+
* messages={messages}
|
|
10
|
+
* onSend={handleSend}
|
|
11
|
+
* title="Support"
|
|
12
|
+
* subtitle="We're here to help!"
|
|
13
|
+
* position="bottom-right"
|
|
14
|
+
* badgeCount={2}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare const FloatingChat: FC<FloatingChatProps>;
|
|
19
|
+
export default FloatingChat;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsxs as r, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as I, useCallback as S } from "react";
|
|
3
|
+
import { createPortal as Z } from "react-dom";
|
|
4
|
+
import { cn as s } from "../../utils/cn.js";
|
|
5
|
+
import { useBear as q } from "../../context/BearProvider.js";
|
|
6
|
+
import { Button as A } from "../Button/Button.js";
|
|
7
|
+
import { Avatar as J } from "../Avatar/Avatar.js";
|
|
8
|
+
import { Typography as c } from "../Typography/Typography.js";
|
|
9
|
+
import { Badge as K } from "../Badge/Badge.js";
|
|
10
|
+
import { BearIcons as n } from "../Icon/index.js";
|
|
11
|
+
import { Chat as O } from "../Chat/Chat.js";
|
|
12
|
+
import { FLOATING_CHAT_DEFAULTS as a, CHAT_WINDOW_SIZE as m } from "./FloatingChat.const.js";
|
|
13
|
+
const lt = ({
|
|
14
|
+
messages: d,
|
|
15
|
+
onSend: E,
|
|
16
|
+
isLoading: z = !1,
|
|
17
|
+
isTyping: k = !1,
|
|
18
|
+
title: h = a.TITLE,
|
|
19
|
+
subtitle: B = a.SUBTITLE,
|
|
20
|
+
avatar: D,
|
|
21
|
+
position: f = a.POSITION,
|
|
22
|
+
bottom: p = a.BOTTOM,
|
|
23
|
+
side: v = a.SIDE,
|
|
24
|
+
defaultOpen: L = !1,
|
|
25
|
+
open: _,
|
|
26
|
+
onOpenChange: e,
|
|
27
|
+
trigger: y,
|
|
28
|
+
badgeCount: o,
|
|
29
|
+
header: x,
|
|
30
|
+
welcomeMessage: u = a.WELCOME_MESSAGE,
|
|
31
|
+
poweredBy: N,
|
|
32
|
+
className: F,
|
|
33
|
+
testId: W
|
|
34
|
+
}) => {
|
|
35
|
+
const { mode: $ } = q(), M = $ === "dark", [P, b] = I(L), [w, l] = I(!1), i = _ ?? P, g = S(() => {
|
|
36
|
+
const T = !i;
|
|
37
|
+
l(!0), b(T), e == null || e(T), setTimeout(() => l(!1), 300);
|
|
38
|
+
}, [i, e]), j = S(() => {
|
|
39
|
+
l(!0), b(!1), e == null || e(!1), setTimeout(() => l(!1), 300);
|
|
40
|
+
}, [e]), G = d.length === 0 && u ? [{ id: "welcome", content: u, sender: "bot", timestamp: /* @__PURE__ */ new Date() }] : d, H = {
|
|
41
|
+
bottom: `${p}px`,
|
|
42
|
+
[f === "bottom-right" ? "right" : "left"]: `${v}px`
|
|
43
|
+
}, U = {
|
|
44
|
+
bottom: `${p + 70}px`,
|
|
45
|
+
[f === "bottom-right" ? "right" : "left"]: `${v}px`,
|
|
46
|
+
width: m.width,
|
|
47
|
+
height: m.height
|
|
48
|
+
}, X = /* @__PURE__ */ r("div", { className: s("Bear-FloatingChat", F), "data-testid": W, children: [
|
|
49
|
+
(i || w) && /* @__PURE__ */ r(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
className: s(
|
|
53
|
+
"fixed z-50 rounded-2xl overflow-hidden shadow-2xl",
|
|
54
|
+
"transition-all duration-300 ease-out",
|
|
55
|
+
i && !w ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-4 scale-95 pointer-events-none"
|
|
56
|
+
),
|
|
57
|
+
style: U,
|
|
58
|
+
children: [
|
|
59
|
+
x ? /* @__PURE__ */ t("div", { className: s(
|
|
60
|
+
"px-4 py-3",
|
|
61
|
+
M ? "bg-gray-800" : "bg-[var(--bear-primary-500)]"
|
|
62
|
+
), children: x }) : /* @__PURE__ */ r(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: s(
|
|
66
|
+
"px-4 py-3 flex items-center gap-3",
|
|
67
|
+
"bg-[var(--bear-primary-500)] text-white"
|
|
68
|
+
),
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
J,
|
|
72
|
+
{
|
|
73
|
+
src: D,
|
|
74
|
+
initials: h[0],
|
|
75
|
+
size: "sm",
|
|
76
|
+
className: "ring-2 ring-white/20"
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
80
|
+
/* @__PURE__ */ t(c, { variant: "subtitle2", className: "text-white font-semibold", children: h }),
|
|
81
|
+
/* @__PURE__ */ t(c, { variant: "caption", className: "text-white/70", children: B })
|
|
82
|
+
] }),
|
|
83
|
+
/* @__PURE__ */ t(
|
|
84
|
+
A,
|
|
85
|
+
{
|
|
86
|
+
variant: "ghost",
|
|
87
|
+
size: "sm",
|
|
88
|
+
onClick: j,
|
|
89
|
+
className: "!text-white hover:!bg-white/10",
|
|
90
|
+
children: /* @__PURE__ */ t(n.XIcon, { size: 18 })
|
|
91
|
+
}
|
|
92
|
+
)
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ t(
|
|
97
|
+
O,
|
|
98
|
+
{
|
|
99
|
+
messages: G,
|
|
100
|
+
onSend: E,
|
|
101
|
+
isLoading: z,
|
|
102
|
+
isTyping: k,
|
|
103
|
+
showAvatars: !1,
|
|
104
|
+
height: m.height - 140,
|
|
105
|
+
className: "!rounded-none !border-0"
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
N && /* @__PURE__ */ t("div", { className: "px-3 py-2 text-center border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ r(c, { variant: "caption", className: "opacity-50", children: [
|
|
109
|
+
"Powered by ",
|
|
110
|
+
N
|
|
111
|
+
] }) })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
/* @__PURE__ */ t("div", { className: "fixed z-50", style: H, children: y ? /* @__PURE__ */ t("div", { onClick: g, children: y }) : /* @__PURE__ */ r("div", { className: "relative", children: [
|
|
116
|
+
/* @__PURE__ */ t(
|
|
117
|
+
A,
|
|
118
|
+
{
|
|
119
|
+
variant: "primary",
|
|
120
|
+
onClick: g,
|
|
121
|
+
className: s(
|
|
122
|
+
"!w-14 !h-14 !rounded-full !p-0 shadow-lg",
|
|
123
|
+
"transition-transform duration-200",
|
|
124
|
+
i && "rotate-180"
|
|
125
|
+
),
|
|
126
|
+
children: i ? /* @__PURE__ */ t(n.XIcon, { size: 24 }) : /* @__PURE__ */ t(n.ChatIcon, { size: 24 })
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
!i && o && o > 0 && /* @__PURE__ */ t(
|
|
130
|
+
K,
|
|
131
|
+
{
|
|
132
|
+
variant: "danger",
|
|
133
|
+
size: "sm",
|
|
134
|
+
className: "absolute -top-1 -right-1 !min-w-[20px] !h-5",
|
|
135
|
+
children: o > 99 ? "99+" : o
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
] }) })
|
|
139
|
+
] });
|
|
140
|
+
return typeof document > "u" ? null : Z(X, document.body);
|
|
141
|
+
};
|
|
142
|
+
export {
|
|
143
|
+
lt as FloatingChat
|
|
144
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChatMessage } from '../Chat/Chat.types';
|
|
3
|
+
export interface FloatingChatProps {
|
|
4
|
+
/** Chat messages */
|
|
5
|
+
messages: ChatMessage[];
|
|
6
|
+
/** Callback when user sends a message */
|
|
7
|
+
onSend?: (message: string) => void;
|
|
8
|
+
/** Loading state */
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
/** Typing indicator */
|
|
11
|
+
isTyping?: boolean;
|
|
12
|
+
/** Chat title */
|
|
13
|
+
title?: string;
|
|
14
|
+
/** Chat subtitle */
|
|
15
|
+
subtitle?: string;
|
|
16
|
+
/** Avatar URL */
|
|
17
|
+
avatar?: string;
|
|
18
|
+
/** Position on screen */
|
|
19
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
20
|
+
/** Distance from bottom */
|
|
21
|
+
bottom?: number;
|
|
22
|
+
/** Distance from side */
|
|
23
|
+
side?: number;
|
|
24
|
+
/** Initial open state */
|
|
25
|
+
defaultOpen?: boolean;
|
|
26
|
+
/** Controlled open state */
|
|
27
|
+
open?: boolean;
|
|
28
|
+
/** Callback when open state changes */
|
|
29
|
+
onOpenChange?: (open: boolean) => void;
|
|
30
|
+
/** Custom trigger button */
|
|
31
|
+
trigger?: ReactNode;
|
|
32
|
+
/** Badge count (e.g., unread messages) */
|
|
33
|
+
badgeCount?: number;
|
|
34
|
+
/** Header content */
|
|
35
|
+
header?: ReactNode;
|
|
36
|
+
/** Welcome message */
|
|
37
|
+
welcomeMessage?: string;
|
|
38
|
+
/** Show powered by */
|
|
39
|
+
poweredBy?: string;
|
|
40
|
+
/** Custom class name */
|
|
41
|
+
className?: string;
|
|
42
|
+
/** Test ID */
|
|
43
|
+
testId?: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),s=require("react"),b=require("../../utils/cn.cjs"),e=require("./GradientText.const.cjs"),I=c=>{const{children:d,preset:i="primary",colors:t,direction:a="to-r",animate:r=!1,animationSpeed:l=e.DEFAULT_ANIMATION_SPEED,as:T="span",weight:u="bold",className:E,style:g,testId:m}=c,n=s.useMemo(()=>t&&t.length>0?t:e.GRADIENT_PRESETS[i]??e.GRADIENT_PRESETS.primary,[t,i]),A=s.useMemo(()=>{const o=e.DIRECTION_MAP[a]??"to right";if(!r)return`linear-gradient(${o}, ${n.join(", ")})`;const S=Array.from({length:e.COLOR_REPEAT_COUNT},()=>n).flat();return`linear-gradient(${o}, ${S.join(", ")})`},[n,a,r]);return _.jsx(T,{className:b.cn("Bear-GradientText","bear-inline-block",r&&"Bear-GradientText--animated",E),style:{background:A,backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",fontWeight:e.WEIGHT_MAP[u]??e.DEFAULT_WEIGHT,...r&&{backgroundSize:e.ANIMATED_BG_SIZE,animation:`bear-gradient-shift ${l}s ease infinite`},...g},"data-testid":m,children:d})};exports.GradientText=I;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t={primary:["var(--bear-primary-400, #f472b6)","var(--bear-primary-600, #db2777)"],sunset:["#f97316","#ef4444","#ec4899"],ocean:["#06b6d4","#3b82f6","#8b5cf6"],forest:["#22c55e","#10b981","#14b8a6"],fire:["#fbbf24","#f97316","#ef4444"],purple:["#a855f7","#7c3aed","#6366f1"],neon:["#22d3ee","#a78bfa","#f472b6"],candy:["#f472b6","#fb923c","#fbbf24"],aurora:["#34d399","#22d3ee","#818cf8","#c084fc"],midnight:["#6366f1","#8b5cf6","#a78bfa"]},o={"to-r":"to right","to-l":"to left","to-t":"to top","to-b":"to bottom","to-tr":"to top right","to-tl":"to top left","to-br":"to bottom right","to-bl":"to bottom left"},b=3,e="200% 200%",f={normal:400,medium:500,semibold:600,bold:700,extrabold:800},E=700,r=3;exports.ANIMATED_BG_SIZE=e;exports.COLOR_REPEAT_COUNT=r;exports.DEFAULT_ANIMATION_SPEED=b;exports.DEFAULT_WEIGHT=E;exports.DIRECTION_MAP=o;exports.GRADIENT_PRESETS=t;exports.WEIGHT_MAP=f;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { GradientPreset, GradientDirection } from './GradientText.types';
|
|
2
|
+
/** Gradient presets — primary uses CSS variables for theme integration */
|
|
3
|
+
export declare const GRADIENT_PRESETS: Record<GradientPreset, string[]>;
|
|
4
|
+
/** Direction to CSS gradient mapping */
|
|
5
|
+
export declare const DIRECTION_MAP: Record<GradientDirection, string>;
|
|
6
|
+
/** Default animation speed in seconds */
|
|
7
|
+
export declare const DEFAULT_ANIMATION_SPEED = 3;
|
|
8
|
+
/** Animated background size */
|
|
9
|
+
export declare const ANIMATED_BG_SIZE = "200% 200%";
|
|
10
|
+
/** Font weight map */
|
|
11
|
+
export declare const WEIGHT_MAP: Record<string, number>;
|
|
12
|
+
/** Default font weight */
|
|
13
|
+
export declare const DEFAULT_WEIGHT = 700;
|
|
14
|
+
/** Number of color repetitions for seamless animation */
|
|
15
|
+
export declare const COLOR_REPEAT_COUNT = 3;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const t = {
|
|
2
|
+
primary: ["var(--bear-primary-400, #f472b6)", "var(--bear-primary-600, #db2777)"],
|
|
3
|
+
sunset: ["#f97316", "#ef4444", "#ec4899"],
|
|
4
|
+
ocean: ["#06b6d4", "#3b82f6", "#8b5cf6"],
|
|
5
|
+
forest: ["#22c55e", "#10b981", "#14b8a6"],
|
|
6
|
+
fire: ["#fbbf24", "#f97316", "#ef4444"],
|
|
7
|
+
purple: ["#a855f7", "#7c3aed", "#6366f1"],
|
|
8
|
+
neon: ["#22d3ee", "#a78bfa", "#f472b6"],
|
|
9
|
+
candy: ["#f472b6", "#fb923c", "#fbbf24"],
|
|
10
|
+
aurora: ["#34d399", "#22d3ee", "#818cf8", "#c084fc"],
|
|
11
|
+
midnight: ["#6366f1", "#8b5cf6", "#a78bfa"]
|
|
12
|
+
}, o = {
|
|
13
|
+
"to-r": "to right",
|
|
14
|
+
"to-l": "to left",
|
|
15
|
+
"to-t": "to top",
|
|
16
|
+
"to-b": "to bottom",
|
|
17
|
+
"to-tr": "to top right",
|
|
18
|
+
"to-tl": "to top left",
|
|
19
|
+
"to-br": "to bottom right",
|
|
20
|
+
"to-bl": "to bottom left"
|
|
21
|
+
}, b = 3, f = "200% 200%", e = {
|
|
22
|
+
normal: 400,
|
|
23
|
+
medium: 500,
|
|
24
|
+
semibold: 600,
|
|
25
|
+
bold: 700,
|
|
26
|
+
extrabold: 800
|
|
27
|
+
}, r = 700, a = 3;
|
|
28
|
+
export {
|
|
29
|
+
f as ANIMATED_BG_SIZE,
|
|
30
|
+
a as COLOR_REPEAT_COUNT,
|
|
31
|
+
b as DEFAULT_ANIMATION_SPEED,
|
|
32
|
+
r as DEFAULT_WEIGHT,
|
|
33
|
+
o as DIRECTION_MAP,
|
|
34
|
+
t as GRADIENT_PRESETS,
|
|
35
|
+
e as WEIGHT_MAP
|
|
36
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { GradientTextProps } from './GradientText.types';
|
|
3
|
+
/**
|
|
4
|
+
* GradientText - Text with gradient colors.
|
|
5
|
+
* 10 built-in presets, custom colors, animation, and theme integration via BearProvider.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GradientText: FC<GradientTextProps>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as A } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as o } from "react";
|
|
3
|
+
import { cn as I } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_ANIMATION_SPEED as _, GRADIENT_PRESETS as s, DIRECTION_MAP as b, COLOR_REPEAT_COUNT as x, ANIMATED_BG_SIZE as C, WEIGHT_MAP as N, DEFAULT_WEIGHT as S } from "./GradientText.const.js";
|
|
5
|
+
const y = (l) => {
|
|
6
|
+
const {
|
|
7
|
+
children: d,
|
|
8
|
+
preset: i = "primary",
|
|
9
|
+
colors: t,
|
|
10
|
+
direction: n = "to-r",
|
|
11
|
+
animate: e = !1,
|
|
12
|
+
animationSpeed: c = _,
|
|
13
|
+
as: m = "span",
|
|
14
|
+
weight: T = "bold",
|
|
15
|
+
className: g,
|
|
16
|
+
style: p,
|
|
17
|
+
testId: E
|
|
18
|
+
} = l, r = o(() => t && t.length > 0 ? t : s[i] ?? s.primary, [t, i]), f = o(() => {
|
|
19
|
+
const a = b[n] ?? "to right";
|
|
20
|
+
if (!e) return `linear-gradient(${a}, ${r.join(", ")})`;
|
|
21
|
+
const u = Array.from({ length: x }, () => r).flat();
|
|
22
|
+
return `linear-gradient(${a}, ${u.join(", ")})`;
|
|
23
|
+
}, [r, n, e]);
|
|
24
|
+
return /* @__PURE__ */ A(
|
|
25
|
+
m,
|
|
26
|
+
{
|
|
27
|
+
className: I(
|
|
28
|
+
"Bear-GradientText",
|
|
29
|
+
"bear-inline-block",
|
|
30
|
+
e && "Bear-GradientText--animated",
|
|
31
|
+
g
|
|
32
|
+
),
|
|
33
|
+
style: {
|
|
34
|
+
background: f,
|
|
35
|
+
backgroundClip: "text",
|
|
36
|
+
WebkitBackgroundClip: "text",
|
|
37
|
+
WebkitTextFillColor: "transparent",
|
|
38
|
+
fontWeight: N[T] ?? S,
|
|
39
|
+
...e && {
|
|
40
|
+
backgroundSize: C,
|
|
41
|
+
animation: `bear-gradient-shift ${c}s ease infinite`
|
|
42
|
+
},
|
|
43
|
+
...p
|
|
44
|
+
},
|
|
45
|
+
"data-testid": E,
|
|
46
|
+
children: d
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
};
|
|
50
|
+
export {
|
|
51
|
+
y as GradientText
|
|
52
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type GradientDirection = 'to-r' | 'to-l' | 'to-t' | 'to-b' | 'to-tr' | 'to-tl' | 'to-br' | 'to-bl';
|
|
3
|
+
export type GradientPreset = 'primary' | 'sunset' | 'ocean' | 'forest' | 'fire' | 'purple' | 'neon' | 'candy' | 'aurora' | 'midnight';
|
|
4
|
+
export interface GradientTextProps {
|
|
5
|
+
/** Content to render with gradient */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Gradient preset name */
|
|
8
|
+
preset?: GradientPreset | (string & {});
|
|
9
|
+
/** Custom colors array (overrides preset) */
|
|
10
|
+
colors?: string[];
|
|
11
|
+
/** Gradient direction */
|
|
12
|
+
direction?: GradientDirection;
|
|
13
|
+
/** Whether to animate the gradient */
|
|
14
|
+
animate?: boolean;
|
|
15
|
+
/** Animation speed in seconds */
|
|
16
|
+
animationSpeed?: number;
|
|
17
|
+
/** HTML tag to render */
|
|
18
|
+
as?: 'span' | 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'div';
|
|
19
|
+
/** Font weight */
|
|
20
|
+
weight?: 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold';
|
|
21
|
+
/** Custom class name */
|
|
22
|
+
className?: string;
|
|
23
|
+
/** Custom style */
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
/** Test ID */
|
|
26
|
+
testId?: string;
|
|
27
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),h=require("react"),u=require("../../utils/cn.cjs"),e=require("./Highlight.const.cjs"),t=h.forwardRef((r,s)=>{const{children:i,color:a=e.DEFAULT_COLOR,animated:n=!1,className:c,testId:o,...l}=r,g=e.HIGHLIGHT_COLOR_CLASSES[a]??e.HIGHLIGHT_COLOR_CLASSES[e.DEFAULT_COLOR];return d.jsx("span",{ref:s,className:u.cn("Bear-Highlight","bear-px-1 bear-rounded",g,n&&"bear-animate-pulse",c),"data-testid":o,...l,children:i})});t.displayName="Highlight";exports.Highlight=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={primary:"bear-bg-[var(--bear-primary-100,#fce7f3)] dark:bear-bg-[var(--bear-primary-900,#831843)]/30",yellow:"bear-bg-yellow-200 dark:bear-bg-yellow-500/30",pink:"bear-bg-pink-200 dark:bear-bg-pink-500/30",blue:"bear-bg-blue-200 dark:bear-bg-blue-500/30",green:"bear-bg-green-200 dark:bear-bg-green-500/30",purple:"bear-bg-purple-200 dark:bear-bg-purple-500/30",orange:"bear-bg-orange-200 dark:bear-bg-orange-500/30",red:"bear-bg-red-200 dark:bear-bg-red-500/30",cyan:"bear-bg-cyan-200 dark:bear-bg-cyan-500/30"},e="yellow";exports.DEFAULT_COLOR=e;exports.HIGHLIGHT_COLOR_CLASSES=r;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HighlightColor } from './Highlight.types';
|
|
2
|
+
/**
|
|
3
|
+
* Highlight color classes — uses CSS variables for theme integration.
|
|
4
|
+
* 'primary' maps to BearProvider's primary color.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HIGHLIGHT_COLOR_CLASSES: Record<HighlightColor, string>;
|
|
7
|
+
/** Default highlight color */
|
|
8
|
+
export declare const DEFAULT_COLOR: HighlightColor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
primary: "bear-bg-[var(--bear-primary-100,#fce7f3)] dark:bear-bg-[var(--bear-primary-900,#831843)]/30",
|
|
3
|
+
yellow: "bear-bg-yellow-200 dark:bear-bg-yellow-500/30",
|
|
4
|
+
pink: "bear-bg-pink-200 dark:bear-bg-pink-500/30",
|
|
5
|
+
blue: "bear-bg-blue-200 dark:bear-bg-blue-500/30",
|
|
6
|
+
green: "bear-bg-green-200 dark:bear-bg-green-500/30",
|
|
7
|
+
purple: "bear-bg-purple-200 dark:bear-bg-purple-500/30",
|
|
8
|
+
orange: "bear-bg-orange-200 dark:bear-bg-orange-500/30",
|
|
9
|
+
red: "bear-bg-red-200 dark:bear-bg-red-500/30",
|
|
10
|
+
cyan: "bear-bg-cyan-200 dark:bear-bg-cyan-500/30"
|
|
11
|
+
}, e = "yellow";
|
|
12
|
+
export {
|
|
13
|
+
e as DEFAULT_COLOR,
|
|
14
|
+
r as HIGHLIGHT_COLOR_CLASSES
|
|
15
|
+
};
|