@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,58 +1,136 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Spinner as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as V, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as ne, useContext as oe, useRef as ae, useState as k, useCallback as g, useMemo as ie } from "react";
|
|
3
|
+
import { cn as M } from "../../utils/cn.js";
|
|
4
|
+
import { Spinner as se } from "../Spinner/Spinner.js";
|
|
5
|
+
import { Typography as le } from "../Typography/Typography.js";
|
|
6
|
+
import { useBearStyles as ce } from "../../hooks/useBearStyles.js";
|
|
7
|
+
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
8
|
+
import { BearContext as be } from "../../context/BearProvider.js";
|
|
9
|
+
import { VARIANT_DEFAULTS as z, BUTTON_VARIANT as P, BUTTON_SIZE as ue } from "./Button.constants.js";
|
|
10
|
+
const A = (h) => h in P, de = ne(
|
|
11
|
+
(h, a) => {
|
|
12
|
+
var w, T;
|
|
9
13
|
const {
|
|
10
|
-
variant:
|
|
11
|
-
size:
|
|
12
|
-
loading:
|
|
13
|
-
fullWidth:
|
|
14
|
-
icon:
|
|
15
|
-
iconPosition:
|
|
16
|
-
leftIcon:
|
|
17
|
-
rightIcon:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
variant: e = "primary",
|
|
15
|
+
size: _ = "md",
|
|
16
|
+
loading: b = !1,
|
|
17
|
+
fullWidth: E = !1,
|
|
18
|
+
icon: u,
|
|
19
|
+
iconPosition: C = "left",
|
|
20
|
+
leftIcon: j,
|
|
21
|
+
rightIcon: U,
|
|
22
|
+
spotlight: i = !1,
|
|
23
|
+
spotlightColor: D = "rgba(255, 255, 255, 0.35)",
|
|
24
|
+
spotlightSize: d = 150,
|
|
25
|
+
disabled: H,
|
|
26
|
+
className: L,
|
|
27
|
+
children: O,
|
|
28
|
+
testId: X,
|
|
29
|
+
bis: Y,
|
|
30
|
+
style: F,
|
|
31
|
+
onMouseMove: f,
|
|
32
|
+
onMouseEnter: m,
|
|
33
|
+
onMouseLeave: p,
|
|
34
|
+
...W
|
|
35
|
+
} = h, Z = H || b, B = ce(Y, F), I = j ?? (u && C === "left" ? u : void 0), N = U ?? (u && C === "right" ? u : void 0), n = oe(be), y = ((T = (w = n == null ? void 0 : n.components) == null ? void 0 : w.Button) == null ? void 0 : T.root) || {}, $ = (n == null ? void 0 : n.customVariants) || {}, v = !A(e) && e in $, r = v ? $[e] : null, s = ae(null), [S, x] = k({ x: -1e3, y: -1e3 }), [q, R] = k(!1), G = g((t) => {
|
|
36
|
+
if (i && s.current) {
|
|
37
|
+
const l = s.current.getBoundingClientRect(), te = t.clientX - l.left, re = t.clientY - l.top;
|
|
38
|
+
x({ x: te, y: re });
|
|
39
|
+
}
|
|
40
|
+
f == null || f(t);
|
|
41
|
+
}, [i, f]), J = g((t) => {
|
|
42
|
+
if (i && (R(!0), s.current)) {
|
|
43
|
+
const l = s.current.getBoundingClientRect();
|
|
44
|
+
x({
|
|
45
|
+
x: t.clientX - l.left,
|
|
46
|
+
y: t.clientY - l.top
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
m == null || m(t);
|
|
50
|
+
}, [i, m]), K = g((t) => {
|
|
51
|
+
R(!1), x({ x: -1e3, y: -1e3 }), p == null || p(t);
|
|
52
|
+
}, [p]), o = z[e] || z.primary, Q = ie(() => v && r ? {
|
|
53
|
+
backgroundColor: `var(--bear-${e}-bg, ${r.bg})`,
|
|
54
|
+
color: r.text || "#ffffff",
|
|
55
|
+
borderColor: r.border,
|
|
56
|
+
"--bear-ring-color": r.ring || r.bg,
|
|
57
|
+
...y,
|
|
58
|
+
...B
|
|
59
|
+
} : {
|
|
60
|
+
backgroundColor: `var(--bear-btn-${e}-bg, ${o.bg})`,
|
|
61
|
+
color: e === "outline" || e === "ghost" ? `var(--bear-btn-${e}-text, ${o.text || "inherit"})` : "white",
|
|
62
|
+
borderColor: e === "outline" ? `var(--bear-btn-${e}-border, ${o.border || o.bg})` : void 0,
|
|
63
|
+
"--bear-ring-color": `var(--bear-btn-${e}-ring, ${o.ring})`,
|
|
64
|
+
...y,
|
|
65
|
+
...B
|
|
66
|
+
}, [e, o, y, B, v, r]), ee = g((t) => {
|
|
67
|
+
s.current = t, typeof a == "function" ? a(t) : a && (a.current = t);
|
|
68
|
+
}, [a]);
|
|
69
|
+
return /* @__PURE__ */ V(
|
|
27
70
|
"button",
|
|
28
71
|
{
|
|
29
|
-
ref:
|
|
30
|
-
disabled:
|
|
31
|
-
style:
|
|
32
|
-
className:
|
|
72
|
+
ref: ee,
|
|
73
|
+
disabled: Z,
|
|
74
|
+
style: Q,
|
|
75
|
+
className: M(
|
|
33
76
|
"Bear-Button",
|
|
34
|
-
"bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none",
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
77
|
+
"bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none bear-relative bear-overflow-hidden",
|
|
78
|
+
ue[_],
|
|
79
|
+
// Use built-in variant classes or custom variant base classes
|
|
80
|
+
A(e) ? P[e] : "bear-btn-custom bear-text-white focus:bear-ring-2 focus:bear-ring-offset-2 disabled:bear-opacity-50 disabled:bear-cursor-not-allowed hover:bear-brightness-110 active:bear-brightness-95",
|
|
81
|
+
E && "bear-w-full",
|
|
82
|
+
b && "bear-cursor-wait",
|
|
83
|
+
L
|
|
40
84
|
),
|
|
41
|
-
"data-testid":
|
|
42
|
-
|
|
85
|
+
"data-testid": X,
|
|
86
|
+
onMouseMove: G,
|
|
87
|
+
onMouseEnter: J,
|
|
88
|
+
onMouseLeave: K,
|
|
89
|
+
...W,
|
|
43
90
|
children: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
91
|
+
i && /* @__PURE__ */ c(
|
|
92
|
+
"span",
|
|
93
|
+
{
|
|
94
|
+
className: "Bear-Button__spotlight",
|
|
95
|
+
"aria-hidden": "true",
|
|
96
|
+
style: {
|
|
97
|
+
position: "absolute",
|
|
98
|
+
pointerEvents: "none",
|
|
99
|
+
left: 0,
|
|
100
|
+
top: 0,
|
|
101
|
+
width: d,
|
|
102
|
+
height: d,
|
|
103
|
+
borderRadius: "50%",
|
|
104
|
+
background: `radial-gradient(circle at center, ${D} 0%, transparent 70%)`,
|
|
105
|
+
opacity: q ? 1 : 0,
|
|
106
|
+
transform: `translate(${S.x - d / 2}px, ${S.y - d / 2}px)`,
|
|
107
|
+
transition: "opacity 0.15s ease-out",
|
|
108
|
+
zIndex: 1,
|
|
109
|
+
mixBlendMode: "overlay"
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
b && /* @__PURE__ */ c(se, { size: _ === "xs" ? "xs" : "sm", className: "Bear-Button__spinner bear-absolute" }),
|
|
114
|
+
/* @__PURE__ */ V(
|
|
115
|
+
"span",
|
|
116
|
+
{
|
|
117
|
+
className: M(
|
|
118
|
+
"Bear-Button__content bear-inline-flex bear-items-center bear-gap-inherit bear-relative bear-z-10",
|
|
119
|
+
b && "bear-invisible"
|
|
120
|
+
),
|
|
121
|
+
children: [
|
|
122
|
+
I && /* @__PURE__ */ c("span", { className: "Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0", children: I }),
|
|
123
|
+
/* @__PURE__ */ c(le, { variant: "inherit", className: "Bear-Button__text", children: O }),
|
|
124
|
+
N && /* @__PURE__ */ c("span", { className: "Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0", children: N })
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
)
|
|
50
128
|
]
|
|
51
129
|
}
|
|
52
130
|
);
|
|
53
131
|
}
|
|
54
132
|
);
|
|
55
|
-
|
|
133
|
+
de.displayName = "Button";
|
|
56
134
|
export {
|
|
57
|
-
|
|
135
|
+
de as Button
|
|
58
136
|
};
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
import { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BearSize, BearVariant } from '../../types';
|
|
3
3
|
import { BisProp } from '../../types/bis.types';
|
|
4
4
|
export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'style'> {
|
|
5
|
-
/**
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Button variant style
|
|
7
|
+
* Can be a built-in variant or a custom variant defined in BearProvider
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* // Built-in variants
|
|
11
|
+
* <Button variant="primary">Primary</Button>
|
|
12
|
+
* <Button variant="success">Success</Button>
|
|
13
|
+
*
|
|
14
|
+
* // Custom variant (defined in BearProvider's customVariants)
|
|
15
|
+
* <Button variant="redBrand">Custom</Button>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
variant?: BearVariant | (string & {});
|
|
7
19
|
/** Button size */
|
|
8
|
-
size?:
|
|
20
|
+
size?: BearSize;
|
|
9
21
|
/** Whether button is in loading state */
|
|
10
22
|
loading?: boolean;
|
|
11
23
|
/** Whether button takes full width */
|
|
@@ -18,6 +30,12 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
|
|
|
18
30
|
leftIcon?: ReactNode;
|
|
19
31
|
/** Icon to show after text */
|
|
20
32
|
rightIcon?: ReactNode;
|
|
33
|
+
/** Enable mouse-follow spotlight hover effect */
|
|
34
|
+
spotlight?: boolean;
|
|
35
|
+
/** Spotlight color (default: rgba(255, 255, 255, 0.15)) */
|
|
36
|
+
spotlightColor?: string;
|
|
37
|
+
/** Spotlight size in pixels (default: 120) */
|
|
38
|
+
spotlightSize?: number;
|
|
21
39
|
/** Test ID for testing */
|
|
22
40
|
testId?: string;
|
|
23
41
|
/** Bear Inner Style - sx-like overrides */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),D=require("../../utils/cn.cjs"),he=require("../../hooks/useBearStyles.cjs")
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("react"),D=require("../../utils/cn.cjs"),he=require("../../hooks/useBearStyles.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const v=require("../Icon/index.cjs"),s=require("./Calendar.const.cjs"),l=require("./Calendar.utils.cjs"),xe=require("./Calendar.helpers.cjs"),ke=G=>{const{viewDate:w,value:E=null,onSelect:C,onViewChange:n,minDate:N,maxDate:_,disabledDates:M=[],highlightedDates:R=[],weekdayLabels:S=s.DEFAULT_WEEKDAYS,firstDayOfWeek:k=s.NUMBER.ZERO,showWeekNumbers:ye=!1,slots:r={},clearable:K=!0,onClear:u,showTodayButton:Z=!0,onToday:h,bis:X,style:J,inline:O=!1,className:Q}=G,b=w.getFullYear(),P=he.useBearStyles(X,J),d=w.getMonth(),$=i.useMemo(()=>new Date,[]),g=i.useCallback(()=>{n==null||n(new Date(b-s.NUMBER.ONE,d,s.NUMBER.ONE))},[b,d,n]),L=i.useCallback(()=>{n==null||n(new Date(b,d-s.NUMBER.ONE,s.NUMBER.ONE))},[b,d,n]),W=i.useCallback(()=>{n==null||n(new Date(b,d+s.NUMBER.ONE,s.NUMBER.ONE))},[b,d,n]),z=i.useCallback(()=>{n==null||n(new Date(b+s.NUMBER.ONE,d,s.NUMBER.ONE))},[b,d,n]),p=L,B=W,V={onPrevYear:g,onPrevMonth:L,onNextMonth:W,onNextYear:z},ee=i.useCallback(t=>N&&t<N||_&&t>_?!0:M.some(a=>l.isSameDay(a,t)),[N,_,M]),re=i.useCallback(t=>R.some(a=>l.isSameDay(a,t)),[R]),ae=i.useMemo(()=>l.buildCalendarGrid(b,d,k),[b,d,k]),T=i.useMemo(()=>l.reorderWeekdays(S,k),[S,k]),U=s.MONTHS[d],f=E!=null,te=O?"Bear-Calendar Bear-Calendar--inline bear-block bear-w-full bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-none bear-border bear-border-zinc-200 dark:bear-border-zinc-700 bear-p-4 bear-text-zinc-900 dark:bear-text-zinc-100":"Bear-Calendar Bear-Calendar--dropdown bear-mt-2 bear-bg-white dark:bear-bg-zinc-900 bear-rounded-xl bear-shadow-xl bear-border bear-border-zinc-200 dark:bear-border-zinc-700 bear-p-4 bear-w-80 bear-text-zinc-900 dark:bear-text-zinc-100",Y=O?void 0:{zIndex:s.CALENDAR_DROPDOWN_Z_INDEX},ne=()=>{if(r.header)return r.header({month:U,year:b,onPrev:p,onNext:B,nav:V});const t=r.navPrevYear,a=r.navPrev,o=r.navNext,c=r.navNextYear,y=r.headerLabel||xe.DefaultHeaderLabel;return e.jsxs("div",{className:"Bear-Calendar__header bear-flex bear-items-center bear-justify-between bear-gap-1 bear-mb-4",children:[e.jsxs("div",{className:"Bear-Calendar__nav-left bear-flex bear-items-center bear-gap-0.5",children:[t?t({onClick:g}):e.jsx("button",{type:"button",onClick:g,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Previous year",children:e.jsx(v.ChevronsLeftIcon,{size:16})}),a?a({onClick:p}):e.jsx("button",{type:"button",onClick:p,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Previous month",children:e.jsx(v.ChevronLeftIcon,{size:16})})]}),y({month:U,year:b}),e.jsxs("div",{className:"Bear-Calendar__nav-right bear-flex bear-items-center bear-gap-0.5",children:[o?o({onClick:B}):e.jsx("button",{type:"button",onClick:B,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Next month",children:e.jsx(v.ChevronRightIcon,{size:16})}),c?c({onClick:z}):e.jsx("button",{type:"button",onClick:z,className:"Bear-Calendar__nav-btn bear-p-1.5 bear-rounded bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800 bear-transition-colors","aria-label":"Next year",children:e.jsx(v.ChevronsRightIcon,{size:16})})]})]})},oe=()=>{if(r.weekdays)return r.weekdays({days:T});const t=r.weekday;return e.jsx("div",{className:"Bear-Calendar__weekdays bear-grid bear-grid-cols-7 bear-gap-1 bear-mb-2",children:T.map(a=>t?e.jsx("div",{children:t({label:a})},a):e.jsx("div",{className:D.cn("Bear-Calendar__weekday bear-text-center bear-text-xs bear-font-medium bear-uppercase bear-text-zinc-500 dark:bear-text-zinc-400",s.WEEKEND_LABELS.includes(a)&&"bear-text-red-500"),children:a},a))})},se=(t,a)=>{const{date:o,isCurrentMonth:c}=t,y=o.getDate(),ce=o.getDay(),le=l.isWeekendDay(ce),x=l.isSameDay(E,o),j=l.isSameDay($,o),m=ee(o),H=re(o),F=()=>{m||C==null||C(o)},ue={date:o,day:y,isCurrentMonth:c,isSelected:x,isToday:j,isDisabled:m,isHighlighted:H,onClick:F};return r.day?e.jsx("span",{children:r.day(ue)},a):e.jsx("button",{type:"button",onClick:F,disabled:m,className:D.cn("Bear-Calendar__day bear-w-8 bear-h-8 bear-rounded-full bear-text-sm bear-font-medium bear-transition-colors bear-flex bear-items-center bear-justify-center",x&&"Bear-Calendar__day--selected bear-bg-pink-500 bear-text-white hover:bear-bg-pink-600",!x&&j&&"Bear-Calendar__day--today bear-ring-2 bear-ring-pink-500/50 bear-bg-transparent",!x&&!j&&(c?le?"Bear-Calendar__day--weekend bear-text-red-500 dark:bear-text-red-400 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800":"bear-text-zinc-700 dark:bear-text-zinc-300 hover:bear-bg-zinc-100 dark:hover:bear-bg-zinc-800":"Bear-Calendar__day--other bear-text-zinc-500 dark:bear-text-zinc-600 hover:bear-bg-zinc-50 dark:hover:bear-bg-zinc-800/50"),H&&!x&&"Bear-Calendar__day--highlighted bear-bg-pink-500/15",m&&"Bear-Calendar__day--disabled bear-opacity-40 bear-cursor-not-allowed"),children:y},a)},be=()=>{const t=ae.map((a,o)=>se(a,o));return r.daysGrid?r.daysGrid({children:t,className:"Bear-Calendar__grid bear-grid bear-grid-cols-7 bear-gap-1"}):e.jsx("div",{className:"Bear-Calendar__grid bear-grid bear-grid-cols-7 bear-gap-1",children:t})},de=()=>{const t=K&&f&&u,a=Z&&h;if(!t&&!a)return null;if(r.footer){const o=r.clearButton,c=r.todayButton;return r.footer({children:e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t&&o?o({onClick:u,hasSelection:f}):t?e.jsx("button",{type:"button",onClick:u,className:"Bear-Calendar__clear-btn bear-text-sm bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-text-zinc-700 dark:hover:bear-text-zinc-200 bear-transition-colors",children:"Clear"}):e.jsx("span",{}),a&&c?c({onClick:h}):a?e.jsx("button",{type:"button",onClick:h,className:"Bear-Calendar__today-btn bear-text-sm bear-text-pink-600 dark:bear-text-pink-400 hover:bear-text-pink-700 dark:hover:bear-text-pink-300 bear-font-medium",children:"Today"}):null]})})}return r.clearButton&&r.todayButton?e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t&&r.clearButton({onClick:u,hasSelection:f}),a&&r.todayButton({onClick:h})]}):e.jsxs("div",{className:"Bear-Calendar__footer bear-flex bear-justify-between bear-gap-2 bear-mt-4 bear-pt-3 bear-border-t bear-border-zinc-200 dark:bear-border-zinc-700",children:[t?e.jsx("button",{type:"button",onClick:u,className:"Bear-Calendar__clear-btn bear-text-sm bear-text-zinc-500 dark:bear-text-zinc-400 hover:bear-text-zinc-700 dark:hover:bear-text-zinc-200 bear-transition-colors",children:"Clear"}):e.jsx("span",{}),a?e.jsx("button",{type:"button",onClick:h,className:"Bear-Calendar__today-btn bear-text-sm bear-text-pink-400 hover:bear-text-pink-300 bear-font-medium bear-transition-colors",children:"Today"}):null]})},q=e.jsxs(e.Fragment,{children:[ne(),oe(),be(),de()]}),I=D.cn(te,Q),A=Object.keys(P).length?P:void 0,ie=Y?{...A,...Y}:A;return r.root?r.root({children:q,className:I}):e.jsx("div",{className:I,style:ie,children:q})};exports.Calendar=ke;
|
|
@@ -2,11 +2,12 @@ import { jsxs as s, Fragment as me, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo as D, useCallback as l } from "react";
|
|
3
3
|
import { cn as E } from "../../utils/cn.js";
|
|
4
4
|
import { useBearStyles as ke } from "../../hooks/useBearStyles.js";
|
|
5
|
+
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
5
6
|
import { ChevronsLeftIcon as ye, ChevronLeftIcon as xe, ChevronRightIcon as ve, ChevronsRightIcon as pe } from "../Icon/index.js";
|
|
6
7
|
import { DEFAULT_WEEKDAYS as ze, NUMBER as i, CALENDAR_DROPDOWN_Z_INDEX as Ce, MONTHS as _e, WEEKEND_LABELS as ge } from "./Calendar.const.js";
|
|
7
8
|
import { isSameDay as v, buildCalendarGrid as Ne, reorderWeekdays as fe, isWeekendDay as Be } from "./Calendar.utils.js";
|
|
8
9
|
import { DefaultHeaderLabel as we } from "./Calendar.helpers.js";
|
|
9
|
-
const
|
|
10
|
+
const Ie = (Z) => {
|
|
10
11
|
const {
|
|
11
12
|
viewDate: O,
|
|
12
13
|
value: P = null,
|
|
@@ -182,5 +183,5 @@ const je = (Z) => {
|
|
|
182
183
|
return e.root ? e.root({ children: H, className: F }) : /* @__PURE__ */ t("div", { className: F, style: se, children: H });
|
|
183
184
|
};
|
|
184
185
|
export {
|
|
185
|
-
|
|
186
|
+
Ie as Calendar
|
|
186
187
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BearSize } from '../../types';
|
|
2
2
|
export type CardRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
3
|
export type CardVariant = 'elevated' | 'outlined' | 'filled' | 'ghost';
|
|
4
|
-
export declare const CARD_PADDING_CLASSES: Record<
|
|
4
|
+
export declare const CARD_PADDING_CLASSES: Record<BearSize | 'none', string>;
|
|
5
5
|
export declare const CARD_RADIUS_CLASSES: Record<CardRadius, string>;
|
|
6
6
|
export declare const CARD_VARIANT_CLASSES: Record<CardVariant, string>;
|
|
7
7
|
export declare const CARD_INTERACTIVE_CLASSES = "bear-transition-all bear-duration-200 bear-cursor-pointer hover:bear-shadow-lg hover:bear-scale-[1.02]";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { BearSize } from '../../types';
|
|
3
3
|
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
/** Card variant */
|
|
5
5
|
variant?: 'elevated' | 'outlined' | 'filled' | 'ghost';
|
|
6
6
|
/** Padding size */
|
|
7
|
-
padding?:
|
|
7
|
+
padding?: BearSize | 'none';
|
|
8
8
|
/** Whether card is interactive (adds hover effects) */
|
|
9
9
|
interactive?: boolean;
|
|
10
10
|
/** Border radius */
|
|
@@ -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"),s=require("react"),i=require("../../utils/cn.cjs"),o=require("./Carousel.const.cjs"),le=({children:z,autoPlay:y=0,showDots:B=!0,showArrows:P=!0,loop:m=!0,slidesToShow:u=1,gap:x=16,pauseOnHover:_=!0,onSlideChange:k,transition:p="slide",transitionDuration:d=o.DEFAULT_TRANSITION_DURATION,indicator:v="dots",thumbnails:E,thumbnailSize:S=o.DEFAULT_THUMBNAIL_SIZE,keyboard:w=!0,draggable:A=!0,showProgress:G=!1,showCounter:X=!1,activeColor:h=o.DEFAULT_ACTIVE_COLOR,className:Z,style:q,testId:F})=>{const[t,H]=s.useState(0),[M,R]=s.useState(!1),[$,K]=s.useState(null),[C,O]=s.useState(null),[L,U]=s.useState(!1),V=s.useRef(null),I=s.useRef(null),N=s.Children.toArray(z),f=N.length,l=Math.max(0,f-u),n=s.useCallback(a=>{if(L)return;let e=a;m?a<0?e=l:a>l&&(e=0):e=Math.max(0,Math.min(l,a)),U(!0),H(e),k==null||k(e),setTimeout(()=>U(!1),d)},[L,m,l,k,d]),b=s.useCallback(()=>n(t+1),[n,t]),c=s.useCallback(()=>n(t-1),[n,t]);s.useEffect(()=>{if(y>0&&!M)return I.current=setInterval(b,y),()=>{I.current&&clearInterval(I.current)}},[y,M,b]);const Y=s.useCallback(a=>{w&&(a.key==="ArrowLeft"?c():a.key==="ArrowRight"&&b())},[w,c,b]),J=a=>{O(null),K(a.targetTouches[0].clientX)},Q=a=>{O(a.targetTouches[0].clientX)},ee=()=>{if(!$||!C)return;const a=$-C;a>o.MIN_SWIPE_DISTANCE?b():a<-o.MIN_SWIPE_DISTANCE&&c()},[T,j]=s.useState(!1),[W,ae]=s.useState(0),re=s.useCallback(a=>{A&&(j(!0),ae(a.clientX))},[A]),te=s.useCallback(a=>{if(!T)return;j(!1);const e=W-a.clientX;e>o.MIN_SWIPE_DISTANCE?b():e<-o.MIN_SWIPE_DISTANCE&&c()},[T,W,b,c]),D=`calc((100% - ${x*(u-1)}px) / ${u})`,se=a=>{const e=a===t,g=`${d}ms`;switch(p){case"fade":return{position:"absolute",inset:0,opacity:e?1:0,transition:`opacity ${g} ease-in-out`,zIndex:e?1:0,pointerEvents:e?"auto":"none"};case"zoom":return{position:"absolute",inset:0,opacity:e?1:0,transform:e?"scale(1)":"scale(0.85)",transition:`opacity ${g} ease, transform ${g} ease`,zIndex:e?1:0,pointerEvents:e?"auto":"none"};case"flip":return{position:"absolute",inset:0,opacity:e?1:0,transform:e?"rotateY(0deg)":"rotateY(90deg)",transition:`opacity ${g} ease, transform ${g} ease`,zIndex:e?1:0,pointerEvents:e?"auto":"none",backfaceVisibility:"hidden"};case"slide":default:return{}}},oe=p==="fade"||p==="zoom"||p==="flip";return r.jsxs("div",{ref:V,className:i.cn("bear-relative bear-overflow-hidden bear-outline-none",Z),style:q,onMouseEnter:()=>_&&R(!0),onMouseLeave:()=>{_&&R(!1),T&&j(!1)},onTouchStart:J,onTouchMove:Q,onTouchEnd:ee,onMouseDown:re,onMouseUp:te,onKeyDown:Y,tabIndex:w?0:void 0,"data-testid":F,role:"region","aria-label":"Carousel","aria-roledescription":"carousel",children:[G&&y>0&&r.jsx("div",{className:"bear-absolute bear-top-0 bear-left-0 bear-right-0 bear-z-20",style:{height:o.PROGRESS_BAR_HEIGHT},children:r.jsx("div",{className:"bear-h-full bear-transition-all bear-ease-linear",style:{width:`${(t+1)/f*100}%`,background:h,transition:`width ${d}ms ease`}})}),oe?r.jsx("div",{className:"bear-relative",style:{minHeight:200},children:N.map((a,e)=>r.jsx("div",{style:se(e),children:a},e))}):r.jsx("div",{className:"bear-flex",style:{gap:`${x}px`,transform:`translateX(calc(-${t} * (${D} + ${x}px)))`,transition:`transform ${d}ms cubic-bezier(0.25, 0.1, 0.25, 1)`},children:N.map((a,e)=>r.jsx("div",{className:"bear-shrink-0",style:{width:D},children:a},e))}),P&&f>u&&r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:c,disabled:!m&&t===0,className:i.cn("bear-absolute bear-left-2 bear-top-1/2 bear--translate-y-1/2","bear-rounded-full bear-flex bear-items-center bear-justify-center","bear-bg-white/90 dark:bear-bg-gray-800/90 bear-shadow-lg","bear-text-gray-700 dark:bear-text-gray-200","hover:bear-bg-white dark:hover:bear-bg-gray-700","bear-transition-all bear-z-10","disabled:bear-opacity-50 disabled:bear-cursor-not-allowed"),style:{width:o.ARROW_BUTTON_SIZE,height:o.ARROW_BUTTON_SIZE},"aria-label":"Previous slide",children:r.jsx("svg",{className:"bear-w-5 bear-h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),r.jsx("button",{onClick:b,disabled:!m&&t===l,className:i.cn("bear-absolute bear-right-2 bear-top-1/2 bear--translate-y-1/2","bear-rounded-full bear-flex bear-items-center bear-justify-center","bear-bg-white/90 dark:bear-bg-gray-800/90 bear-shadow-lg","bear-text-gray-700 dark:bear-text-gray-200","hover:bear-bg-white dark:hover:bear-bg-gray-700","bear-transition-all bear-z-10","disabled:bear-opacity-50 disabled:bear-cursor-not-allowed"),style:{width:o.ARROW_BUTTON_SIZE,height:o.ARROW_BUTTON_SIZE},"aria-label":"Next slide",children:r.jsx("svg",{className:"bear-w-5 bear-h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})})]}),X&&r.jsxs("div",{className:"bear-absolute bear-top-3 bear-right-3 bear-z-10 bear-bg-black/50 bear-text-white bear-text-xs bear-font-medium bear-px-2.5 bear-py-1 bear-rounded-full",children:[t+1," / ",f]}),B&&v!=="none"&&f>u&&r.jsx("div",{className:"bear-flex bear-justify-center bear-gap-2 bear-mt-4",children:v==="thumbnails"&&E?E.map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-rounded bear-overflow-hidden bear-border-2 bear-transition-all",e===t?"bear-opacity-100 bear-scale-110":"bear-opacity-60 hover:bear-opacity-80"),style:{width:S,height:S,borderColor:e===t?h:"transparent"},"aria-label":`Go to slide ${e+1}`,children:r.jsx("img",{src:a,alt:"",className:"bear-w-full bear-h-full bear-object-cover"})},e)):v==="numbers"?Array.from({length:l+1}).map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-w-7 bear-h-7 bear-rounded-full bear-text-xs bear-font-medium bear-transition-all","bear-flex bear-items-center bear-justify-center",e===t?"bear-text-white bear-shadow-md":"bear-bg-gray-200 dark:bear-bg-gray-600 bear-text-gray-600 dark:bear-text-gray-300 hover:bear-bg-gray-300 dark:hover:bear-bg-gray-500"),style:e===t?{background:h}:void 0,"aria-label":`Go to slide ${e+1}`,children:e+1},e)):v==="bars"?Array.from({length:l+1}).map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-h-1 bear-rounded-full bear-transition-all",e===t?"bear-w-8":"bear-w-4 bear-bg-gray-300 dark:bear-bg-gray-600 hover:bear-bg-gray-400 dark:hover:bear-bg-gray-500"),style:e===t?{background:h}:void 0,"aria-label":`Go to slide ${e+1}`},e)):Array.from({length:l+1}).map((a,e)=>r.jsx("button",{onClick:()=>n(e),className:i.cn("bear-h-2.5 bear-rounded-full bear-transition-all",e===t?"bear-w-6":"bear-w-2.5 bear-bg-gray-300 dark:bear-bg-gray-600 hover:bear-bg-gray-400 dark:hover:bear-bg-gray-500"),style:e===t?{background:h}:void 0,"aria-label":`Go to slide ${e+1}`},e))})]})};exports.Carousel=le;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=500,_=50,I=48,A="var(--bear-primary-500)",E=40,R=3;exports.ARROW_BUTTON_SIZE=E;exports.DEFAULT_ACTIVE_COLOR=A;exports.DEFAULT_THUMBNAIL_SIZE=I;exports.DEFAULT_TRANSITION_DURATION=T;exports.MIN_SWIPE_DISTANCE=_;exports.PROGRESS_BAR_HEIGHT=R;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Default transition duration in ms */
|
|
2
|
+
export declare const DEFAULT_TRANSITION_DURATION = 500;
|
|
3
|
+
/** Min swipe distance to trigger navigation (px) */
|
|
4
|
+
export declare const MIN_SWIPE_DISTANCE = 50;
|
|
5
|
+
/** Default thumbnail size (px) */
|
|
6
|
+
export declare const DEFAULT_THUMBNAIL_SIZE = 48;
|
|
7
|
+
/** Default active color */
|
|
8
|
+
export declare const DEFAULT_ACTIVE_COLOR = "var(--bear-primary-500)";
|
|
9
|
+
/** Arrow button size (px) */
|
|
10
|
+
export declare const ARROW_BUTTON_SIZE = 40;
|
|
11
|
+
/** Progress bar height (px) */
|
|
12
|
+
export declare const PROGRESS_BAR_HEIGHT = 3;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const T = 500, _ = 50, I = 48, A = "var(--bear-primary-500)", E = 40, R = 3;
|
|
2
|
+
export {
|
|
3
|
+
E as ARROW_BUTTON_SIZE,
|
|
4
|
+
A as DEFAULT_ACTIVE_COLOR,
|
|
5
|
+
I as DEFAULT_THUMBNAIL_SIZE,
|
|
6
|
+
T as DEFAULT_TRANSITION_DURATION,
|
|
7
|
+
_ as MIN_SWIPE_DISTANCE,
|
|
8
|
+
R as PROGRESS_BAR_HEIGHT
|
|
9
|
+
};
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { CarouselProps } from './Carousel.types';
|
|
3
3
|
/**
|
|
4
|
-
* Carousel -
|
|
4
|
+
* Carousel - Feature-rich sliding content carousel
|
|
5
|
+
*
|
|
6
|
+
* @description
|
|
7
|
+
* Supports slide, fade, zoom, and flip transitions, thumbnail indicators,
|
|
8
|
+
* keyboard navigation, drag/swipe, progress bar, and counter.
|
|
5
9
|
*
|
|
6
10
|
* @example
|
|
7
11
|
* ```tsx
|
|
8
|
-
* <Carousel
|
|
12
|
+
* <Carousel
|
|
13
|
+
* autoPlay={5000}
|
|
14
|
+
* transition="fade"
|
|
15
|
+
* indicator="thumbnails"
|
|
16
|
+
* thumbnails={['/img1.jpg', '/img2.jpg']}
|
|
17
|
+
* showArrows
|
|
18
|
+
* showProgress
|
|
19
|
+
* keyboard
|
|
20
|
+
* >
|
|
9
21
|
* <div>Slide 1</div>
|
|
10
22
|
* <div>Slide 2</div>
|
|
11
|
-
* <div>Slide 3</div>
|
|
12
23
|
* </Carousel>
|
|
13
24
|
* ```
|
|
14
25
|
*/
|