@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,2 +1,6 @@
|
|
|
1
1
|
import { HighlightProps } from './Highlight.types';
|
|
2
|
+
/**
|
|
3
|
+
* Highlight - Inline text highlight with theme-aware colors.
|
|
4
|
+
* 'primary' color uses BearProvider's primary palette.
|
|
5
|
+
*/
|
|
2
6
|
export declare const Highlight: import('react').ForwardRefExoticComponent<HighlightProps & import('react').RefAttributes<HTMLSpanElement>>;
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
import { cn as f } from "../../utils/cn.js";
|
|
4
|
+
import { DEFAULT_COLOR as r, HIGHLIGHT_COLOR_CLASSES as t } from "./Highlight.const.js";
|
|
5
|
+
const h = p(
|
|
6
|
+
(a, e) => {
|
|
7
|
+
const {
|
|
8
|
+
children: o,
|
|
9
|
+
color: s = r,
|
|
10
|
+
animated: i = !1,
|
|
11
|
+
className: m,
|
|
12
|
+
testId: l,
|
|
13
|
+
...n
|
|
14
|
+
} = a, c = t[s] ?? t[r];
|
|
15
|
+
return /* @__PURE__ */ d(
|
|
16
|
+
"span",
|
|
17
|
+
{
|
|
18
|
+
ref: e,
|
|
19
|
+
className: f(
|
|
20
|
+
"Bear-Highlight",
|
|
21
|
+
"bear-px-1 bear-rounded",
|
|
22
|
+
c,
|
|
23
|
+
i && "bear-animate-pulse",
|
|
24
|
+
m
|
|
25
|
+
),
|
|
26
|
+
"data-testid": l,
|
|
27
|
+
...n,
|
|
28
|
+
children: o
|
|
29
|
+
}
|
|
30
|
+
);
|
|
23
31
|
}
|
|
24
|
-
)
|
|
25
|
-
|
|
32
|
+
);
|
|
33
|
+
h.displayName = "Highlight";
|
|
26
34
|
export {
|
|
27
|
-
|
|
35
|
+
h as Highlight
|
|
28
36
|
};
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type HighlightColor = 'primary' | 'yellow' | 'pink' | 'blue' | 'green' | 'purple' | 'orange' | 'red' | 'cyan';
|
|
2
3
|
export interface HighlightProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** Content to highlight */
|
|
3
5
|
children?: ReactNode;
|
|
4
|
-
|
|
6
|
+
/** Highlight color — 'primary' uses theme color from BearProvider */
|
|
7
|
+
color?: HighlightColor;
|
|
8
|
+
/** Whether to animate with pulse */
|
|
5
9
|
animated?: boolean;
|
|
10
|
+
/** Additional class name */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Test ID */
|
|
13
|
+
testId?: string;
|
|
6
14
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Highlight } from './Highlight';
|
|
2
|
-
export type { HighlightProps } from './Highlight.types';
|
|
2
|
+
export type { HighlightProps, HighlightColor } from './Highlight.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("../../utils/cn.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("../../utils/cn.cjs");require("react");const d={xs:12,sm:16,md:20,lg:24,xl:32},m=({size:e="md",color:r="currentColor",strokeWidth:t=2,spin:o=!1,className:s,children:i,testId:a,...c})=>{const n=typeof e=="number"?e:d[e];return l.jsx("svg",{width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:r,strokeWidth:t,strokeLinecap:"round",strokeLinejoin:"round",className:u.cn("bear-inline-block bear-shrink-0",o&&"bear-animate-spin",s),"data-testid":a,...c,children:i})};exports.Icon=m;
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { cn as c } from "../../utils/cn.js";
|
|
3
|
-
|
|
3
|
+
import "react";
|
|
4
|
+
const p = {
|
|
4
5
|
xs: 12,
|
|
5
6
|
sm: 16,
|
|
6
7
|
md: 20,
|
|
7
8
|
lg: 24,
|
|
8
9
|
xl: 32
|
|
9
|
-
},
|
|
10
|
+
}, f = ({
|
|
10
11
|
size: e = "md",
|
|
11
|
-
color:
|
|
12
|
-
strokeWidth:
|
|
12
|
+
color: r = "currentColor",
|
|
13
|
+
strokeWidth: n = 2,
|
|
13
14
|
spin: t = !1,
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
15
|
+
className: i,
|
|
16
|
+
children: s,
|
|
16
17
|
testId: a,
|
|
17
|
-
...
|
|
18
|
+
...m
|
|
18
19
|
}) => {
|
|
19
|
-
const o = typeof e == "number" ? e :
|
|
20
|
-
return /* @__PURE__ */
|
|
20
|
+
const o = typeof e == "number" ? e : p[e];
|
|
21
|
+
return /* @__PURE__ */ l(
|
|
21
22
|
"svg",
|
|
22
23
|
{
|
|
23
24
|
width: o,
|
|
24
25
|
height: o,
|
|
25
26
|
viewBox: "0 0 24 24",
|
|
26
27
|
fill: "none",
|
|
27
|
-
stroke:
|
|
28
|
-
strokeWidth:
|
|
28
|
+
stroke: r,
|
|
29
|
+
strokeWidth: n,
|
|
29
30
|
strokeLinecap: "round",
|
|
30
31
|
strokeLinejoin: "round",
|
|
31
32
|
className: c(
|
|
32
33
|
"bear-inline-block bear-shrink-0",
|
|
33
34
|
t && "bear-animate-spin",
|
|
34
|
-
|
|
35
|
+
i
|
|
35
36
|
),
|
|
36
37
|
"data-testid": a,
|
|
37
|
-
...
|
|
38
|
-
children:
|
|
38
|
+
...m,
|
|
39
|
+
children: s
|
|
39
40
|
}
|
|
40
41
|
);
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
+
f as Icon
|
|
44
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");const n=require("./icons/action.cjs"),o=require("./icons/navigation.cjs"),t=require("./icons/content.cjs"),r=require("./icons/communication.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");const n=require("./icons/action.cjs"),o=require("./icons/navigation.cjs"),t=require("./icons/content.cjs"),r=require("./icons/communication.cjs"),e=require("./icons/status.cjs"),i=require("./icons/media.cjs"),s=require("./icons/editor.cjs"),c=require("./icons/misc.cjs"),I=e.CheckIcon,h=o.CloseIcon,C=n.EditIcon,v=o.ChevronDownIcon,u=o.ChevronRightIcon,a=o.ChevronLeftIcon,g=o.ChevronsLeftIcon,q=o.ChevronsRightIcon,d=c.XIcon,f={...n,...o,...t,...r,...e,...i,...s,...c,Action:n,Navigation:o,Content:t,Communication:r,Status:e,Media:i,Editor:s,Misc:c};exports.BearIcons=f;exports.CheckIcon=I;exports.ChevronDownIcon=v;exports.ChevronLeftIcon=a;exports.ChevronRightIcon=u;exports.ChevronsLeftIcon=g;exports.ChevronsRightIcon=q;exports.CloseIcon=h;exports.EditIcon=C;exports.XIcon=d;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
2
3
|
import * as o from "./icons/action.js";
|
|
3
4
|
import { EditIcon as m } from "./icons/action.js";
|
|
4
5
|
import * as n from "./icons/navigation.js";
|
|
@@ -11,7 +12,7 @@ import * as s from "./icons/media.js";
|
|
|
11
12
|
import * as i from "./icons/editor.js";
|
|
12
13
|
import * as e from "./icons/misc.js";
|
|
13
14
|
import { XIcon as $ } from "./icons/misc.js";
|
|
14
|
-
const
|
|
15
|
+
const k = p, l = a, w = m, D = I, X = h, M = C, x = f, A = v, B = $, N = {
|
|
15
16
|
// Flat access to common icons (shortcuts)
|
|
16
17
|
...o,
|
|
17
18
|
...n,
|
|
@@ -32,14 +33,14 @@ const E = p, k = a, l = m, w = I, D = h, X = C, M = f, x = v, A = $, B = {
|
|
|
32
33
|
Misc: e
|
|
33
34
|
};
|
|
34
35
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
N as BearIcons,
|
|
37
|
+
k as CheckIcon,
|
|
38
|
+
D as ChevronDownIcon,
|
|
39
|
+
M as ChevronLeftIcon,
|
|
40
|
+
X as ChevronRightIcon,
|
|
41
|
+
x as ChevronsLeftIcon,
|
|
42
|
+
A as ChevronsRightIcon,
|
|
43
|
+
l as CloseIcon,
|
|
44
|
+
w as EditIcon,
|
|
45
|
+
B as XIcon
|
|
45
46
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),S=require("../../utils/cn.cjs"),v=require("../../context/BearProvider.cjs"),A=require("../Typography/Typography.cjs"),I=require("../Button/Button.cjs"),g=require("../Icon/index.cjs"),u=require("./JsonViewer.const.cjs"),T=({name:r,value:s,path:d,depth:h,defaultExpandDepth:y,showDataTypes:j,showArrayIndices:x,onValueClick:c})=>{const[o,b]=i.useState(h<y),{mode:N}=v.useBear(),n=N==="dark"?u.DARK_THEME:u.DEFAULT_THEME,t=i.useMemo(()=>s===null?"null":Array.isArray(s)?"array":typeof s,[s]),p=t==="object"||t==="array",a=p&&Object.keys(s).length===0,f=i.useCallback(()=>{b(l=>!l)},[]),m=i.useCallback(()=>{c==null||c(d,s)},[d,s,c]),w=()=>{switch(t){case"string":return e.jsxs("span",{style:{color:n.string},className:"cursor-pointer hover:underline",onClick:m,children:['"',s,'"']});case"number":return e.jsx("span",{style:{color:n.number},className:"cursor-pointer hover:underline",onClick:m,children:String(s)});case"boolean":return e.jsx("span",{style:{color:n.boolean},className:"cursor-pointer hover:underline",onClick:m,children:String(s)});case"null":return e.jsx("span",{style:{color:n.null},className:"cursor-pointer hover:underline",onClick:m,children:"null"});default:return null}},k=()=>{if(!j)return null;const l=t==="array"?`Array(${s.length})`:t==="object"?"Object":t;return e.jsx("span",{className:"text-[10px] opacity-50 ml-1",children:l})};if(!p)return e.jsxs("div",{className:"flex items-center gap-1 py-0.5",children:[e.jsx("span",{className:"w-4"})," ",(x||typeof r=="string")&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:n.key},children:typeof r=="string"?`"${r}"`:r}),e.jsx("span",{style:{color:n.punctuation},children:":"})]}),w(),k()]});const B=Object.entries(s),q=t==="array"?"[":"{",E=t==="array"?"]":"}";return e.jsxs("div",{className:"py-0.5",children:[e.jsxs("div",{className:"flex items-center gap-1 cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 rounded px-1 -mx-1",onClick:f,children:[e.jsx("span",{className:"w-4 flex items-center justify-center text-gray-400",children:a?null:o?e.jsx(g.BearIcons.ChevronDownIcon,{size:12}):e.jsx(g.BearIcons.ChevronRightIcon,{size:12})}),(x||typeof r=="string")&&r!==""&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{color:n.key},children:typeof r=="string"?`"${r}"`:r}),e.jsx("span",{style:{color:n.punctuation},children:":"})]}),e.jsx("span",{style:{color:n.bracket},children:q}),!o&&!a&&e.jsx("span",{className:"text-gray-400 text-xs",children:"..."}),(!o||a)&&e.jsx("span",{style:{color:n.bracket},children:E}),k()]}),o&&!a&&e.jsx("div",{className:"ml-4 border-l border-gray-200 dark:border-gray-700 pl-2",children:B.map(([l,C],F)=>e.jsx(T,{name:t==="array"?F:l,value:C,path:[...d,l],depth:h+1,defaultExpandDepth:y,showDataTypes:j,showArrayIndices:x,onValueClick:c},l))}),o&&!a&&e.jsxs("div",{className:"flex items-center",children:[e.jsx("span",{className:"w-4"}),e.jsx("span",{style:{color:n.bracket},children:E})]})]})},J=({data:r,defaultExpandDepth:s=u.DEFAULT_EXPAND_DEPTH,showDataTypes:d=!1,showArrayIndices:h=!0,showCopyButton:y=!0,rootName:j="root",onValueClick:x,onCopy:c,className:o,testId:b})=>{const{mode:N}=v.useBear(),n=N==="dark"?u.DARK_THEME:u.DEFAULT_THEME,[t,p]=i.useState(!1),a=i.useCallback(async()=>{try{await navigator.clipboard.writeText(JSON.stringify(r,null,2)),p(!0),c==null||c(r),setTimeout(()=>p(!1),2e3)}catch(f){console.error("Failed to copy:",f)}},[r,c]);return e.jsxs("div",{className:S.cn("Bear-JsonViewer","rounded-lg overflow-hidden font-mono text-sm",o),style:{backgroundColor:n.background},"data-testid":b,children:[y&&e.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-gray-200 dark:border-gray-700",children:[e.jsx(A.Typography,{variant:"caption",className:"opacity-60",children:"JSON"}),e.jsx(I.Button,{variant:"ghost",size:"sm",onClick:a,className:"!py-1 !px-2 !text-xs",children:t?e.jsxs(e.Fragment,{children:[e.jsx(g.BearIcons.CheckIcon,{size:12,className:"mr-1"}),"Copied!"]}):e.jsxs(e.Fragment,{children:[e.jsx(g.BearIcons.CopyIcon,{size:12,className:"mr-1"}),"Copy"]})})]}),e.jsx("div",{className:"p-3 overflow-x-auto",children:e.jsx(T,{name:j||"",value:r,path:[],depth:0,defaultExpandDepth:s,showDataTypes:d,showArrayIndices:h,onValueClick:x})})]})};exports.JsonViewer=J;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=2,e={background:"var(--bear-bg-secondary, #f5f5f5)",string:"#22c55e",number:"#3b82f6",boolean:"#f59e0b",null:"#ef4444",key:"#ec4899",bracket:"var(--bear-text-secondary, #737373)",punctuation:"var(--bear-text-tertiary, #a3a3a3)"},r={background:"var(--bear-bg-secondary, #262626)",string:"#4ade80",number:"#60a5fa",boolean:"#fbbf24",null:"#f87171",key:"#f472b6",bracket:"var(--bear-text-secondary, #a3a3a3)",punctuation:"var(--bear-text-tertiary, #737373)"};exports.DARK_THEME=r;exports.DEFAULT_EXPAND_DEPTH=a;exports.DEFAULT_THEME=e;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const a = 2, e = {
|
|
2
|
+
background: "var(--bear-bg-secondary, #f5f5f5)",
|
|
3
|
+
string: "#22c55e",
|
|
4
|
+
number: "#3b82f6",
|
|
5
|
+
boolean: "#f59e0b",
|
|
6
|
+
null: "#ef4444",
|
|
7
|
+
key: "#ec4899",
|
|
8
|
+
bracket: "var(--bear-text-secondary, #737373)",
|
|
9
|
+
punctuation: "var(--bear-text-tertiary, #a3a3a3)"
|
|
10
|
+
}, r = {
|
|
11
|
+
background: "var(--bear-bg-secondary, #262626)",
|
|
12
|
+
string: "#4ade80",
|
|
13
|
+
number: "#60a5fa",
|
|
14
|
+
boolean: "#fbbf24",
|
|
15
|
+
null: "#f87171",
|
|
16
|
+
key: "#f472b6",
|
|
17
|
+
bracket: "var(--bear-text-secondary, #a3a3a3)",
|
|
18
|
+
punctuation: "var(--bear-text-tertiary, #737373)"
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
r as DARK_THEME,
|
|
22
|
+
a as DEFAULT_EXPAND_DEPTH,
|
|
23
|
+
e as DEFAULT_THEME
|
|
24
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { JsonViewerProps } from './JsonViewer.types';
|
|
3
|
+
/**
|
|
4
|
+
* JsonViewer - Pretty-print and explore JSON data
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```tsx
|
|
8
|
+
* <JsonViewer
|
|
9
|
+
* data={{ name: 'John', age: 30, active: true }}
|
|
10
|
+
* defaultExpandDepth={3}
|
|
11
|
+
* showDataTypes
|
|
12
|
+
* showCopyButton
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const JsonViewer: FC<JsonViewerProps>;
|
|
17
|
+
export default JsonViewer;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useCallback as v, useMemo as F } from "react";
|
|
3
|
+
import { cn as I } from "../../utils/cn.js";
|
|
4
|
+
import { useBear as T } from "../../context/BearProvider.js";
|
|
5
|
+
import { Typography as _ } from "../Typography/Typography.js";
|
|
6
|
+
import { Button as H } from "../Button/Button.js";
|
|
7
|
+
import { BearIcons as b } from "../Icon/index.js";
|
|
8
|
+
import { DARK_THEME as B, DEFAULT_THEME as C, DEFAULT_EXPAND_DEPTH as L } from "./JsonViewer.const.js";
|
|
9
|
+
const z = ({
|
|
10
|
+
name: r,
|
|
11
|
+
value: t,
|
|
12
|
+
path: d,
|
|
13
|
+
depth: h,
|
|
14
|
+
defaultExpandDepth: y,
|
|
15
|
+
showDataTypes: u,
|
|
16
|
+
showArrayIndices: p,
|
|
17
|
+
onValueClick: c
|
|
18
|
+
}) => {
|
|
19
|
+
const [l, x] = j(h < y), { mode: N } = T(), n = N === "dark" ? B : C, s = F(() => t === null ? "null" : Array.isArray(t) ? "array" : typeof t, [t]), m = s === "object" || s === "array", a = m && Object.keys(t).length === 0, k = v(() => {
|
|
20
|
+
x((i) => !i);
|
|
21
|
+
}, []), f = v(() => {
|
|
22
|
+
c == null || c(d, t);
|
|
23
|
+
}, [d, t, c]), A = () => {
|
|
24
|
+
switch (s) {
|
|
25
|
+
case "string":
|
|
26
|
+
return /* @__PURE__ */ o(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
style: { color: n.string },
|
|
30
|
+
className: "cursor-pointer hover:underline",
|
|
31
|
+
onClick: f,
|
|
32
|
+
children: [
|
|
33
|
+
'"',
|
|
34
|
+
t,
|
|
35
|
+
'"'
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
case "number":
|
|
40
|
+
return /* @__PURE__ */ e(
|
|
41
|
+
"span",
|
|
42
|
+
{
|
|
43
|
+
style: { color: n.number },
|
|
44
|
+
className: "cursor-pointer hover:underline",
|
|
45
|
+
onClick: f,
|
|
46
|
+
children: String(t)
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
case "boolean":
|
|
50
|
+
return /* @__PURE__ */ e(
|
|
51
|
+
"span",
|
|
52
|
+
{
|
|
53
|
+
style: { color: n.boolean },
|
|
54
|
+
className: "cursor-pointer hover:underline",
|
|
55
|
+
onClick: f,
|
|
56
|
+
children: String(t)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
case "null":
|
|
60
|
+
return /* @__PURE__ */ e(
|
|
61
|
+
"span",
|
|
62
|
+
{
|
|
63
|
+
style: { color: n.null },
|
|
64
|
+
className: "cursor-pointer hover:underline",
|
|
65
|
+
onClick: f,
|
|
66
|
+
children: "null"
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
default:
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}, E = () => {
|
|
73
|
+
if (!u) return null;
|
|
74
|
+
const i = s === "array" ? `Array(${t.length})` : s === "object" ? "Object" : s;
|
|
75
|
+
return /* @__PURE__ */ e("span", { className: "text-[10px] opacity-50 ml-1", children: i });
|
|
76
|
+
};
|
|
77
|
+
if (!m)
|
|
78
|
+
return /* @__PURE__ */ o("div", { className: "flex items-center gap-1 py-0.5", children: [
|
|
79
|
+
/* @__PURE__ */ e("span", { className: "w-4" }),
|
|
80
|
+
" ",
|
|
81
|
+
(p || typeof r == "string") && /* @__PURE__ */ o(g, { children: [
|
|
82
|
+
/* @__PURE__ */ e("span", { style: { color: n.key }, children: typeof r == "string" ? `"${r}"` : r }),
|
|
83
|
+
/* @__PURE__ */ e("span", { style: { color: n.punctuation }, children: ":" })
|
|
84
|
+
] }),
|
|
85
|
+
A(),
|
|
86
|
+
E()
|
|
87
|
+
] });
|
|
88
|
+
const J = Object.entries(t), O = s === "array" ? "[" : "{", w = s === "array" ? "]" : "}";
|
|
89
|
+
return /* @__PURE__ */ o("div", { className: "py-0.5", children: [
|
|
90
|
+
/* @__PURE__ */ o(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: "flex items-center gap-1 cursor-pointer hover:bg-black/5 dark:hover:bg-white/5 rounded px-1 -mx-1",
|
|
94
|
+
onClick: k,
|
|
95
|
+
children: [
|
|
96
|
+
/* @__PURE__ */ e("span", { className: "w-4 flex items-center justify-center text-gray-400", children: a ? null : l ? /* @__PURE__ */ e(b.ChevronDownIcon, { size: 12 }) : /* @__PURE__ */ e(b.ChevronRightIcon, { size: 12 }) }),
|
|
97
|
+
(p || typeof r == "string") && r !== "" && /* @__PURE__ */ o(g, { children: [
|
|
98
|
+
/* @__PURE__ */ e("span", { style: { color: n.key }, children: typeof r == "string" ? `"${r}"` : r }),
|
|
99
|
+
/* @__PURE__ */ e("span", { style: { color: n.punctuation }, children: ":" })
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ e("span", { style: { color: n.bracket }, children: O }),
|
|
102
|
+
!l && !a && /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "..." }),
|
|
103
|
+
(!l || a) && /* @__PURE__ */ e("span", { style: { color: n.bracket }, children: w }),
|
|
104
|
+
E()
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
),
|
|
108
|
+
l && !a && /* @__PURE__ */ e("div", { className: "ml-4 border-l border-gray-200 dark:border-gray-700 pl-2", children: J.map(([i, S], D) => /* @__PURE__ */ e(
|
|
109
|
+
z,
|
|
110
|
+
{
|
|
111
|
+
name: s === "array" ? D : i,
|
|
112
|
+
value: S,
|
|
113
|
+
path: [...d, i],
|
|
114
|
+
depth: h + 1,
|
|
115
|
+
defaultExpandDepth: y,
|
|
116
|
+
showDataTypes: u,
|
|
117
|
+
showArrayIndices: p,
|
|
118
|
+
onValueClick: c
|
|
119
|
+
},
|
|
120
|
+
i
|
|
121
|
+
)) }),
|
|
122
|
+
l && !a && /* @__PURE__ */ o("div", { className: "flex items-center", children: [
|
|
123
|
+
/* @__PURE__ */ e("span", { className: "w-4" }),
|
|
124
|
+
/* @__PURE__ */ e("span", { style: { color: n.bracket }, children: w })
|
|
125
|
+
] })
|
|
126
|
+
] });
|
|
127
|
+
}, G = ({
|
|
128
|
+
data: r,
|
|
129
|
+
defaultExpandDepth: t = L,
|
|
130
|
+
showDataTypes: d = !1,
|
|
131
|
+
showArrayIndices: h = !0,
|
|
132
|
+
showCopyButton: y = !0,
|
|
133
|
+
rootName: u = "root",
|
|
134
|
+
onValueClick: p,
|
|
135
|
+
onCopy: c,
|
|
136
|
+
className: l,
|
|
137
|
+
testId: x
|
|
138
|
+
}) => {
|
|
139
|
+
const { mode: N } = T(), n = N === "dark" ? B : C, [s, m] = j(!1), a = v(async () => {
|
|
140
|
+
try {
|
|
141
|
+
await navigator.clipboard.writeText(JSON.stringify(r, null, 2)), m(!0), c == null || c(r), setTimeout(() => m(!1), 2e3);
|
|
142
|
+
} catch (k) {
|
|
143
|
+
console.error("Failed to copy:", k);
|
|
144
|
+
}
|
|
145
|
+
}, [r, c]);
|
|
146
|
+
return /* @__PURE__ */ o(
|
|
147
|
+
"div",
|
|
148
|
+
{
|
|
149
|
+
className: I(
|
|
150
|
+
"Bear-JsonViewer",
|
|
151
|
+
"rounded-lg overflow-hidden font-mono text-sm",
|
|
152
|
+
l
|
|
153
|
+
),
|
|
154
|
+
style: { backgroundColor: n.background },
|
|
155
|
+
"data-testid": x,
|
|
156
|
+
children: [
|
|
157
|
+
y && /* @__PURE__ */ o("div", { className: "flex items-center justify-between px-3 py-2 border-b border-gray-200 dark:border-gray-700", children: [
|
|
158
|
+
/* @__PURE__ */ e(_, { variant: "caption", className: "opacity-60", children: "JSON" }),
|
|
159
|
+
/* @__PURE__ */ e(
|
|
160
|
+
H,
|
|
161
|
+
{
|
|
162
|
+
variant: "ghost",
|
|
163
|
+
size: "sm",
|
|
164
|
+
onClick: a,
|
|
165
|
+
className: "!py-1 !px-2 !text-xs",
|
|
166
|
+
children: s ? /* @__PURE__ */ o(g, { children: [
|
|
167
|
+
/* @__PURE__ */ e(b.CheckIcon, { size: 12, className: "mr-1" }),
|
|
168
|
+
"Copied!"
|
|
169
|
+
] }) : /* @__PURE__ */ o(g, { children: [
|
|
170
|
+
/* @__PURE__ */ e(b.CopyIcon, { size: 12, className: "mr-1" }),
|
|
171
|
+
"Copy"
|
|
172
|
+
] })
|
|
173
|
+
}
|
|
174
|
+
)
|
|
175
|
+
] }),
|
|
176
|
+
/* @__PURE__ */ e("div", { className: "p-3 overflow-x-auto", children: /* @__PURE__ */ e(
|
|
177
|
+
z,
|
|
178
|
+
{
|
|
179
|
+
name: u || "",
|
|
180
|
+
value: r,
|
|
181
|
+
path: [],
|
|
182
|
+
depth: 0,
|
|
183
|
+
defaultExpandDepth: t,
|
|
184
|
+
showDataTypes: d,
|
|
185
|
+
showArrayIndices: h,
|
|
186
|
+
onValueClick: p
|
|
187
|
+
}
|
|
188
|
+
) })
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
export {
|
|
194
|
+
G as JsonViewer
|
|
195
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JsonViewer component types
|
|
3
|
+
*/
|
|
4
|
+
export interface JsonViewerProps {
|
|
5
|
+
/** JSON data to display */
|
|
6
|
+
data: unknown;
|
|
7
|
+
/** Number of levels to expand by default (default: 2) */
|
|
8
|
+
defaultExpandDepth?: number;
|
|
9
|
+
/** Expand all nodes */
|
|
10
|
+
expandAll?: boolean;
|
|
11
|
+
/** Collapse all nodes */
|
|
12
|
+
collapseAll?: boolean;
|
|
13
|
+
/** Show data types */
|
|
14
|
+
showDataTypes?: boolean;
|
|
15
|
+
/** Show array indices */
|
|
16
|
+
showArrayIndices?: boolean;
|
|
17
|
+
/** Show copy button */
|
|
18
|
+
showCopyButton?: boolean;
|
|
19
|
+
/** Enable search */
|
|
20
|
+
enableSearch?: boolean;
|
|
21
|
+
/** Custom theme colors */
|
|
22
|
+
theme?: JsonViewerTheme;
|
|
23
|
+
/** Root name (default: 'root') */
|
|
24
|
+
rootName?: string | false;
|
|
25
|
+
/** Callback when a value is clicked */
|
|
26
|
+
onValueClick?: (path: string[], value: unknown) => void;
|
|
27
|
+
/** Callback when copied */
|
|
28
|
+
onCopy?: (value: unknown) => void;
|
|
29
|
+
/** Custom class name */
|
|
30
|
+
className?: string;
|
|
31
|
+
/** Test ID */
|
|
32
|
+
testId?: string;
|
|
33
|
+
}
|
|
34
|
+
export interface JsonViewerTheme {
|
|
35
|
+
background?: string;
|
|
36
|
+
text?: string;
|
|
37
|
+
string?: string;
|
|
38
|
+
number?: string;
|
|
39
|
+
boolean?: string;
|
|
40
|
+
null?: string;
|
|
41
|
+
key?: string;
|
|
42
|
+
bracket?: string;
|
|
43
|
+
punctuation?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface JsonNodeProps {
|
|
46
|
+
name: string | number;
|
|
47
|
+
value: unknown;
|
|
48
|
+
path: string[];
|
|
49
|
+
depth: number;
|
|
50
|
+
defaultExpandDepth: number;
|
|
51
|
+
showDataTypes: boolean;
|
|
52
|
+
showArrayIndices: boolean;
|
|
53
|
+
onValueClick?: (path: string[], value: unknown) => void;
|
|
54
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),K=require("react"),m=require("../../utils/cn.cjs");require("../../context/BearProvider.cjs");const P=require("../../hooks/useDragDrop/useDragDrop.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),K=require("react"),m=require("../../utils/cn.cjs");require("../../context/BearProvider.cjs");const P=require("../../hooks/useDragDrop/useDragDrop.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const S="bear-kanban",$=({columns:n,onColumnsChange:o,onCardMove:p,renderCard:h,renderColumnHeader:u,disabled:y=!1,className:v})=>{const w=K.useCallback((r,e,i,b,d)=>{const l=n.find(a=>a.id===r),s=n.find(a=>a.id===e);if(!l||!s)return;const f=n.map(a=>{if(a.id===r){const c=a.cards.filter((x,g)=>g!==i);return{...a,cards:c}}if(a.id===e){const c=r===e&&i<b?b-1:b,x=[...a.cards];return x.splice(Math.max(0,c),0,d),{...a,cards:x}}return a});o==null||o(f),p==null||p(d.id,r,e,i,b)},[n,o,p]),{getDragProps:N,getDropProps:j,isDragging:_,draggedId:z,dragOverId:k}=P.useDragDrop({disabled:y,dragType:S,onDrop:(r,e,i,b,d)=>{var D;const l=String(r),s=String(e),f=l.split("-")[0],a=parseInt(l.split("-")[1],10)||0,c=s.endsWith("-col")?s.replace("-col",""):s.split("-")[0],x=s.endsWith("-col")?((D=n.find(q=>q.id===c))==null?void 0:D.cards.length)??0:parseInt(s.split("-")[1],10),g=d;g!=null&&g.id&&w(f,c,a,x,g)}});return t.jsx("div",{className:m.cn("Bear-Kanban bear-flex bear-gap-4 bear-overflow-x-auto bear-pb-4",y&&"bear-opacity-50 bear-pointer-events-none",v),children:n.map(r=>t.jsxs("div",{...j(`${r.id}-col`,r,0),className:m.cn("Bear-Kanban__column bear-flex-shrink-0 bear-w-72 bear-flex bear-flex-col bear-rounded-lg bear-bg-gray-100 dark:bear-bg-zinc-800/80 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-transition-colors",k===`${r.id}-col`&&"bear-border-bear-500 bear-bg-bear-500/5"),children:[t.jsx("div",{className:"bear-px-4 bear-py-3 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700",children:u?u(r):t.jsx("h3",{className:"bear-text-sm bear-font-semibold bear-text-gray-900 dark:bear-text-white",children:r.title})}),t.jsx("div",{className:"bear-flex-1 bear-flex bear-flex-col bear-gap-2 bear-p-3 bear-min-h-[120px]",children:r.cards.map((e,i)=>{const b=`${r.id}-${i}`,d=_&&z===b;return t.jsx("div",{...j(b,e,i),...N(b,e,i),className:m.cn("Bear-Kanban__card bear-rounded-lg bear-bg-white dark:bear-bg-zinc-700/80 bear-border bear-border-gray-200 dark:bear-border-zinc-600 bear-p-3 bear-cursor-grab active:bear-cursor-grabbing bear-transition-all bear-shadow-sm",d&&"bear-opacity-50 bear-scale-95",k===b&&"bear-border-bear-500 bear-bg-bear-500/10"),children:h?h(e,r.id):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"bear-font-medium bear-text-gray-900 dark:bear-text-white",children:e.title}),e.description&&t.jsx("div",{className:"bear-text-sm bear-text-gray-600 dark:bear-text-zinc-400 bear-mt-1",children:e.description}),e.meta&&t.jsx("div",{className:"bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500 bear-mt-2",children:e.meta})]})},e.id)})})]},r.id))})};exports.Kanban=$;
|
|
@@ -3,9 +3,10 @@ import { useCallback as I } from "react";
|
|
|
3
3
|
import { cn as f } from "../../utils/cn.js";
|
|
4
4
|
import "../../context/BearProvider.js";
|
|
5
5
|
import { useDragDrop as P } from "../../hooks/useDragDrop/useDragDrop.js";
|
|
6
|
-
|
|
6
|
+
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
7
|
+
const S = "bear-kanban", R = ({
|
|
7
8
|
columns: d,
|
|
8
|
-
onColumnsChange:
|
|
9
|
+
onColumnsChange: g,
|
|
9
10
|
onCardMove: l,
|
|
10
11
|
renderCard: h,
|
|
11
12
|
renderColumnHeader: k,
|
|
@@ -13,30 +14,30 @@ const S = "bear-kanban", O = ({
|
|
|
13
14
|
className: _
|
|
14
15
|
}) => {
|
|
15
16
|
const z = I(
|
|
16
|
-
(r, e,
|
|
17
|
+
(r, e, b, t, n) => {
|
|
17
18
|
const x = d.find((a) => a.id === r), s = d.find((a) => a.id === e);
|
|
18
19
|
if (!x || !s) return;
|
|
19
20
|
const m = d.map((a) => {
|
|
20
21
|
if (a.id === r) {
|
|
21
|
-
const c = a.cards.filter((
|
|
22
|
+
const c = a.cards.filter((o, p) => p !== b);
|
|
22
23
|
return { ...a, cards: c };
|
|
23
24
|
}
|
|
24
25
|
if (a.id === e) {
|
|
25
|
-
const c = r === e &&
|
|
26
|
-
return
|
|
26
|
+
const c = r === e && b < t ? t - 1 : t, o = [...a.cards];
|
|
27
|
+
return o.splice(Math.max(0, c), 0, n), { ...a, cards: o };
|
|
27
28
|
}
|
|
28
29
|
return a;
|
|
29
30
|
});
|
|
30
|
-
|
|
31
|
+
g == null || g(m), l == null || l(n.id, r, e, b, t);
|
|
31
32
|
},
|
|
32
|
-
[d,
|
|
33
|
+
[d, g, l]
|
|
33
34
|
), { getDragProps: u, getDropProps: w, isDragging: K, draggedId: $, dragOverId: N } = P({
|
|
34
35
|
disabled: y,
|
|
35
36
|
dragType: S,
|
|
36
|
-
onDrop: (r, e,
|
|
37
|
+
onDrop: (r, e, b, t, n) => {
|
|
37
38
|
var v;
|
|
38
|
-
const x = String(r), s = String(e), m = x.split("-")[0], a = parseInt(x.split("-")[1], 10) || 0, c = s.endsWith("-col") ? s.replace("-col", "") : s.split("-")[0],
|
|
39
|
-
p != null && p.id && z(m, c, a,
|
|
39
|
+
const x = String(r), s = String(e), m = x.split("-")[0], a = parseInt(x.split("-")[1], 10) || 0, c = s.endsWith("-col") ? s.replace("-col", "") : s.split("-")[0], o = s.endsWith("-col") ? ((v = d.find((j) => j.id === c)) == null ? void 0 : v.cards.length) ?? 0 : parseInt(s.split("-")[1], 10), p = n;
|
|
40
|
+
p != null && p.id && z(m, c, a, o, p);
|
|
40
41
|
}
|
|
41
42
|
});
|
|
42
43
|
return /* @__PURE__ */ i(
|
|
@@ -57,17 +58,17 @@ const S = "bear-kanban", O = ({
|
|
|
57
58
|
),
|
|
58
59
|
children: [
|
|
59
60
|
/* @__PURE__ */ i("div", { className: "bear-px-4 bear-py-3 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700", children: k ? k(r) : /* @__PURE__ */ i("h3", { className: "bear-text-sm bear-font-semibold bear-text-gray-900 dark:bear-text-white", children: r.title }) }),
|
|
60
|
-
/* @__PURE__ */ i("div", { className: "bear-flex-1 bear-flex bear-flex-col bear-gap-2 bear-p-3 bear-min-h-[120px]", children: r.cards.map((e,
|
|
61
|
-
const
|
|
61
|
+
/* @__PURE__ */ i("div", { className: "bear-flex-1 bear-flex bear-flex-col bear-gap-2 bear-p-3 bear-min-h-[120px]", children: r.cards.map((e, b) => {
|
|
62
|
+
const t = `${r.id}-${b}`, n = K && $ === t;
|
|
62
63
|
return /* @__PURE__ */ i(
|
|
63
64
|
"div",
|
|
64
65
|
{
|
|
65
|
-
...w(
|
|
66
|
-
...u(
|
|
66
|
+
...w(t, e, b),
|
|
67
|
+
...u(t, e, b),
|
|
67
68
|
className: f(
|
|
68
69
|
"Bear-Kanban__card bear-rounded-lg bear-bg-white dark:bear-bg-zinc-700/80 bear-border bear-border-gray-200 dark:bear-border-zinc-600 bear-p-3 bear-cursor-grab active:bear-cursor-grabbing bear-transition-all bear-shadow-sm",
|
|
69
70
|
n && "bear-opacity-50 bear-scale-95",
|
|
70
|
-
N ===
|
|
71
|
+
N === t && "bear-border-bear-500 bear-bg-bear-500/10"
|
|
71
72
|
),
|
|
72
73
|
children: h ? h(e, r.id) : /* @__PURE__ */ D(B, { children: [
|
|
73
74
|
/* @__PURE__ */ i("div", { className: "bear-font-medium bear-text-gray-900 dark:bear-text-white", children: e.title }),
|
|
@@ -86,5 +87,5 @@ const S = "bear-kanban", O = ({
|
|
|
86
87
|
);
|
|
87
88
|
};
|
|
88
89
|
export {
|
|
89
|
-
|
|
90
|
+
R as Kanban
|
|
90
91
|
};
|
|
@@ -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={cmd:"⌘",command:"⌘",ctrl:"⌃",control:"⌃",alt:"⌥",option:"⌥",shift:"⇧",enter:"↵",return:"↵",tab:"⇥",backspace:"⌫",delete:"⌦",escape:"⎋",esc:"⎋",up:"↑",down:"↓",left:"←",right:"→",space:"␣"},u=({children:l,keys:r,size:b="md",variant:s="default",className:c})=>{const i={sm:"bear-text-xs bear-px-1.5 bear-py-0.5 bear-min-w-[18px]",md:"bear-text-sm bear-px-2 bear-py-1 bear-min-w-[24px]",lg:"bear-text-base bear-px-2.5 bear-py-1.5 bear-min-w-[30px]"},o={default:"bear-bg-zinc-700 bear-border-zinc-600 bear-shadow-[0_1px_0_1px_rgba(0,0,0,0.3)]",outline:"bear-bg-transparent bear-border-zinc-500",ghost:"bear-bg-zinc-800/50 bear-border-transparent"},d=(a,n,m)=>{const p=x[a.toLowerCase()]||a.toUpperCase();return e.jsxs("span",{className:"bear-inline-flex bear-items-center",children:[e.jsx("kbd",{className:t.cn("bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-border bear-font-mono bear-font-medium bear-text-zinc-300",i[b],o[s]),children:p}),!m&&e.jsx("span",{className:"bear-mx-1 bear-text-zinc-500",children:"+"})]},n)};return r&&r.length>0?e.jsx("span",{className:t.cn("bear-inline-flex bear-items-center",c),children:r.map((a,n)=>d(a,n,n===r.length-1))}):e.jsx("kbd",{className:t.cn("bear-inline-flex bear-items-center bear-justify-center bear-rounded bear-border bear-font-mono bear-font-medium bear-text-zinc-300",i[b],o[s],c),children:l})};exports.Kbd=u;
|