@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
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { jsxs as b, jsx as t, Fragment as G } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useRef as E, useCallback as D, useEffect as v, useMemo as T } from "react";
|
|
3
|
+
import { cn as m } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_PLACEHOLDER as P, DEFAULT_SHORTCUT_KEY as Y, DEFAULT_NOTHING_FOUND as z, DEFAULT_LIMIT as Q, FOCUS_DELAY as V, SPOTLIGHT_Z_INDEX as W } from "./Spotlight.const.js";
|
|
5
|
+
const X = (l, s) => {
|
|
6
|
+
var o, u;
|
|
7
|
+
const i = s.toLowerCase();
|
|
8
|
+
return !!(l.label.toLowerCase().includes(i) || (o = l.description) != null && o.toLowerCase().includes(i) || (u = l.keywords) != null && u.some((y) => y.toLowerCase().includes(i)));
|
|
9
|
+
}, I = (l, s) => {
|
|
10
|
+
if (!s) return l;
|
|
11
|
+
const i = l.toLowerCase().indexOf(s.toLowerCase());
|
|
12
|
+
return i === -1 ? l : /* @__PURE__ */ b(G, { children: [
|
|
13
|
+
l.slice(0, i),
|
|
14
|
+
/* @__PURE__ */ t("mark", { className: "Bear-Spotlight__highlight bear-bg-yellow-200 dark:bear-bg-yellow-800 bear-text-inherit bear-rounded-sm bear-px-0.5", children: l.slice(i, i + s.length) }),
|
|
15
|
+
l.slice(i + s.length)
|
|
16
|
+
] });
|
|
17
|
+
}, ee = (l) => {
|
|
18
|
+
const {
|
|
19
|
+
actions: s,
|
|
20
|
+
open: i,
|
|
21
|
+
onOpenChange: o,
|
|
22
|
+
placeholder: u = P,
|
|
23
|
+
shortcutKey: y = Y,
|
|
24
|
+
shortcutMod: N = !0,
|
|
25
|
+
nothingFoundMessage: A = z,
|
|
26
|
+
highlightMatches: S = !0,
|
|
27
|
+
limit: x = Q,
|
|
28
|
+
filter: f,
|
|
29
|
+
className: O,
|
|
30
|
+
style: M,
|
|
31
|
+
testId: F
|
|
32
|
+
} = l, [U, K] = w(!1), [n, L] = w(""), [p, h] = w(0), B = E(null), C = E(null), g = i ?? U, d = D(
|
|
33
|
+
(e) => {
|
|
34
|
+
K(e), o == null || o(e), e || (L(""), h(0));
|
|
35
|
+
},
|
|
36
|
+
[o]
|
|
37
|
+
);
|
|
38
|
+
v(() => {
|
|
39
|
+
const e = (r) => {
|
|
40
|
+
(N ? r.metaKey || r.ctrlKey : !0) && r.key.toLowerCase() === y.toLowerCase() && (r.preventDefault(), d(!g)), r.key === "Escape" && g && d(!1);
|
|
41
|
+
};
|
|
42
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
43
|
+
}, [y, N, g, d]), v(() => {
|
|
44
|
+
g && setTimeout(() => {
|
|
45
|
+
var e;
|
|
46
|
+
return (e = B.current) == null ? void 0 : e.focus();
|
|
47
|
+
}, V);
|
|
48
|
+
}, [g]);
|
|
49
|
+
const c = T(() => f ? f(n, s).slice(0, x) : n ? s.filter((e) => X(e, n)).slice(0, x) : s.slice(0, x), [s, n, f, x]), R = T(() => {
|
|
50
|
+
const e = /* @__PURE__ */ new Map();
|
|
51
|
+
return c.forEach((r) => {
|
|
52
|
+
const a = r.group || "";
|
|
53
|
+
e.has(a) || e.set(a, []), e.get(a).push(r);
|
|
54
|
+
}), e;
|
|
55
|
+
}, [c]), H = D(
|
|
56
|
+
(e) => {
|
|
57
|
+
if (e.key === "ArrowDown")
|
|
58
|
+
e.preventDefault(), h((r) => Math.min(r + 1, c.length - 1));
|
|
59
|
+
else if (e.key === "ArrowUp")
|
|
60
|
+
e.preventDefault(), h((r) => Math.max(r - 1, 0));
|
|
61
|
+
else if (e.key === "Enter" && c[p]) {
|
|
62
|
+
e.preventDefault();
|
|
63
|
+
const r = c[p];
|
|
64
|
+
r.disabled || (r.onTrigger(), d(!1));
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
[c, p, d]
|
|
68
|
+
);
|
|
69
|
+
if (v(() => {
|
|
70
|
+
const e = C.current;
|
|
71
|
+
if (!e) return;
|
|
72
|
+
const r = e.querySelector('[data-active="true"]');
|
|
73
|
+
r == null || r.scrollIntoView({ block: "nearest" });
|
|
74
|
+
}, [p]), !g) return null;
|
|
75
|
+
let k = -1;
|
|
76
|
+
return /* @__PURE__ */ b(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: m(
|
|
80
|
+
"Bear-Spotlight",
|
|
81
|
+
"bear-fixed bear-inset-0 bear-flex bear-items-start bear-justify-center bear-pt-[15vh]"
|
|
82
|
+
),
|
|
83
|
+
style: { zIndex: W },
|
|
84
|
+
"data-testid": F,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ t(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: "Bear-Spotlight__backdrop bear-absolute bear-inset-0 bear-bg-black/50 dark:bear-bg-black/70 bear-backdrop-blur-sm",
|
|
90
|
+
onClick: () => d(!1),
|
|
91
|
+
"aria-hidden": "true"
|
|
92
|
+
}
|
|
93
|
+
),
|
|
94
|
+
/* @__PURE__ */ b(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: m(
|
|
98
|
+
"Bear-Spotlight__dialog",
|
|
99
|
+
"bear-relative bear-w-full bear-max-w-[560px] bear-mx-4",
|
|
100
|
+
"bear-bg-white dark:bear-bg-gray-900",
|
|
101
|
+
"bear-rounded-xl bear-shadow-2xl",
|
|
102
|
+
"bear-border bear-border-gray-200 dark:bear-border-gray-700",
|
|
103
|
+
"bear-overflow-hidden",
|
|
104
|
+
O
|
|
105
|
+
),
|
|
106
|
+
style: M,
|
|
107
|
+
role: "dialog",
|
|
108
|
+
"aria-label": "Search",
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ b("div", { className: "Bear-Spotlight__search bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-3 bear-border-b bear-border-gray-200 dark:bear-border-gray-700", children: [
|
|
111
|
+
/* @__PURE__ */ b(
|
|
112
|
+
"svg",
|
|
113
|
+
{
|
|
114
|
+
width: 20,
|
|
115
|
+
height: 20,
|
|
116
|
+
viewBox: "0 0 24 24",
|
|
117
|
+
fill: "none",
|
|
118
|
+
stroke: "currentColor",
|
|
119
|
+
strokeWidth: 2,
|
|
120
|
+
className: "bear-text-gray-400 dark:bear-text-gray-500 bear-shrink-0",
|
|
121
|
+
children: [
|
|
122
|
+
/* @__PURE__ */ t("circle", { cx: "11", cy: "11", r: "8" }),
|
|
123
|
+
/* @__PURE__ */ t("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
/* @__PURE__ */ t(
|
|
128
|
+
"input",
|
|
129
|
+
{
|
|
130
|
+
ref: B,
|
|
131
|
+
type: "text",
|
|
132
|
+
value: n,
|
|
133
|
+
onChange: (e) => {
|
|
134
|
+
L(e.target.value), h(0);
|
|
135
|
+
},
|
|
136
|
+
onKeyDown: H,
|
|
137
|
+
placeholder: u,
|
|
138
|
+
className: m(
|
|
139
|
+
"Bear-Spotlight__input",
|
|
140
|
+
"bear-flex-1 bear-bg-transparent bear-outline-none bear-text-base",
|
|
141
|
+
"bear-text-gray-900 dark:bear-text-white",
|
|
142
|
+
"placeholder:bear-text-gray-400 dark:placeholder:bear-text-gray-500"
|
|
143
|
+
),
|
|
144
|
+
autoComplete: "off",
|
|
145
|
+
spellCheck: !1
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
/* @__PURE__ */ t("kbd", { className: "bear-hidden sm:bear-inline-flex bear-items-center bear-px-1.5 bear-py-0.5 bear-rounded bear-text-[10px] bear-font-mono bear-text-gray-400 dark:bear-text-gray-500 bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "ESC" })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ b(
|
|
151
|
+
"div",
|
|
152
|
+
{
|
|
153
|
+
ref: C,
|
|
154
|
+
className: "Bear-Spotlight__results bear-max-h-[400px] bear-overflow-y-auto bear-py-2",
|
|
155
|
+
role: "listbox",
|
|
156
|
+
children: [
|
|
157
|
+
c.length === 0 && /* @__PURE__ */ t("div", { className: "Bear-Spotlight__empty bear-px-4 bear-py-8 bear-text-center bear-text-gray-500 dark:bear-text-gray-400 bear-text-sm", children: A }),
|
|
158
|
+
Array.from(R.entries()).map(([e, r]) => /* @__PURE__ */ b("div", { className: "Bear-Spotlight__group", children: [
|
|
159
|
+
e && /* @__PURE__ */ t("div", { className: "Bear-Spotlight__group-title bear-px-4 bear-py-1.5 bear-text-xs bear-font-semibold bear-uppercase bear-tracking-wider bear-text-gray-400 dark:bear-text-gray-500", children: e }),
|
|
160
|
+
r.map((a) => {
|
|
161
|
+
k++;
|
|
162
|
+
const _ = k === p, j = k;
|
|
163
|
+
return /* @__PURE__ */ b(
|
|
164
|
+
"button",
|
|
165
|
+
{
|
|
166
|
+
className: m(
|
|
167
|
+
"Bear-Spotlight__action",
|
|
168
|
+
"bear-w-full bear-flex bear-items-center bear-gap-3 bear-px-4 bear-py-2.5 bear-text-left bear-cursor-pointer",
|
|
169
|
+
"bear-transition-colors bear-duration-100",
|
|
170
|
+
_ ? "bear-bg-gray-100 dark:bear-bg-gray-800" : "hover:bear-bg-gray-50 dark:hover:bear-bg-gray-800/50",
|
|
171
|
+
a.disabled && "bear-opacity-50 bear-cursor-not-allowed"
|
|
172
|
+
),
|
|
173
|
+
"data-active": _,
|
|
174
|
+
onMouseEnter: () => h(j),
|
|
175
|
+
onClick: () => {
|
|
176
|
+
a.disabled || (a.onTrigger(), d(!1));
|
|
177
|
+
},
|
|
178
|
+
role: "option",
|
|
179
|
+
"aria-selected": _,
|
|
180
|
+
"aria-disabled": a.disabled,
|
|
181
|
+
children: [
|
|
182
|
+
a.icon && /* @__PURE__ */ t("span", { className: "Bear-Spotlight__action-icon bear-text-gray-500 dark:bear-text-gray-400 bear-shrink-0", children: a.icon }),
|
|
183
|
+
/* @__PURE__ */ b("div", { className: "Bear-Spotlight__action-body bear-flex-1 bear-min-w-0", children: [
|
|
184
|
+
/* @__PURE__ */ t("div", { className: "Bear-Spotlight__action-label bear-text-sm bear-font-medium bear-text-gray-900 dark:bear-text-white bear-truncate", children: S ? I(a.label, n) : a.label }),
|
|
185
|
+
a.description && /* @__PURE__ */ t("div", { className: "Bear-Spotlight__action-desc bear-text-xs bear-text-gray-500 dark:bear-text-gray-400 bear-truncate", children: S ? I(a.description, n) : a.description })
|
|
186
|
+
] }),
|
|
187
|
+
a.rightSection && /* @__PURE__ */ t("span", { className: "Bear-Spotlight__action-right bear-shrink-0", children: a.rightSection })
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
a.id
|
|
191
|
+
);
|
|
192
|
+
})
|
|
193
|
+
] }, e))
|
|
194
|
+
]
|
|
195
|
+
}
|
|
196
|
+
),
|
|
197
|
+
/* @__PURE__ */ b("div", { className: "Bear-Spotlight__footer bear-border-t bear-border-gray-200 dark:bear-border-gray-700 bear-px-4 bear-py-2 bear-flex bear-items-center bear-gap-4 bear-text-[11px] bear-text-gray-400 dark:bear-text-gray-500", children: [
|
|
198
|
+
/* @__PURE__ */ b("span", { className: "bear-flex bear-items-center bear-gap-1", children: [
|
|
199
|
+
/* @__PURE__ */ t("kbd", { className: "bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "↑↓" }),
|
|
200
|
+
"navigate"
|
|
201
|
+
] }),
|
|
202
|
+
/* @__PURE__ */ b("span", { className: "bear-flex bear-items-center bear-gap-1", children: [
|
|
203
|
+
/* @__PURE__ */ t("kbd", { className: "bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "↵" }),
|
|
204
|
+
"select"
|
|
205
|
+
] }),
|
|
206
|
+
/* @__PURE__ */ b("span", { className: "bear-flex bear-items-center bear-gap-1", children: [
|
|
207
|
+
/* @__PURE__ */ t("kbd", { className: "bear-px-1 bear-rounded bear-bg-gray-100 dark:bear-bg-gray-800 bear-border bear-border-gray-200 dark:bear-border-gray-700", children: "esc" }),
|
|
208
|
+
"close"
|
|
209
|
+
] })
|
|
210
|
+
] })
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
]
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
};
|
|
218
|
+
export {
|
|
219
|
+
ee as Spotlight
|
|
220
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface SpotlightAction {
|
|
3
|
+
/** Unique ID */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Display label */
|
|
6
|
+
label: string;
|
|
7
|
+
/** Description text */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Left icon */
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
/** Right-side content (e.g. shortcut badge) */
|
|
12
|
+
rightSection?: ReactNode;
|
|
13
|
+
/** Group/category name */
|
|
14
|
+
group?: string;
|
|
15
|
+
/** Keywords for search matching */
|
|
16
|
+
keywords?: string[];
|
|
17
|
+
/** Callback when selected */
|
|
18
|
+
onTrigger: () => void;
|
|
19
|
+
/** Whether action is disabled */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** Nested actions (submenu) */
|
|
22
|
+
children?: SpotlightAction[];
|
|
23
|
+
}
|
|
24
|
+
export interface SpotlightProps {
|
|
25
|
+
/** Available actions */
|
|
26
|
+
actions: SpotlightAction[];
|
|
27
|
+
/** Whether spotlight is open */
|
|
28
|
+
open?: boolean;
|
|
29
|
+
/** Callback when open changes */
|
|
30
|
+
onOpenChange?: (open: boolean) => void;
|
|
31
|
+
/** Search placeholder */
|
|
32
|
+
placeholder?: string;
|
|
33
|
+
/** Keyboard shortcut to trigger (default: 'k') */
|
|
34
|
+
shortcutKey?: string;
|
|
35
|
+
/** Whether shortcut needs Cmd/Ctrl */
|
|
36
|
+
shortcutMod?: boolean;
|
|
37
|
+
/** Nothing found message */
|
|
38
|
+
nothingFoundMessage?: string;
|
|
39
|
+
/** Whether to highlight matches */
|
|
40
|
+
highlightMatches?: boolean;
|
|
41
|
+
/** Limit number of results */
|
|
42
|
+
limit?: number;
|
|
43
|
+
/** Custom filter function */
|
|
44
|
+
filter?: (query: string, actions: SpotlightAction[]) => SpotlightAction[];
|
|
45
|
+
/** Custom class name */
|
|
46
|
+
className?: string;
|
|
47
|
+
/** Custom style */
|
|
48
|
+
style?: React.CSSProperties;
|
|
49
|
+
/** Test ID */
|
|
50
|
+
testId?: string;
|
|
51
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("../../utils/cn.cjs");require("react");const o=({title:s,value:i,color:t="#6366f1",icon:n,onClick:r,className:a,...l})=>e.jsxs("div",{className:d.cn("relative overflow-hidden rounded-2xl p-6 transition-transform hover:scale-105 cursor-pointer",a),style:{background:`linear-gradient(135deg, ${t}dd, ${t}99)`},onClick:r,...l,children:[e.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 -mr-8 -mt-8 rounded-full opacity-20 bg-white"}),e.jsxs("div",{className:"relative z-10",children:[e.jsx("p",{className:"text-white/80 text-sm font-medium mb-1",children:s}),e.jsx("p",{className:"text-white text-3xl font-bold mb-4",children:i}),r&&e.jsxs("button",{className:"flex items-center gap-2 px-4 py-1.5 bg-white/20 hover:bg-white/30 rounded-full text-white text-sm font-medium transition-colors",children:[n,"View All"]})]})]});exports.StatCard=o;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { jsxs as e, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { cn as n } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const p = ({
|
|
4
5
|
title: l,
|
|
5
|
-
value:
|
|
6
|
+
value: o,
|
|
6
7
|
color: r = "#6366f1",
|
|
7
|
-
icon:
|
|
8
|
+
icon: s,
|
|
8
9
|
onClick: i,
|
|
9
|
-
className:
|
|
10
|
+
className: a,
|
|
10
11
|
...d
|
|
11
12
|
}) => /* @__PURE__ */ e(
|
|
12
13
|
"div",
|
|
13
14
|
{
|
|
14
15
|
className: n(
|
|
15
16
|
"relative overflow-hidden rounded-2xl p-6 transition-transform hover:scale-105 cursor-pointer",
|
|
16
|
-
|
|
17
|
+
a
|
|
17
18
|
),
|
|
18
19
|
style: { background: `linear-gradient(135deg, ${r}dd, ${r}99)` },
|
|
19
20
|
onClick: i,
|
|
@@ -22,9 +23,9 @@ const h = ({
|
|
|
22
23
|
/* @__PURE__ */ t("div", { className: "absolute top-0 right-0 w-32 h-32 -mr-8 -mt-8 rounded-full opacity-20 bg-white" }),
|
|
23
24
|
/* @__PURE__ */ e("div", { className: "relative z-10", children: [
|
|
24
25
|
/* @__PURE__ */ t("p", { className: "text-white/80 text-sm font-medium mb-1", children: l }),
|
|
25
|
-
/* @__PURE__ */ t("p", { className: "text-white text-3xl font-bold mb-4", children:
|
|
26
|
+
/* @__PURE__ */ t("p", { className: "text-white text-3xl font-bold mb-4", children: o }),
|
|
26
27
|
i && /* @__PURE__ */ e("button", { className: "flex items-center gap-2 px-4 py-1.5 bg-white/20 hover:bg-white/30 rounded-full text-white text-sm font-medium transition-colors", children: [
|
|
27
|
-
|
|
28
|
+
s,
|
|
28
29
|
"View All"
|
|
29
30
|
] })
|
|
30
31
|
] })
|
|
@@ -32,5 +33,5 @@ const h = ({
|
|
|
32
33
|
}
|
|
33
34
|
);
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
+
p as StatCard
|
|
36
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),a=require("../../utils/cn.cjs");require("react");const v=({title:u,value:t,prefix:b,suffix:l,icon:n,trend:r,description:c,loading:h=!1,precision:d=0,className:x,size:s="md",variant:m="default"})=>{const j=typeof t=="number"?t.toLocaleString(void 0,{minimumFractionDigits:d,maximumFractionDigits:d}):t,i={sm:{value:"bear-text-xl",title:"bear-text-xs",icon:"bear-w-8 bear-h-8"},md:{value:"bear-text-3xl",title:"bear-text-sm",icon:"bear-w-10 bear-h-10"},lg:{value:"bear-text-4xl",title:"bear-text-base",icon:"bear-w-12 bear-h-12"}},o={default:"",card:"bear-bg-zinc-800 bear-rounded-xl bear-p-4 bear-border bear-border-zinc-700",minimal:""};return h?e.jsx("div",{className:a.cn(o[m],x),children:e.jsxs("div",{className:"bear-animate-pulse",children:[e.jsx("div",{className:"bear-h-4 bear-w-20 bear-bg-zinc-700 bear-rounded bear-mb-2"}),e.jsx("div",{className:"bear-h-8 bear-w-32 bear-bg-zinc-700 bear-rounded"})]})}):e.jsxs("div",{className:a.cn("bear-flex bear-items-start bear-gap-3",o[m],x),children:[n&&e.jsx("div",{className:a.cn("bear-flex bear-items-center bear-justify-center bear-rounded-lg bear-bg-pink-500/20 bear-text-pink-400",i[s].icon),children:n}),e.jsxs("div",{children:[e.jsx("div",{className:a.cn("bear-text-zinc-400 bear-mb-1",i[s].title),children:u}),e.jsxs("div",{className:a.cn("bear-font-bold bear-text-white bear-flex bear-items-baseline bear-gap-1",i[s].value),children:[b&&e.jsx("span",{className:"bear-text-zinc-400",children:b}),j,l&&e.jsx("span",{className:"bear-text-zinc-400 bear-text-lg",children:l})]}),r&&e.jsxs("div",{className:a.cn("bear-flex bear-items-center bear-gap-1 bear-mt-1 bear-text-sm",r.isUpward!==!1?"bear-text-green-400":"bear-text-red-400"),children:[e.jsx("svg",{className:"bear-w-4 bear-h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:r.isUpward!==!1?"M5 10l7-7m0 0l7 7m-7-7v18":"M19 14l-7 7m0 0l-7-7m7 7V3"})}),Math.abs(r.value),"%"]}),c&&e.jsx("div",{className:"bear-text-xs bear-text-zinc-500 bear-mt-1",children:c})]})]})};exports.Statistic=v;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { cn as a } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const w = ({
|
|
4
5
|
title: u,
|
|
5
6
|
value: b,
|
|
6
7
|
prefix: l,
|
|
7
8
|
suffix: n,
|
|
8
9
|
icon: c,
|
|
9
10
|
trend: t,
|
|
10
|
-
description:
|
|
11
|
+
description: m,
|
|
11
12
|
loading: v = !1,
|
|
12
|
-
precision:
|
|
13
|
+
precision: d = 0,
|
|
13
14
|
className: o,
|
|
14
15
|
size: i = "md",
|
|
15
16
|
variant: x = "default"
|
|
16
17
|
}) => {
|
|
17
|
-
const g = typeof b == "number" ? b.toLocaleString(void 0, { minimumFractionDigits:
|
|
18
|
+
const g = typeof b == "number" ? b.toLocaleString(void 0, { minimumFractionDigits: d, maximumFractionDigits: d }) : b, s = {
|
|
18
19
|
sm: { value: "bear-text-xl", title: "bear-text-xs", icon: "bear-w-8 bear-h-8" },
|
|
19
20
|
md: { value: "bear-text-3xl", title: "bear-text-sm", icon: "bear-w-10 bear-h-10" },
|
|
20
21
|
lg: { value: "bear-text-4xl", title: "bear-text-base", icon: "bear-w-12 bear-h-12" }
|
|
@@ -46,10 +47,10 @@ const N = ({
|
|
|
46
47
|
Math.abs(t.value),
|
|
47
48
|
"%"
|
|
48
49
|
] }),
|
|
49
|
-
|
|
50
|
+
m && /* @__PURE__ */ e("div", { className: "bear-text-xs bear-text-zinc-500 bear-mt-1", children: m })
|
|
50
51
|
] })
|
|
51
52
|
] });
|
|
52
53
|
};
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
w as Statistic
|
|
55
56
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),e=require("../../utils/cn.cjs");require("react");const g="Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor-pointer",h="bear-opacity-50 bear-cursor-not-allowed",C="Bear-Switch__track bear-relative bear-inline-flex bear-items-center bear-shrink-0 bear-rounded-full bear-transition-colors bear-duration-200 focus-within:bear-ring-2 focus-within:bear-ring-pink-500 focus-within:bear-ring-offset-2 focus-within:bear-ring-offset-white dark:focus-within:bear-ring-offset-zinc-900",p="bear-bg-pink-500",E="bear-bg-gray-300 dark:bear-bg-gray-600",A="Bear-Switch__thumb bear-absolute bear-top-0.5 bear-left-0.5 bear-rounded-full bear-bg-white bear-shadow bear-transition-transform bear-duration-200 bear-flex bear-items-center bear-justify-center",y="Bear-Switch__label bear-text-sm bear-text-gray-700 dark:bear-text-gray-300",l="Bear-Switch__icon bear-flex bear-items-center bear-justify-center",j={sm:{track:"bear-w-8 bear-h-4",thumb:"bear-w-3 bear-h-3",translate:"bear-translate-x-4",iconSize:8},md:{track:"bear-w-11 bear-h-6",thumb:"bear-w-5 bear-h-5",translate:"bear-translate-x-5",iconSize:12},lg:{track:"bear-w-14 bear-h-7",thumb:"bear-w-6 bear-h-6",translate:"bear-translate-x-7",iconSize:16}},T=({label:o,checked:a=!1,onCheckedChange:t,size:u="md",disabled:s=!1,uncheckedIcon:n,checkedIcon:b,showIconsInThumb:S=!1,className:f,testId:x,id:_,...m})=>{const w=()=>{s||t==null||t(!a)},i=j[u],c=n||b;return r.jsxs("label",{id:_,"data-testid":x,className:e.cn(g,s&&h,f),children:[r.jsx("input",{type:"checkbox",checked:a,onChange:w,disabled:s,className:"bear-sr-only",...m}),r.jsxs("span",{className:e.cn(C,a?p:E,i.track),children:[c&&!S&&r.jsxs(r.Fragment,{children:[r.jsx("span",{className:e.cn(l,"bear-absolute bear-left-1",a?"bear-text-white":"bear-text-transparent","bear-transition-colors bear-duration-200"),children:b}),r.jsx("span",{className:e.cn(l,"bear-absolute bear-right-1",a?"bear-text-transparent":"bear-text-gray-600 dark:bear-text-gray-400","bear-transition-colors bear-duration-200"),children:n})]}),r.jsx("span",{className:e.cn(A,a&&i.translate,i.thumb),children:c&&S&&r.jsx("span",{className:e.cn(l,a?"bear-text-pink-500":"bear-text-gray-400"),children:a?b:n})})]}),o&&r.jsx("span",{className:y,children:o})]})};exports.Switch=T;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { jsxs as o, jsx as r, Fragment as
|
|
1
|
+
import { jsxs as o, jsx as r, Fragment as h } from "react/jsx-runtime";
|
|
2
2
|
import { cn as e } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
3
4
|
const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor-pointer", g = "bear-opacity-50 bear-cursor-not-allowed", E = "Bear-Switch__track bear-relative bear-inline-flex bear-items-center bear-shrink-0 bear-rounded-full bear-transition-colors bear-duration-200 focus-within:bear-ring-2 focus-within:bear-ring-pink-500 focus-within:bear-ring-offset-2 focus-within:bear-ring-offset-white dark:focus-within:bear-ring-offset-zinc-900", A = "bear-bg-pink-500", y = "bear-bg-gray-300 dark:bear-bg-gray-600", T = "Bear-Switch__thumb bear-absolute bear-top-0.5 bear-left-0.5 bear-rounded-full bear-bg-white bear-shadow bear-transition-transform bear-duration-200 bear-flex bear-items-center bear-justify-center", H = "Bear-Switch__label bear-text-sm bear-text-gray-700 dark:bear-text-gray-300", l = "Bear-Switch__icon bear-flex bear-items-center bear-justify-center", L = {
|
|
4
5
|
sm: {
|
|
5
6
|
track: "bear-w-8 bear-h-4",
|
|
@@ -19,7 +20,7 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
19
20
|
translate: "bear-translate-x-7",
|
|
20
21
|
iconSize: 16
|
|
21
22
|
}
|
|
22
|
-
},
|
|
23
|
+
}, W = ({
|
|
23
24
|
label: S,
|
|
24
25
|
checked: a = !1,
|
|
25
26
|
onCheckedChange: t,
|
|
@@ -30,16 +31,16 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
30
31
|
showIconsInThumb: c = !1,
|
|
31
32
|
className: m,
|
|
32
33
|
testId: u,
|
|
33
|
-
id:
|
|
34
|
-
...
|
|
34
|
+
id: p,
|
|
35
|
+
...w
|
|
35
36
|
}) => {
|
|
36
|
-
const
|
|
37
|
+
const x = () => {
|
|
37
38
|
s || t == null || t(!a);
|
|
38
39
|
}, i = L[_], f = b || n;
|
|
39
40
|
return /* @__PURE__ */ o(
|
|
40
41
|
"label",
|
|
41
42
|
{
|
|
42
|
-
id:
|
|
43
|
+
id: p,
|
|
43
44
|
"data-testid": u,
|
|
44
45
|
className: e(
|
|
45
46
|
C,
|
|
@@ -52,10 +53,10 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
52
53
|
{
|
|
53
54
|
type: "checkbox",
|
|
54
55
|
checked: a,
|
|
55
|
-
onChange:
|
|
56
|
+
onChange: x,
|
|
56
57
|
disabled: s,
|
|
57
58
|
className: "bear-sr-only",
|
|
58
|
-
...
|
|
59
|
+
...w
|
|
59
60
|
}
|
|
60
61
|
),
|
|
61
62
|
/* @__PURE__ */ o(
|
|
@@ -67,7 +68,7 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
67
68
|
i.track
|
|
68
69
|
),
|
|
69
70
|
children: [
|
|
70
|
-
f && !c && /* @__PURE__ */ o(
|
|
71
|
+
f && !c && /* @__PURE__ */ o(h, { children: [
|
|
71
72
|
/* @__PURE__ */ r("span", { className: e(
|
|
72
73
|
l,
|
|
73
74
|
"bear-absolute bear-left-1",
|
|
@@ -104,5 +105,5 @@ const C = "Bear-Switch bear-inline-flex bear-items-center bear-gap-3 bear-cursor
|
|
|
104
105
|
);
|
|
105
106
|
};
|
|
106
107
|
export {
|
|
107
|
-
|
|
108
|
+
W as Switch
|
|
108
109
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),K=require("../../utils/cn.cjs"),P=require("../Typography/Typography.cjs"),B=require("../Spinner/Spinner.cjs"),l=require("./Terminal.const.cjs"),O=({lines:m,onCommand:u,cwd:E=l.TERMINAL_DEFAULTS.CWD,user:S=l.TERMINAL_DEFAULTS.USER,host:w=l.TERMINAL_DEFAULTS.HOST,prompt:h,title:I=l.TERMINAL_DEFAULTS.TITLE,showHeader:y=!0,showLineNumbers:L=!1,showTimestamps:R=!1,readOnly:x=!1,height:f=l.TERMINAL_DEFAULTS.HEIGHT,theme:k="dark",history:A,onHistoryChange:C,autoScroll:g=!0,className:D,testId:M,isLoading:j=!1})=>{const a=l.TERMINAL_THEMES[k],[o,c]=n.useState(""),[i,p]=n.useState(-1),[_,H]=n.useState([]),r=A??_,N=C??H,T=n.useRef(null),d=n.useRef(null);n.useEffect(()=>{g&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[m,g]);const U=n.useCallback(()=>{var s;x||(s=T.current)==null||s.focus()},[x]),b=n.useCallback(()=>{o.trim()&&u&&(u(o.trim()),N([...r,o.trim()]),p(-1),c(""))},[o,u,r,N]),q=n.useCallback(s=>{if(s.key==="Enter")b();else if(s.key==="ArrowUp"){if(s.preventDefault(),r.length>0){const t=i===-1?r.length-1:Math.max(0,i-1);p(t),c(r[t])}}else if(s.key==="ArrowDown"){if(s.preventDefault(),i!==-1){const t=i+1;t>=r.length?(p(-1),c("")):(p(t),c(r[t]))}}else s.key==="c"&&s.ctrlKey&&(c(""),p(-1))},[b,r,i]),v=()=>h||e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{color:a.prompt},children:[S,"@",w]}),e.jsx("span",{className:"opacity-50",children:":"}),e.jsx("span",{className:"text-blue-400",children:E}),e.jsx("span",{className:"opacity-50",children:"$"})]}),F=(s,t)=>{const $=l.LINE_TYPE_COLORS[s.type];return e.jsxs("div",{className:"flex gap-2 py-0.5 hover:bg-white/5",children:[L&&e.jsx("span",{className:"opacity-30 w-8 text-right select-none",children:t+1}),R&&s.timestamp&&e.jsxs("span",{className:"opacity-30 select-none",children:["[",s.timestamp.toLocaleTimeString(),"]"]}),s.type==="input"?e.jsxs("div",{className:"flex gap-2",children:[e.jsx("span",{className:"flex gap-1 select-none",children:s.prefix||v()}),e.jsx("span",{children:s.content})]}):e.jsx("span",{style:{color:$},children:s.content})]},s.id)};return e.jsxs("div",{className:K.cn("Bear-Terminal","rounded-lg overflow-hidden font-mono text-sm",D),style:{backgroundColor:a.bg,color:a.text,border:`1px solid ${a.border}`,height:typeof f=="number"?`${f}px`:f},"data-testid":M,onClick:U,children:[y&&e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2",style:{backgroundColor:a.header,borderBottom:`1px solid ${a.border}`},children:[e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("div",{className:"w-3 h-3 rounded-full bg-red-500"}),e.jsx("div",{className:"w-3 h-3 rounded-full bg-yellow-500"}),e.jsx("div",{className:"w-3 h-3 rounded-full bg-green-500"})]}),e.jsx(P.Typography,{variant:"caption",className:"flex-1 text-center opacity-60",children:I}),e.jsx("div",{className:"w-14"})," "]}),e.jsxs("div",{ref:d,className:"overflow-y-auto p-4",style:{height:y?"calc(100% - 40px)":"100%"},children:[m.map((s,t)=>F(s,t)),j&&e.jsxs("div",{className:"flex items-center gap-2 py-0.5",children:[e.jsx(B.Spinner,{size:"sm"}),e.jsx("span",{className:"opacity-50",children:"Processing..."})]}),!x&&e.jsxs("div",{className:"flex gap-2 py-0.5",children:[e.jsx("span",{className:"flex gap-1 select-none",children:v()}),e.jsx("input",{ref:T,type:"text",value:o,onChange:s=>c(s.target.value),onKeyDown:q,className:"flex-1 bg-transparent outline-none caret-current",style:{color:"inherit"},autoComplete:"off",spellCheck:!1,disabled:j})]})]})]})};exports.Terminal=O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={HEIGHT:400,USER:"user",HOST:"localhost",CWD:"~",TITLE:"Terminal"},a={input:"inherit",output:"inherit",error:"#ef4444",success:"#22c55e",warning:"#f59e0b",info:"#3b82f6",system:"#a855f7"},t={dark:{bg:"#1a1a2e",text:"#eaeaea",prompt:"#22c55e",border:"#2d2d44",header:"#16162a"},light:{bg:"#fafafa",text:"#1a1a2e",prompt:"#16a34a",border:"#e5e5e5",header:"#f0f0f0"},matrix:{bg:"#0d0d0d",text:"#00ff00",prompt:"#00ff00",border:"#003300",header:"#0a0a0a"}};exports.LINE_TYPE_COLORS=a;exports.TERMINAL_DEFAULTS=e;exports.TERMINAL_THEMES=t;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TerminalLineType } from './Terminal.types';
|
|
2
|
+
export declare const TERMINAL_DEFAULTS: {
|
|
3
|
+
readonly HEIGHT: 400;
|
|
4
|
+
readonly USER: "user";
|
|
5
|
+
readonly HOST: "localhost";
|
|
6
|
+
readonly CWD: "~";
|
|
7
|
+
readonly TITLE: "Terminal";
|
|
8
|
+
};
|
|
9
|
+
export declare const LINE_TYPE_COLORS: Record<TerminalLineType, string>;
|
|
10
|
+
export declare const TERMINAL_THEMES: {
|
|
11
|
+
readonly dark: {
|
|
12
|
+
readonly bg: "#1a1a2e";
|
|
13
|
+
readonly text: "#eaeaea";
|
|
14
|
+
readonly prompt: "#22c55e";
|
|
15
|
+
readonly border: "#2d2d44";
|
|
16
|
+
readonly header: "#16162a";
|
|
17
|
+
};
|
|
18
|
+
readonly light: {
|
|
19
|
+
readonly bg: "#fafafa";
|
|
20
|
+
readonly text: "#1a1a2e";
|
|
21
|
+
readonly prompt: "#16a34a";
|
|
22
|
+
readonly border: "#e5e5e5";
|
|
23
|
+
readonly header: "#f0f0f0";
|
|
24
|
+
};
|
|
25
|
+
readonly matrix: {
|
|
26
|
+
readonly bg: "#0d0d0d";
|
|
27
|
+
readonly text: "#00ff00";
|
|
28
|
+
readonly prompt: "#00ff00";
|
|
29
|
+
readonly border: "#003300";
|
|
30
|
+
readonly header: "#0a0a0a";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const e = {
|
|
2
|
+
HEIGHT: 400,
|
|
3
|
+
USER: "user",
|
|
4
|
+
HOST: "localhost",
|
|
5
|
+
CWD: "~",
|
|
6
|
+
TITLE: "Terminal"
|
|
7
|
+
}, a = {
|
|
8
|
+
input: "inherit",
|
|
9
|
+
output: "inherit",
|
|
10
|
+
error: "#ef4444",
|
|
11
|
+
success: "#22c55e",
|
|
12
|
+
warning: "#f59e0b",
|
|
13
|
+
info: "#3b82f6",
|
|
14
|
+
system: "#a855f7"
|
|
15
|
+
}, r = {
|
|
16
|
+
dark: {
|
|
17
|
+
bg: "#1a1a2e",
|
|
18
|
+
text: "#eaeaea",
|
|
19
|
+
prompt: "#22c55e",
|
|
20
|
+
border: "#2d2d44",
|
|
21
|
+
header: "#16162a"
|
|
22
|
+
},
|
|
23
|
+
light: {
|
|
24
|
+
bg: "#fafafa",
|
|
25
|
+
text: "#1a1a2e",
|
|
26
|
+
prompt: "#16a34a",
|
|
27
|
+
border: "#e5e5e5",
|
|
28
|
+
header: "#f0f0f0"
|
|
29
|
+
},
|
|
30
|
+
matrix: {
|
|
31
|
+
bg: "#0d0d0d",
|
|
32
|
+
text: "#00ff00",
|
|
33
|
+
prompt: "#00ff00",
|
|
34
|
+
border: "#003300",
|
|
35
|
+
header: "#0a0a0a"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
a as LINE_TYPE_COLORS,
|
|
40
|
+
e as TERMINAL_DEFAULTS,
|
|
41
|
+
r as TERMINAL_THEMES
|
|
42
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { TerminalProps } from './Terminal.types';
|
|
3
|
+
/**
|
|
4
|
+
* Terminal - Console/terminal emulator component
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* const [lines, setLines] = useState<TerminalLine[]>([
|
|
9
|
+
* { id: '1', type: 'output', content: 'Welcome to Bear Terminal!' },
|
|
10
|
+
* ]);
|
|
11
|
+
*
|
|
12
|
+
* <Terminal
|
|
13
|
+
* lines={lines}
|
|
14
|
+
* onCommand={(cmd) => {
|
|
15
|
+
* setLines([
|
|
16
|
+
* ...lines,
|
|
17
|
+
* { id: Date.now().toString(), type: 'input', content: cmd },
|
|
18
|
+
* { id: (Date.now() + 1).toString(), type: 'output', content: `Executed: ${cmd}` },
|
|
19
|
+
* ]);
|
|
20
|
+
* }}
|
|
21
|
+
* user="bear"
|
|
22
|
+
* host="forge"
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare const Terminal: FC<TerminalProps>;
|
|
27
|
+
export default Terminal;
|