@forgedevstack/bear 1.0.2 → 1.0.4-alpha
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/Accordion/Accordion.cjs +1 -1
- package/dist/components/Accordion/Accordion.const.cjs +1 -0
- package/dist/components/Accordion/Accordion.const.d.ts +10 -0
- package/dist/components/Accordion/Accordion.const.js +8 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -0
- package/dist/components/Accordion/Accordion.js +49 -44
- package/dist/components/Accordion/Accordion.types.d.ts +2 -0
- package/dist/components/Accordion/index.d.ts +3 -2
- package/dist/components/ActiveBar/ActiveBar.cjs +8 -0
- package/dist/components/ActiveBar/ActiveBar.d.ts +2 -0
- package/dist/components/ActiveBar/ActiveBar.js +90 -0
- package/dist/components/ActiveBar/ActiveBar.types.d.ts +16 -0
- package/dist/components/ActiveBar/index.d.ts +2 -0
- package/dist/components/ActivityItem/ActivityItem.cjs +1 -0
- package/dist/components/ActivityItem/ActivityItem.d.ts +7 -0
- package/dist/components/ActivityItem/ActivityItem.js +44 -0
- package/dist/components/ActivityItem/ActivityItem.types.d.ts +17 -0
- package/dist/components/ActivityItem/index.d.ts +2 -0
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.const.cjs +1 -0
- package/dist/components/Alert/Alert.const.d.ts +14 -0
- package/dist/components/Alert/Alert.const.js +27 -0
- package/dist/components/Alert/Alert.js +54 -63
- package/dist/components/Alert/Alert.types.d.ts +3 -1
- package/dist/components/Avatar/Avatar.cjs +1 -1
- package/dist/components/Avatar/Avatar.const.cjs +1 -0
- package/dist/components/Avatar/Avatar.const.d.ts +28 -0
- package/dist/components/Avatar/Avatar.const.js +28 -0
- package/dist/components/Avatar/Avatar.js +49 -60
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.cjs +1 -1
- package/dist/components/Badge/Badge.js +24 -22
- package/dist/components/BearLogo/EmberLogo.cjs +17 -0
- package/dist/components/BearLogo/EmberLogo.js +91 -0
- package/dist/components/BearLogo/index.d.ts +2 -0
- package/dist/components/Box/Box.cjs +1 -0
- package/dist/components/Box/Box.d.ts +2 -0
- package/dist/components/Box/Box.js +64 -0
- package/dist/components/Box/Box.types.d.ts +24 -0
- package/dist/components/Box/Box.utils.cjs +1 -0
- package/dist/components/Box/Box.utils.d.ts +3 -0
- package/dist/components/Box/Box.utils.js +21 -0
- package/dist/components/Box/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.const.cjs +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.d.ts +16 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.const.js +19 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +49 -34
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +8 -1
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +1 -1
- package/dist/components/Button/Button.constants.d.ts +2 -2
- package/dist/components/Button/Button.constants.js +2 -2
- package/dist/components/Button/Button.js +41 -46
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.const.cjs +1 -0
- package/dist/components/Calendar/Calendar.const.d.ts +18 -0
- package/dist/components/Calendar/Calendar.const.js +27 -0
- package/dist/components/Calendar/Calendar.helpers.cjs +1 -0
- package/dist/components/Calendar/Calendar.helpers.d.ts +10 -0
- package/dist/components/Calendar/Calendar.helpers.js +9 -0
- package/dist/components/Calendar/Calendar.js +132 -149
- package/dist/components/Calendar/Calendar.types.d.ts +4 -0
- package/dist/components/Calendar/Calendar.utils.cjs +1 -0
- package/dist/components/Calendar/Calendar.utils.d.ts +41 -0
- package/dist/components/Calendar/Calendar.utils.js +33 -0
- package/dist/components/Calendar/index.d.ts +2 -0
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.const.cjs +1 -0
- package/dist/components/Card/Card.const.d.ts +13 -0
- package/dist/components/Card/Card.const.js +32 -0
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Card/Card.js +101 -105
- package/dist/components/Card/index.d.ts +3 -2
- package/dist/components/Chart/Chart.cjs +1 -0
- package/dist/components/Chart/Chart.const.d.ts +15 -0
- package/dist/components/Chart/Chart.d.ts +18 -0
- package/dist/components/Chart/Chart.js +225 -0
- package/dist/components/Chart/Chart.types.d.ts +51 -0
- package/dist/components/Chart/Chart.utils.d.ts +31 -0
- package/dist/components/Chart/index.d.ts +2 -0
- package/dist/components/CodeBlock/CodeBlock.cjs +2 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +2 -0
- package/dist/components/CodeBlock/CodeBlock.js +68 -0
- package/dist/components/CodeBlock/CodeBlock.types.d.ts +21 -0
- package/dist/components/CodeBlock/index.d.ts +2 -0
- package/dist/components/Columns/Columns.cjs +1 -0
- package/dist/components/Columns/Columns.d.ts +5 -0
- package/dist/components/Columns/Columns.js +54 -0
- package/dist/components/Columns/Columns.types.d.ts +17 -0
- package/dist/components/Columns/index.d.ts +2 -0
- package/dist/components/DateTimePicker/DateTimePicker.cjs +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +28 -28
- package/dist/components/Editable/Editable.cjs +1 -0
- package/dist/components/Editable/Editable.d.ts +10 -0
- package/dist/components/Editable/Editable.js +194 -0
- package/dist/components/Editable/Editable.types.d.ts +39 -0
- package/dist/components/Editable/index.d.ts +2 -0
- package/dist/components/Em/Em.cjs +1 -0
- package/dist/components/Em/Em.d.ts +2 -0
- package/dist/components/Em/Em.js +24 -0
- package/dist/components/Em/Em.types.d.ts +5 -0
- package/dist/components/Em/index.d.ts +2 -0
- package/dist/components/Fab/Fab.cjs +1 -1
- package/dist/components/Fab/Fab.js +9 -9
- package/dist/components/Gauge/Gauge.cjs +1 -0
- package/dist/components/Gauge/Gauge.d.ts +3 -0
- package/dist/components/Gauge/Gauge.js +92 -0
- package/dist/components/Gauge/Gauge.types.d.ts +27 -0
- package/dist/components/Gauge/index.d.ts +2 -0
- package/dist/components/Highlight/Highlight.cjs +1 -0
- package/dist/components/Highlight/Highlight.d.ts +2 -0
- package/dist/components/Highlight/Highlight.js +28 -0
- package/dist/components/Highlight/Highlight.types.d.ts +6 -0
- package/dist/components/Highlight/index.d.ts +2 -0
- package/dist/components/HoverCard/HoverCard.cjs +6 -0
- package/dist/components/HoverCard/HoverCard.d.ts +2 -0
- package/dist/components/HoverCard/HoverCard.js +68 -0
- package/dist/components/HoverCard/HoverCard.types.d.ts +13 -0
- package/dist/components/HoverCard/HoverCard.utils.cjs +1 -0
- package/dist/components/HoverCard/HoverCard.utils.d.ts +2 -0
- package/dist/components/HoverCard/HoverCard.utils.js +23 -0
- package/dist/components/HoverCard/index.d.ts +2 -0
- package/dist/components/Icon/icons/editor.cjs +1 -1
- package/dist/components/Icon/icons/editor.d.ts +1 -0
- package/dist/components/Icon/icons/editor.js +66 -61
- package/dist/components/Icon/icons/misc.cjs +1 -1
- package/dist/components/Icon/icons/misc.d.ts +13 -0
- package/dist/components/Icon/icons/misc.js +157 -88
- package/dist/components/Icon/icons/status.js +1 -1
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.d.ts +27 -0
- package/dist/components/Icon/index.js +28 -21
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +36 -35
- package/dist/components/Mark/Mark.cjs +1 -0
- package/dist/components/Mark/Mark.d.ts +2 -0
- package/dist/components/Mark/Mark.js +26 -0
- package/dist/components/Mark/Mark.types.d.ts +5 -0
- package/dist/components/Mark/index.d.ts +2 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.const.cjs +1 -0
- package/dist/components/Modal/Modal.const.d.ts +10 -0
- package/dist/components/Modal/Modal.const.js +17 -0
- package/dist/components/Modal/Modal.d.ts +11 -0
- package/dist/components/Modal/Modal.js +80 -77
- package/dist/components/Modal/Modal.types.d.ts +6 -1
- package/dist/components/Modal/index.d.ts +3 -2
- package/dist/components/Rating/Rating.cjs +1 -1
- package/dist/components/Rating/Rating.const.cjs +1 -0
- package/dist/components/Rating/Rating.const.d.ts +14 -0
- package/dist/components/Rating/Rating.const.js +22 -0
- package/dist/components/Rating/Rating.d.ts +5 -10
- package/dist/components/Rating/Rating.js +135 -93
- package/dist/components/Rating/Rating.types.d.ts +27 -25
- package/dist/components/Rating/index.d.ts +2 -2
- package/dist/components/RichEditor/RichEditor.cjs +1 -0
- package/dist/components/RichEditor/RichEditor.const.cjs +141 -0
- package/dist/components/RichEditor/RichEditor.const.d.ts +137 -0
- package/dist/components/RichEditor/RichEditor.const.js +279 -0
- package/dist/components/RichEditor/RichEditor.d.ts +18 -0
- package/dist/components/RichEditor/RichEditor.js +363 -0
- package/dist/components/RichEditor/RichEditor.types.d.ts +57 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarButton/ToolbarButton.js +25 -0
- package/dist/components/RichEditor/components/ToolbarButton/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/ToolbarColorPicker.js +126 -0
- package/dist/components/RichEditor/components/ToolbarColorPicker/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.d.ts +4 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/ToolbarDropdown.js +57 -0
- package/dist/components/RichEditor/components/ToolbarDropdown/index.d.ts +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.cjs +1 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.d.ts +7 -0
- package/dist/components/RichEditor/components/ToolbarMore/ToolbarMore.js +45 -0
- package/dist/components/RichEditor/components/ToolbarMore/index.d.ts +2 -0
- package/dist/components/RichEditor/components/index.d.ts +4 -0
- package/dist/components/RichEditor/helpers/formatHelpers.cjs +1 -0
- package/dist/components/RichEditor/helpers/formatHelpers.d.ts +57 -0
- package/dist/components/RichEditor/helpers/formatHelpers.js +26 -0
- package/dist/components/RichEditor/helpers/index.d.ts +1 -0
- package/dist/components/RichEditor/index.d.ts +4 -0
- package/dist/components/Sidebar/Sidebar.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.const.cjs +1 -0
- package/dist/components/Sidebar/Sidebar.const.d.ts +16 -0
- package/dist/components/Sidebar/Sidebar.const.js +22 -0
- package/dist/components/Sidebar/Sidebar.d.ts +17 -0
- package/dist/components/Sidebar/Sidebar.js +70 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +44 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarGroup/SidebarGroup.js +45 -0
- package/dist/components/Sidebar/components/SidebarGroup/index.d.ts +2 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.cjs +1 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.d.ts +4 -0
- package/dist/components/Sidebar/components/SidebarItem/SidebarItem.js +66 -0
- package/dist/components/Sidebar/components/SidebarItem/index.d.ts +2 -0
- package/dist/components/Sidebar/components/index.d.ts +2 -0
- package/dist/components/Sidebar/index.d.ts +5 -0
- package/dist/components/SignPad/SignPad.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.cjs +1 -0
- package/dist/components/SignPad/SignPad.const.d.ts +19 -0
- package/dist/components/SignPad/SignPad.const.js +20 -0
- package/dist/components/SignPad/SignPad.d.ts +17 -0
- package/dist/components/SignPad/SignPad.js +161 -0
- package/dist/components/SignPad/SignPad.types.d.ts +37 -0
- package/dist/components/SignPad/index.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.const.cjs +36 -0
- package/dist/components/Skeleton/Skeleton.const.d.ts +12 -0
- package/dist/components/Skeleton/Skeleton.const.js +58 -0
- package/dist/components/Skeleton/Skeleton.d.ts +15 -24
- package/dist/components/Skeleton/Skeleton.js +132 -103
- package/dist/components/Skeleton/Skeleton.types.d.ts +18 -8
- package/dist/components/Skeleton/index.d.ts +2 -2
- package/dist/components/Slider/Slider.cjs +1 -1
- package/dist/components/Slider/Slider.js +8 -8
- package/dist/components/Sparkline/Sparkline.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.const.d.ts +16 -0
- package/dist/components/Sparkline/Sparkline.const.js +16 -0
- package/dist/components/Sparkline/Sparkline.d.ts +3 -0
- package/dist/components/Sparkline/Sparkline.js +80 -0
- package/dist/components/Sparkline/Sparkline.types.d.ts +19 -0
- package/dist/components/Sparkline/Sparkline.utils.cjs +1 -0
- package/dist/components/Sparkline/Sparkline.utils.d.ts +27 -0
- package/dist/components/Sparkline/Sparkline.utils.js +30 -0
- package/dist/components/Sparkline/index.d.ts +5 -0
- package/dist/components/SpeedDial/SpeedDial.cjs +12 -1
- package/dist/components/SpeedDial/SpeedDial.const.cjs +1 -0
- package/dist/components/SpeedDial/SpeedDial.const.d.ts +22 -0
- package/dist/components/SpeedDial/SpeedDial.const.js +26 -0
- package/dist/components/SpeedDial/SpeedDial.d.ts +5 -7
- package/dist/components/SpeedDial/SpeedDial.js +154 -144
- package/dist/components/SpeedDial/SpeedDial.types.d.ts +26 -29
- package/dist/components/SpeedDial/index.d.ts +1 -1
- package/dist/components/Spinner/Spinner.cjs +1 -1
- package/dist/components/Spinner/Spinner.js +17 -15
- package/dist/components/StatCard/StatCard.cjs +1 -0
- package/dist/components/StatCard/StatCard.d.ts +7 -0
- package/dist/components/StatCard/StatCard.js +36 -0
- package/dist/components/StatCard/StatCard.types.d.ts +13 -0
- package/dist/components/StatCard/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.cjs +1 -1
- package/dist/components/Stepper/Stepper.const.cjs +1 -0
- package/dist/components/Stepper/Stepper.const.d.ts +29 -0
- package/dist/components/Stepper/Stepper.const.js +46 -0
- package/dist/components/Stepper/Stepper.d.ts +10 -3
- package/dist/components/Stepper/Stepper.js +143 -92
- package/dist/components/Stepper/Stepper.types.d.ts +63 -13
- package/dist/components/Stepper/index.d.ts +2 -2
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.js +74 -47
- package/dist/components/Switch/Switch.types.d.ts +11 -1
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.js +33 -29
- package/dist/components/TimePicker/TimePicker.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.cjs +1 -1
- package/dist/components/TimePicker/TimePicker.constants.d.ts +14 -0
- package/dist/components/TimePicker/TimePicker.constants.js +18 -4
- package/dist/components/TimePicker/TimePicker.js +92 -91
- package/dist/components/Timeline/Timeline.cjs +1 -1
- package/dist/components/Timeline/Timeline.const.cjs +1 -0
- package/dist/components/Timeline/Timeline.const.d.ts +40 -0
- package/dist/components/Timeline/Timeline.const.js +58 -0
- package/dist/components/Timeline/Timeline.d.ts +16 -2
- package/dist/components/Timeline/Timeline.js +131 -63
- package/dist/components/Timeline/Timeline.types.d.ts +30 -11
- package/dist/components/Timeline/index.d.ts +1 -1
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +37 -35
- package/dist/components/Typography/Typography.cjs +1 -1
- package/dist/components/Typography/Typography.js +38 -36
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +38 -4
- package/dist/components/index.js +213 -168
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +24 -0
- package/dist/hooks/index.js +42 -14
- package/dist/hooks/useBounce/index.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.cjs +1 -0
- package/dist/hooks/useBounce/useBounce.d.ts +2 -0
- package/dist/hooks/useBounce/useBounce.js +36 -0
- package/dist/hooks/useBounce/useBounce.types.d.ts +27 -0
- package/dist/hooks/useClickOutside/index.d.ts +2 -0
- package/dist/hooks/useClickOutside/useClickOutside.d.ts +22 -0
- package/dist/hooks/useClickOutside/useClickOutside.types.d.ts +10 -0
- package/dist/hooks/useClipboard/index.d.ts +2 -0
- package/dist/hooks/useClipboard/useClipboard.cjs +1 -0
- package/dist/hooks/useClipboard/useClipboard.d.ts +15 -0
- package/dist/hooks/useClipboard/useClipboard.js +22 -0
- package/dist/hooks/useClipboard/useClipboard.types.d.ts +20 -0
- package/dist/hooks/useDebounce/index.d.ts +2 -0
- package/dist/hooks/useDebounce/useDebounce.cjs +1 -0
- package/dist/hooks/useDebounce/useDebounce.d.ts +32 -0
- package/dist/hooks/useDebounce/useDebounce.js +39 -0
- package/dist/hooks/useDebounce/useDebounce.types.d.ts +20 -0
- package/dist/hooks/useFloat/index.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.cjs +1 -0
- package/dist/hooks/useFloat/useFloat.d.ts +2 -0
- package/dist/hooks/useFloat/useFloat.js +37 -0
- package/dist/hooks/useFloat/useFloat.types.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/index.d.ts +2 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.cjs +1 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.d.ts +25 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.js +39 -0
- package/dist/hooks/useIntersectionObserver/useIntersectionObserver.types.d.ts +22 -0
- package/dist/hooks/useKeyPress/index.d.ts +2 -0
- package/dist/hooks/useKeyPress/useKeyPress.cjs +1 -0
- package/dist/hooks/useKeyPress/useKeyPress.d.ts +22 -0
- package/dist/hooks/useKeyPress/useKeyPress.js +39 -0
- package/dist/hooks/useKeyPress/useKeyPress.types.d.ts +19 -0
- package/dist/hooks/useLocalStorage/index.d.ts +2 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.cjs +1 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.d.ts +11 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.js +47 -0
- package/dist/hooks/useLocalStorage/useLocalStorage.types.d.ts +16 -0
- package/dist/hooks/useMediaQuery/index.d.ts +3 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.d.ts +12 -0
- package/dist/hooks/useMediaQuery/useMediaQuery.types.d.ts +21 -0
- package/dist/hooks/useParallax/index.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.cjs +1 -0
- package/dist/hooks/useParallax/useParallax.d.ts +2 -0
- package/dist/hooks/useParallax/useParallax.js +36 -0
- package/dist/hooks/useParallax/useParallax.types.d.ts +19 -0
- package/dist/hooks/usePulse/index.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.cjs +1 -0
- package/dist/hooks/usePulse/usePulse.d.ts +2 -0
- package/dist/hooks/usePulse/usePulse.js +38 -0
- package/dist/hooks/usePulse/usePulse.types.d.ts +29 -0
- package/dist/hooks/useShake/index.d.ts +2 -0
- package/dist/hooks/useShake/useShake.cjs +1 -0
- package/dist/hooks/useShake/useShake.d.ts +2 -0
- package/dist/hooks/useShake/useShake.js +14 -0
- package/dist/hooks/useShake/useShake.types.d.ts +19 -0
- package/dist/hooks/useSlide/index.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.cjs +1 -0
- package/dist/hooks/useSlide/useSlide.d.ts +2 -0
- package/dist/hooks/useSlide/useSlide.js +68 -0
- package/dist/hooks/useSlide/useSlide.types.d.ts +36 -0
- package/dist/hooks/useThrottle/index.d.ts +2 -0
- package/dist/hooks/useThrottle/useThrottle.cjs +1 -0
- package/dist/hooks/useThrottle/useThrottle.d.ts +26 -0
- package/dist/hooks/useThrottle/useThrottle.js +44 -0
- package/dist/hooks/useThrottle/useThrottle.types.d.ts +8 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +275 -202
- package/dist/styles.css +1 -1
- package/package.json +15 -22
|
@@ -1,116 +1,145 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { jsx as r, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m, useEffect as _ } from "react";
|
|
3
|
+
import { cn as A } from "../../utils/cn.js";
|
|
4
|
+
import { SKELETON_BG_CLASSES as v, SKELETON_ANIMATION_CLASSES as L, SKELETON_VARIANT_CLASSES as b, SKELETON_BASE_CLASSES as C, SKELETON_TEXT_HEIGHT as w, SKELETON_AVATAR_SIZES as O, SKELETON_WAVE_STYLES as K } from "./Skeleton.const.js";
|
|
5
|
+
const T = () => {
|
|
6
|
+
const e = "bear-skeleton-styles";
|
|
7
|
+
if (typeof document < "u" && !document.getElementById(e)) {
|
|
8
|
+
const t = document.createElement("style");
|
|
9
|
+
t.id = e, t.textContent = K, document.head.appendChild(t);
|
|
10
|
+
}
|
|
11
|
+
}, i = m(
|
|
12
|
+
({
|
|
13
|
+
variant: e = "text",
|
|
14
|
+
animation: t = "pulse",
|
|
15
|
+
width: l,
|
|
16
|
+
height: s,
|
|
17
|
+
borderRadius: d,
|
|
18
|
+
count: S = 1,
|
|
19
|
+
gap: E = 8,
|
|
20
|
+
className: o,
|
|
21
|
+
style: a,
|
|
22
|
+
testId: p,
|
|
23
|
+
...h
|
|
24
|
+
}, y) => {
|
|
25
|
+
_(() => {
|
|
26
|
+
t === "wave" && T();
|
|
27
|
+
}, [t]);
|
|
28
|
+
const c = (n) => {
|
|
29
|
+
if (n !== void 0)
|
|
30
|
+
return typeof n == "number" ? `${n}px` : n;
|
|
31
|
+
}, N = {
|
|
32
|
+
width: c(l),
|
|
33
|
+
height: c(s) || (e === "text" ? w : void 0),
|
|
34
|
+
borderRadius: d ? c(d) : void 0,
|
|
35
|
+
...a
|
|
36
|
+
}, g = A(
|
|
37
|
+
C,
|
|
38
|
+
b[e],
|
|
39
|
+
L[t],
|
|
40
|
+
v,
|
|
41
|
+
o
|
|
42
|
+
);
|
|
43
|
+
return S > 1 ? /* @__PURE__ */ r(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
className: "Bear-Skeleton__group flex flex-col",
|
|
47
|
+
style: { gap: c(E) },
|
|
48
|
+
"data-testid": p,
|
|
49
|
+
children: Array.from({ length: S }).map((n, u) => /* @__PURE__ */ r(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref: u === 0 ? y : void 0,
|
|
53
|
+
className: g,
|
|
54
|
+
style: N,
|
|
55
|
+
...h
|
|
56
|
+
},
|
|
57
|
+
u
|
|
58
|
+
))
|
|
59
|
+
}
|
|
60
|
+
) : /* @__PURE__ */ r(
|
|
61
|
+
"div",
|
|
62
|
+
{
|
|
63
|
+
ref: y,
|
|
64
|
+
className: g,
|
|
65
|
+
style: N,
|
|
66
|
+
"data-testid": p,
|
|
67
|
+
...h
|
|
35
68
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
i.displayName = "Skeleton";
|
|
73
|
+
const k = m(
|
|
74
|
+
({ lines: e = 3, lastLineWidth: t = "80%", gap: l = 8, animation: s = "pulse", ...d }, S) => (_(() => {
|
|
75
|
+
s === "wave" && T();
|
|
76
|
+
}, [s]), /* @__PURE__ */ r(
|
|
40
77
|
"div",
|
|
41
78
|
{
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
79
|
+
ref: S,
|
|
80
|
+
className: "Bear-SkeletonText flex flex-col",
|
|
81
|
+
style: { gap: ((o) => {
|
|
82
|
+
if (o !== void 0)
|
|
83
|
+
return typeof o == "number" ? `${o}px` : o;
|
|
84
|
+
})(l) },
|
|
85
|
+
children: Array.from({ length: e }).map((o, a) => /* @__PURE__ */ r(
|
|
86
|
+
i,
|
|
47
87
|
{
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
o
|
|
53
|
-
),
|
|
54
|
-
style: {
|
|
55
|
-
...s,
|
|
56
|
-
width: g === n - 1 ? "80%" : s.width
|
|
57
|
-
},
|
|
58
|
-
...b
|
|
88
|
+
variant: "text",
|
|
89
|
+
animation: s,
|
|
90
|
+
width: a === e - 1 ? t : "100%",
|
|
91
|
+
...d
|
|
59
92
|
},
|
|
60
|
-
|
|
93
|
+
a
|
|
61
94
|
))
|
|
62
95
|
}
|
|
63
|
-
)
|
|
96
|
+
))
|
|
97
|
+
);
|
|
98
|
+
k.displayName = "SkeletonText";
|
|
99
|
+
const x = m(
|
|
100
|
+
({ size: e = "md", animation: t = "pulse", ...l }, s) => {
|
|
101
|
+
const d = typeof e == "number" ? e : O[e];
|
|
102
|
+
return /* @__PURE__ */ r(
|
|
103
|
+
i,
|
|
104
|
+
{
|
|
105
|
+
ref: s,
|
|
106
|
+
variant: "circular",
|
|
107
|
+
animation: t,
|
|
108
|
+
width: d,
|
|
109
|
+
height: d,
|
|
110
|
+
...l
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
);
|
|
115
|
+
x.displayName = "SkeletonAvatar";
|
|
116
|
+
const B = m(
|
|
117
|
+
({ animation: e = "pulse", className: t, ...l }, s) => /* @__PURE__ */ f(
|
|
64
118
|
"div",
|
|
65
119
|
{
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
o
|
|
120
|
+
ref: s,
|
|
121
|
+
className: A(
|
|
122
|
+
"Bear-SkeletonCard p-4 rounded-lg border border-gray-200 dark:border-zinc-700 bg-white dark:bg-zinc-900",
|
|
123
|
+
t
|
|
71
124
|
),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
125
|
+
...l,
|
|
126
|
+
children: [
|
|
127
|
+
/* @__PURE__ */ f("div", { className: "flex items-center gap-3 mb-4", children: [
|
|
128
|
+
/* @__PURE__ */ r(x, { animation: e }),
|
|
129
|
+
/* @__PURE__ */ f("div", { className: "flex-1", children: [
|
|
130
|
+
/* @__PURE__ */ r(i, { animation: e, width: "60%", height: 16, className: "mb-2" }),
|
|
131
|
+
/* @__PURE__ */ r(i, { animation: e, width: "40%", height: 12 })
|
|
132
|
+
] })
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ r(k, { animation: e, lines: 3 })
|
|
135
|
+
]
|
|
75
136
|
}
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
className: t
|
|
80
|
-
}) => /* @__PURE__ */ r(
|
|
81
|
-
a,
|
|
82
|
-
{
|
|
83
|
-
variant: "circular",
|
|
84
|
-
width: e,
|
|
85
|
-
height: e,
|
|
86
|
-
className: t
|
|
87
|
-
}
|
|
88
|
-
), v = ({
|
|
89
|
-
lines: e = 3,
|
|
90
|
-
width: t = "100%",
|
|
91
|
-
className: l
|
|
92
|
-
}) => /* @__PURE__ */ r(
|
|
93
|
-
a,
|
|
94
|
-
{
|
|
95
|
-
variant: "text",
|
|
96
|
-
count: e,
|
|
97
|
-
width: t,
|
|
98
|
-
className: l
|
|
99
|
-
}
|
|
100
|
-
), w = ({ className: e }) => /* @__PURE__ */ c("div", { className: d("bear-p-4 bear-space-y-4", e), children: [
|
|
101
|
-
/* @__PURE__ */ r(a, { variant: "rectangular", height: 200 }),
|
|
102
|
-
/* @__PURE__ */ c("div", { className: "bear-flex bear-items-center bear-gap-3", children: [
|
|
103
|
-
/* @__PURE__ */ r(S, {}),
|
|
104
|
-
/* @__PURE__ */ c("div", { className: "bear-flex-1", children: [
|
|
105
|
-
/* @__PURE__ */ r(a, { variant: "text", width: "60%" }),
|
|
106
|
-
/* @__PURE__ */ r(a, { variant: "text", width: "40%", className: "bear-mt-2" })
|
|
107
|
-
] })
|
|
108
|
-
] }),
|
|
109
|
-
/* @__PURE__ */ r(v, { lines: 3 })
|
|
110
|
-
] });
|
|
137
|
+
)
|
|
138
|
+
);
|
|
139
|
+
B.displayName = "SkeletonCard";
|
|
111
140
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
141
|
+
i as Skeleton,
|
|
142
|
+
x as SkeletonAvatar,
|
|
143
|
+
B as SkeletonCard,
|
|
144
|
+
k as SkeletonText
|
|
116
145
|
};
|
|
@@ -2,20 +2,30 @@ import { HTMLAttributes } from 'react';
|
|
|
2
2
|
export type SkeletonVariant = 'text' | 'circular' | 'rectangular' | 'rounded';
|
|
3
3
|
export type SkeletonAnimation = 'pulse' | 'wave' | 'none';
|
|
4
4
|
export interface SkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
/**
|
|
5
|
+
/** Variant type */
|
|
6
6
|
variant?: SkeletonVariant;
|
|
7
7
|
/** Animation type */
|
|
8
8
|
animation?: SkeletonAnimation;
|
|
9
|
-
/** Width
|
|
9
|
+
/** Width (number = px, string = any CSS unit) */
|
|
10
10
|
width?: number | string;
|
|
11
|
-
/** Height
|
|
11
|
+
/** Height (number = px, string = any CSS unit) */
|
|
12
12
|
height?: number | string;
|
|
13
|
-
/**
|
|
13
|
+
/** Border radius for rounded variant */
|
|
14
|
+
borderRadius?: number | string;
|
|
15
|
+
/** Number of skeleton lines to show */
|
|
14
16
|
count?: number;
|
|
15
|
-
/** Gap between
|
|
17
|
+
/** Gap between lines when count > 1 */
|
|
16
18
|
gap?: number | string;
|
|
17
|
-
/**
|
|
18
|
-
className?: string;
|
|
19
|
-
/** Test ID for testing */
|
|
19
|
+
/** Test ID */
|
|
20
20
|
testId?: string;
|
|
21
21
|
}
|
|
22
|
+
export interface SkeletonTextProps extends Omit<SkeletonProps, 'variant'> {
|
|
23
|
+
/** Number of lines */
|
|
24
|
+
lines?: number;
|
|
25
|
+
/** Make last line shorter */
|
|
26
|
+
lastLineWidth?: number | string;
|
|
27
|
+
}
|
|
28
|
+
export interface SkeletonAvatarProps extends Omit<SkeletonProps, 'variant' | 'width' | 'height'> {
|
|
29
|
+
/** Size of avatar */
|
|
30
|
+
size?: 'sm' | 'md' | 'lg' | number;
|
|
31
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Skeleton,
|
|
2
|
-
export type { SkeletonProps, SkeletonVariant, SkeletonAnimation } from './Skeleton.types';
|
|
1
|
+
export { Skeleton, SkeletonText, SkeletonAvatar, SkeletonCard } from './Skeleton';
|
|
2
|
+
export type { SkeletonProps, SkeletonTextProps, SkeletonAvatarProps, SkeletonVariant, SkeletonAnimation } from './Skeleton.types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),u=require("react"),g=require("../../utils/cn.cjs"),U={xs:{track:"bear-h-1",thumb:"bear-w-3 bear-h-3",height:"bear-h-6"},sm:{track:"bear-h-1.5",thumb:"bear-w-4 bear-h-4",height:"bear-h-8"},md:{track:"bear-h-2",thumb:"bear-w-5 bear-h-5",height:"bear-h-10"},lg:{track:"bear-h-2.5",thumb:"bear-w-6 bear-h-6",height:"bear-h-12"},xl:{track:"bear-h-3",thumb:"bear-w-7 bear-h-7",height:"bear-h-14"}},X={primary:{track:"bear-bg-bear-500",thumb:"bear-bg-bear-500 bear-border-bear-600"},secondary:{track:"bear-bg-gray-500",thumb:"bear-bg-gray-500 bear-border-gray-600"},success:{track:"bear-bg-green-500",thumb:"bear-bg-green-500 bear-border-green-600"},warning:{track:"bear-bg-amber-500",thumb:"bear-bg-amber-500 bear-border-amber-600"},error:{track:"bear-bg-red-500",thumb:"bear-bg-red-500 bear-border-red-600"},danger:{track:"bear-bg-red-500",thumb:"bear-bg-red-500 bear-border-red-600"},info:{track:"bear-bg-blue-500",thumb:"bear-bg-blue-500 bear-border-blue-600"},ghost:{track:"bear-bg-gray-400",thumb:"bear-bg-gray-400 bear-border-gray-500"},outline:{track:"bear-bg-gray-600",thumb:"bear-bg-white bear-border-gray-600"}},Y=({value:N,defaultValue:L=0,min:r=0,max:t=100,step:c=1,size:A="md",color:R="primary",showValue:V=!1,marks:f=!1,disabled:s=!1,orientation:F="horizontal",onChange:n,onChangeCommitted:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),u=require("react"),g=require("../../utils/cn.cjs"),U={xs:{track:"bear-h-1",thumb:"bear-w-3 bear-h-3",height:"bear-h-6"},sm:{track:"bear-h-1.5",thumb:"bear-w-4 bear-h-4",height:"bear-h-8"},md:{track:"bear-h-2",thumb:"bear-w-5 bear-h-5",height:"bear-h-10"},lg:{track:"bear-h-2.5",thumb:"bear-w-6 bear-h-6",height:"bear-h-12"},xl:{track:"bear-h-3",thumb:"bear-w-7 bear-h-7",height:"bear-h-14"}},X={primary:{track:"bear-bg-bear-500",thumb:"bear-bg-bear-500 bear-border-bear-600"},secondary:{track:"bear-bg-gray-500",thumb:"bear-bg-gray-500 bear-border-gray-600"},success:{track:"bear-bg-green-500",thumb:"bear-bg-green-500 bear-border-green-600"},warning:{track:"bear-bg-amber-500",thumb:"bear-bg-amber-500 bear-border-amber-600"},error:{track:"bear-bg-red-500",thumb:"bear-bg-red-500 bear-border-red-600"},danger:{track:"bear-bg-red-500",thumb:"bear-bg-red-500 bear-border-red-600"},info:{track:"bear-bg-blue-500",thumb:"bear-bg-blue-500 bear-border-blue-600"},ghost:{track:"bear-bg-gray-400",thumb:"bear-bg-gray-400 bear-border-gray-500"},outline:{track:"bear-bg-gray-600",thumb:"bear-bg-white dark:bear-bg-gray-200 bear-border-gray-600 dark:bear-border-gray-400"}},Y=({value:N,defaultValue:L=0,min:r=0,max:t=100,step:c=1,size:A="md",color:R="primary",showValue:V=!1,marks:f=!1,disabled:s=!1,orientation:F="horizontal",onChange:n,onChangeCommitted:d,valueFormatter:T=y=>String(y),ariaLabel:I="Slider",className:q,testId:O,..._})=>{const[y,p]=u.useState(L),[l,S]=u.useState(!1),[$,h]=u.useState(!1),w=u.useRef(null),o=N??y,M=(o-r)/(t-r)*100,m=U[A],j=X[R],v=u.useCallback(a=>{if(!w.current||s)return;const e=w.current.getBoundingClientRect(),i=Math.max(0,Math.min(1,(a-e.left)/e.width)),K=r+i*(t-r),P=Math.round(K/c)*c,E=Math.max(r,Math.min(t,P));p(E),n==null||n(E)},[r,t,c,s,n]),D=a=>{s||(a.preventDefault(),S(!0),h(!0),v(a.clientX))},k=u.useCallback(a=>{l&&v(a.clientX)},[l,v]),x=u.useCallback(()=>{l&&(S(!1),h(!1),d==null||d(o))},[l,o,d]);u.useEffect(()=>{if(l)return document.addEventListener("mousemove",k),document.addEventListener("mouseup",x),()=>{document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",x)}},[l,k,x]);const z=a=>{if(s)return;let e=o;switch(a.key){case"ArrowRight":case"ArrowUp":e=Math.min(t,o+c);break;case"ArrowLeft":case"ArrowDown":e=Math.max(r,o-c);break;case"Home":e=r;break;case"End":e=t;break;default:return}a.preventDefault(),p(e),n==null||n(e)},B=()=>{if(!f)return null;const a=Array.isArray(f)?f:Array.from({length:(t-r)/c+1},(e,i)=>({value:r+i*c}));return b.jsx("div",{className:"bear-absolute bear-inset-x-0 bear-top-1/2 bear--translate-y-1/2 bear-flex bear-justify-between",children:a.map(e=>{const i=(e.value-r)/(t-r)*100;return b.jsxs("div",{className:"bear-absolute bear-flex bear-flex-col bear-items-center",style:{left:`${i}%`},children:[b.jsx("div",{className:"bear-w-0.5 bear-h-2 bear-bg-gray-400 dark:bear-bg-gray-500"}),e.label&&b.jsx("span",{className:"bear-mt-1 bear-text-xs bear-text-gray-500",children:e.label})]},e.value)})})};return b.jsx("div",{className:g.cn("bear-relative bear-w-full bear-flex bear-items-center",m.height,s&&"bear-opacity-50 bear-cursor-not-allowed",q),"data-testid":O,..._,children:b.jsxs("div",{ref:w,className:g.cn("bear-relative bear-w-full bear-rounded-full bear-bg-gray-200 dark:bear-bg-gray-700",m.track,!s&&"bear-cursor-pointer"),onMouseDown:D,children:[b.jsx("div",{className:g.cn("bear-absolute bear-inset-y-0 bear-left-0 bear-rounded-full",j.track),style:{width:`${M}%`}}),B(),b.jsx("div",{role:"slider",tabIndex:s?-1:0,"aria-label":I,"aria-valuemin":r,"aria-valuemax":t,"aria-valuenow":o,className:g.cn("bear-absolute bear-top-1/2 bear--translate-y-1/2 bear--translate-x-1/2 bear-rounded-full","bear-border-2 bear-shadow-md bear-transition-transform","focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-bear-500 focus:bear-ring-offset-2",m.thumb,j.thumb,!s&&"bear-cursor-grab active:bear-cursor-grabbing hover:bear-scale-110",l&&"bear-scale-125"),style:{left:`${M}%`},onMouseDown:D,onKeyDown:z,onFocus:()=>h(!0),onBlur:()=>!l&&h(!1),children:V&&$&&b.jsx("div",{className:"bear-absolute bear-bottom-full bear-left-1/2 bear--translate-x-1/2 bear-mb-2 bear-px-2 bear-py-1 bear-bg-gray-900 bear-text-white bear-text-xs bear-rounded bear-whitespace-nowrap",children:T(o)})})]})})};exports.Slider=Y;
|
|
@@ -42,7 +42,7 @@ const Z = {
|
|
|
42
42
|
},
|
|
43
43
|
outline: {
|
|
44
44
|
track: "bear-bg-gray-600",
|
|
45
|
-
thumb: "bear-bg-white bear-border-gray-600"
|
|
45
|
+
thumb: "bear-bg-white dark:bear-bg-gray-200 bear-border-gray-600 dark:bear-border-gray-400"
|
|
46
46
|
}
|
|
47
47
|
}, C = ({
|
|
48
48
|
value: V,
|
|
@@ -64,15 +64,15 @@ const Z = {
|
|
|
64
64
|
testId: B,
|
|
65
65
|
...K
|
|
66
66
|
}) => {
|
|
67
|
-
const [f, M] = k(R), [s, S] = k(!1), [O, h] = k(!1), m = H(null), l = V ?? f, D = (l - r) / (t - r) * 100,
|
|
67
|
+
const [f, M] = k(R), [s, S] = k(!1), [O, h] = k(!1), m = H(null), l = V ?? f, D = (l - r) / (t - r) * 100, y = Z[I], E = q[T], w = x((a) => {
|
|
68
68
|
if (!m.current || b) return;
|
|
69
69
|
const e = m.current.getBoundingClientRect(), n = Math.max(0, Math.min(1, (a - e.left) / e.width)), Y = r + n * (t - r), F = Math.round(Y / o) * o, L = Math.max(r, Math.min(t, F));
|
|
70
70
|
M(L), u == null || u(L);
|
|
71
71
|
}, [r, t, o, b, u]), N = (a) => {
|
|
72
|
-
b || (a.preventDefault(), S(!0), h(!0),
|
|
72
|
+
b || (a.preventDefault(), S(!0), h(!0), w(a.clientX));
|
|
73
73
|
}, v = x((a) => {
|
|
74
|
-
s &&
|
|
75
|
-
}, [s,
|
|
74
|
+
s && w(a.clientX);
|
|
75
|
+
}, [s, w]), p = x(() => {
|
|
76
76
|
s && (S(!1), h(!1), i == null || i(l));
|
|
77
77
|
}, [s, l, i]);
|
|
78
78
|
P(() => {
|
|
@@ -129,7 +129,7 @@ const Z = {
|
|
|
129
129
|
{
|
|
130
130
|
className: d(
|
|
131
131
|
"bear-relative bear-w-full bear-flex bear-items-center",
|
|
132
|
-
|
|
132
|
+
y.height,
|
|
133
133
|
b && "bear-opacity-50 bear-cursor-not-allowed",
|
|
134
134
|
z
|
|
135
135
|
),
|
|
@@ -141,7 +141,7 @@ const Z = {
|
|
|
141
141
|
ref: m,
|
|
142
142
|
className: d(
|
|
143
143
|
"bear-relative bear-w-full bear-rounded-full bear-bg-gray-200 dark:bear-bg-gray-700",
|
|
144
|
-
|
|
144
|
+
y.track,
|
|
145
145
|
!b && "bear-cursor-pointer"
|
|
146
146
|
),
|
|
147
147
|
onMouseDown: N,
|
|
@@ -167,7 +167,7 @@ const Z = {
|
|
|
167
167
|
"bear-absolute bear-top-1/2 bear--translate-y-1/2 bear--translate-x-1/2 bear-rounded-full",
|
|
168
168
|
"bear-border-2 bear-shadow-md bear-transition-transform",
|
|
169
169
|
"focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-bear-500 focus:bear-ring-offset-2",
|
|
170
|
-
|
|
170
|
+
y.thumb,
|
|
171
171
|
E.thumb,
|
|
172
172
|
!b && "bear-cursor-grab active:bear-cursor-grabbing hover:bear-scale-110",
|
|
173
173
|
s && "bear-scale-125"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),N=require("react"),i=require("../../utils/cn.cjs"),t=require("./Sparkline.const.cjs"),S=require("./Sparkline.utils.cjs"),L=d=>{const{data:a,width:I=t.SPARKLINE.DEFAULT_WIDTH,height:f=t.SPARKLINE.DEFAULT_HEIGHT,color:s=t.SPARKLINE.DEFAULT_COLOR,fill:p=!1,strokeWidth:R=t.SPARKLINE.DEFAULT_STROKE_WIDTH,showExtremes:o=!1,animated:c=!0,className:x,...A}=d,{path:u,areaPath:E,minPoint:n,maxPoint:r}=N.useMemo(()=>S.calculateSparklinePathData(a),[a]),l=`sparkline-gradient-${s.replace("#","")}`;return e.jsx("div",{className:i.cn("inline-block",x),style:{width:I,height:f},...A,children:e.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"w-full h-full",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:l,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[e.jsx("stop",{offset:"0%",stopColor:s,stopOpacity:"0.4"}),e.jsx("stop",{offset:"100%",stopColor:s,stopOpacity:"0"})]})}),p&&e.jsx("path",{d:E,fill:`url(#${l})`,className:i.cn(c&&"animate-fade-in")}),e.jsx("path",{d:u,fill:"none",stroke:s,strokeWidth:R,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke",className:i.cn(c&&"animate-draw-line")}),o&&n&&e.jsx("circle",{cx:n.x,cy:n.y,r:t.SPARKLINE.INDICATOR_RADIUS,fill:t.SPARKLINE.MIN_INDICATOR_COLOR,vectorEffect:"non-scaling-stroke"}),o&&r&&e.jsx("circle",{cx:r.x,cy:r.y,r:t.SPARKLINE.INDICATOR_RADIUS,fill:t.SPARKLINE.MAX_INDICATOR_COLOR,vectorEffect:"non-scaling-stroke"})]})})};exports.Sparkline=L;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I={DEFAULT_WIDTH:100,DEFAULT_HEIGHT:32,DEFAULT_COLOR:"#ec4899",DEFAULT_STROKE_WIDTH:2,VIEWBOX_SIZE:100,Y_PADDING:10,Y_RANGE:80,CONTROL_POINT_FACTOR:3,MIN_INDICATOR_COLOR:"#ef4444",MAX_INDICATOR_COLOR:"#10b981",INDICATOR_RADIUS:3};exports.SPARKLINE=I;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sparkline constants
|
|
3
|
+
*/
|
|
4
|
+
export declare const SPARKLINE: {
|
|
5
|
+
readonly DEFAULT_WIDTH: 100;
|
|
6
|
+
readonly DEFAULT_HEIGHT: 32;
|
|
7
|
+
readonly DEFAULT_COLOR: "#ec4899";
|
|
8
|
+
readonly DEFAULT_STROKE_WIDTH: 2;
|
|
9
|
+
readonly VIEWBOX_SIZE: 100;
|
|
10
|
+
readonly Y_PADDING: 10;
|
|
11
|
+
readonly Y_RANGE: 80;
|
|
12
|
+
readonly CONTROL_POINT_FACTOR: 3;
|
|
13
|
+
readonly MIN_INDICATOR_COLOR: "#ef4444";
|
|
14
|
+
readonly MAX_INDICATOR_COLOR: "#10b981";
|
|
15
|
+
readonly INDICATOR_RADIUS: 3;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const I = {
|
|
2
|
+
DEFAULT_WIDTH: 100,
|
|
3
|
+
DEFAULT_HEIGHT: 32,
|
|
4
|
+
DEFAULT_COLOR: "#ec4899",
|
|
5
|
+
DEFAULT_STROKE_WIDTH: 2,
|
|
6
|
+
VIEWBOX_SIZE: 100,
|
|
7
|
+
Y_PADDING: 10,
|
|
8
|
+
Y_RANGE: 80,
|
|
9
|
+
CONTROL_POINT_FACTOR: 3,
|
|
10
|
+
MIN_INDICATOR_COLOR: "#ef4444",
|
|
11
|
+
MAX_INDICATOR_COLOR: "#10b981",
|
|
12
|
+
INDICATOR_RADIUS: 3
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
I as SPARKLINE
|
|
16
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as e, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as R } from "react";
|
|
3
|
+
import { cn as i } from "../../utils/cn.js";
|
|
4
|
+
import { SPARKLINE as t } from "./Sparkline.const.js";
|
|
5
|
+
import { calculateSparklinePathData as T } from "./Sparkline.utils.js";
|
|
6
|
+
const u = (p) => {
|
|
7
|
+
const {
|
|
8
|
+
data: s,
|
|
9
|
+
width: m = t.DEFAULT_WIDTH,
|
|
10
|
+
height: d = t.DEFAULT_HEIGHT,
|
|
11
|
+
color: o = t.DEFAULT_COLOR,
|
|
12
|
+
fill: I = !1,
|
|
13
|
+
strokeWidth: h = t.DEFAULT_STROKE_WIDTH,
|
|
14
|
+
showExtremes: l = !1,
|
|
15
|
+
animated: n = !0,
|
|
16
|
+
className: A,
|
|
17
|
+
...D
|
|
18
|
+
} = p, { path: O, areaPath: x, minPoint: r, maxPoint: a } = R(
|
|
19
|
+
() => T(s),
|
|
20
|
+
[s]
|
|
21
|
+
), c = `sparkline-gradient-${o.replace("#", "")}`;
|
|
22
|
+
return /* @__PURE__ */ e(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: i("inline-block", A),
|
|
26
|
+
style: { width: m, height: d },
|
|
27
|
+
...D,
|
|
28
|
+
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "w-full h-full", children: [
|
|
29
|
+
/* @__PURE__ */ e("defs", { children: /* @__PURE__ */ f("linearGradient", { id: c, x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
30
|
+
/* @__PURE__ */ e("stop", { offset: "0%", stopColor: o, stopOpacity: "0.4" }),
|
|
31
|
+
/* @__PURE__ */ e("stop", { offset: "100%", stopColor: o, stopOpacity: "0" })
|
|
32
|
+
] }) }),
|
|
33
|
+
I && /* @__PURE__ */ e(
|
|
34
|
+
"path",
|
|
35
|
+
{
|
|
36
|
+
d: x,
|
|
37
|
+
fill: `url(#${c})`,
|
|
38
|
+
className: i(n && "animate-fade-in")
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ e(
|
|
42
|
+
"path",
|
|
43
|
+
{
|
|
44
|
+
d: O,
|
|
45
|
+
fill: "none",
|
|
46
|
+
stroke: o,
|
|
47
|
+
strokeWidth: h,
|
|
48
|
+
strokeLinecap: "round",
|
|
49
|
+
strokeLinejoin: "round",
|
|
50
|
+
vectorEffect: "non-scaling-stroke",
|
|
51
|
+
className: i(n && "animate-draw-line")
|
|
52
|
+
}
|
|
53
|
+
),
|
|
54
|
+
l && r && /* @__PURE__ */ e(
|
|
55
|
+
"circle",
|
|
56
|
+
{
|
|
57
|
+
cx: r.x,
|
|
58
|
+
cy: r.y,
|
|
59
|
+
r: t.INDICATOR_RADIUS,
|
|
60
|
+
fill: t.MIN_INDICATOR_COLOR,
|
|
61
|
+
vectorEffect: "non-scaling-stroke"
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
l && a && /* @__PURE__ */ e(
|
|
65
|
+
"circle",
|
|
66
|
+
{
|
|
67
|
+
cx: a.x,
|
|
68
|
+
cy: a.y,
|
|
69
|
+
r: t.INDICATOR_RADIUS,
|
|
70
|
+
fill: t.MAX_INDICATOR_COLOR,
|
|
71
|
+
vectorEffect: "non-scaling-stroke"
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
] })
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
u as Sparkline
|
|
80
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SparklineProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Data points (array of numbers) */
|
|
4
|
+
data: number[];
|
|
5
|
+
/** Width of the sparkline */
|
|
6
|
+
width?: number;
|
|
7
|
+
/** Height of the sparkline */
|
|
8
|
+
height?: number;
|
|
9
|
+
/** Line color */
|
|
10
|
+
color?: string;
|
|
11
|
+
/** Fill area under the line */
|
|
12
|
+
fill?: boolean;
|
|
13
|
+
/** Line width */
|
|
14
|
+
strokeWidth?: number;
|
|
15
|
+
/** Show min/max indicators */
|
|
16
|
+
showExtremes?: boolean;
|
|
17
|
+
/** Animate on render */
|
|
18
|
+
animated?: boolean;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Sparkline.const.cjs"),I=n=>{if(n.length===0)return[];const a=Math.max(...n),e=Math.min(...n),c=a-e||1;return n.map((t,l)=>({x:l/(n.length-1||1)*r.SPARKLINE.VIEWBOX_SIZE,y:r.SPARKLINE.VIEWBOX_SIZE-(t-e)/c*r.SPARKLINE.Y_RANGE-r.SPARKLINE.Y_PADDING,value:t}))},S=n=>n.length===0?"":n.reduce((a,e,c)=>{if(c===0)return`M ${e.x},${e.y}`;const t=n[c-1],l=t.x+(e.x-t.x)/r.SPARKLINE.CONTROL_POINT_FACTOR,P=e.x-(e.x-t.x)/r.SPARKLINE.CONTROL_POINT_FACTOR;return`${a} C ${l},${t.y} ${P},${e.y} ${e.x},${e.y}`},""),s=n=>n?`${n} L ${r.SPARKLINE.VIEWBOX_SIZE},${r.SPARKLINE.VIEWBOX_SIZE} L 0,${r.SPARKLINE.VIEWBOX_SIZE} Z`:"",x=n=>{if(n.length===0)return{path:"",areaPath:"",minPoint:null,maxPoint:null};const a=I(n),e=Math.max(...n),c=Math.min(...n),t=n.indexOf(c),l=n.indexOf(e),P=S(a),u=s(P);return{path:P,areaPath:u,minPoint:a[t]||null,maxPoint:a[l]||null}};exports.calculateSparklinePathData=x;exports.calculateSparklinePoints=I;exports.generateAreaPath=s;exports.generateSparklinePath=S;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface SparklinePoint {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
export interface SparklinePathData {
|
|
7
|
+
path: string;
|
|
8
|
+
areaPath: string;
|
|
9
|
+
minPoint: SparklinePoint | null;
|
|
10
|
+
maxPoint: SparklinePoint | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Calculate points for sparkline from data array
|
|
14
|
+
*/
|
|
15
|
+
export declare const calculateSparklinePoints: (data: number[]) => SparklinePoint[];
|
|
16
|
+
/**
|
|
17
|
+
* Generate smooth bezier curve path from points
|
|
18
|
+
*/
|
|
19
|
+
export declare const generateSparklinePath: (points: SparklinePoint[]) => string;
|
|
20
|
+
/**
|
|
21
|
+
* Generate area path for filled sparkline
|
|
22
|
+
*/
|
|
23
|
+
export declare const generateAreaPath: (linePath: string) => string;
|
|
24
|
+
/**
|
|
25
|
+
* Calculate all sparkline path data from raw data
|
|
26
|
+
*/
|
|
27
|
+
export declare const calculateSparklinePathData: (data: number[]) => SparklinePathData;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SPARKLINE as e } from "./Sparkline.const.js";
|
|
2
|
+
const s = (n) => {
|
|
3
|
+
if (n.length === 0) return [];
|
|
4
|
+
const c = Math.max(...n), t = Math.min(...n), x = c - t || 1;
|
|
5
|
+
return n.map((r, l) => ({
|
|
6
|
+
x: l / (n.length - 1 || 1) * e.VIEWBOX_SIZE,
|
|
7
|
+
y: e.VIEWBOX_SIZE - (r - t) / x * e.Y_RANGE - e.Y_PADDING,
|
|
8
|
+
value: r
|
|
9
|
+
}));
|
|
10
|
+
}, a = (n) => n.length === 0 ? "" : n.reduce((c, t, x) => {
|
|
11
|
+
if (x === 0) return `M ${t.x},${t.y}`;
|
|
12
|
+
const r = n[x - 1], l = r.x + (t.x - r.x) / e.CONTROL_POINT_FACTOR, m = t.x - (t.x - r.x) / e.CONTROL_POINT_FACTOR;
|
|
13
|
+
return `${c} C ${l},${r.y} ${m},${t.y} ${t.x},${t.y}`;
|
|
14
|
+
}, ""), u = (n) => n ? `${n} L ${e.VIEWBOX_SIZE},${e.VIEWBOX_SIZE} L 0,${e.VIEWBOX_SIZE} Z` : "", O = (n) => {
|
|
15
|
+
if (n.length === 0)
|
|
16
|
+
return { path: "", areaPath: "", minPoint: null, maxPoint: null };
|
|
17
|
+
const c = s(n), t = Math.max(...n), x = Math.min(...n), r = n.indexOf(x), l = n.indexOf(t), m = a(c), o = u(m);
|
|
18
|
+
return {
|
|
19
|
+
path: m,
|
|
20
|
+
areaPath: o,
|
|
21
|
+
minPoint: c[r] || null,
|
|
22
|
+
maxPoint: c[l] || null
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
O as calculateSparklinePathData,
|
|
27
|
+
s as calculateSparklinePoints,
|
|
28
|
+
u as generateAreaPath,
|
|
29
|
+
a as generateSparklinePath
|
|
30
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Sparkline } from './Sparkline';
|
|
2
|
+
export type { SparklineProps } from './Sparkline.types';
|
|
3
|
+
export { SPARKLINE } from './Sparkline.const';
|
|
4
|
+
export { calculateSparklinePoints, calculateSparklinePathData, generateSparklinePath, generateAreaPath, } from './Sparkline.utils';
|
|
5
|
+
export type { SparklinePoint, SparklinePathData } from './Sparkline.utils';
|
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),o=require("react"),i=require("../../utils/cn.cjs"),r=require("./SpeedDial.const.cjs"),O=({className:a})=>t.jsxs("svg",{className:a,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),t.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),T=({className:a})=>t.jsxs("svg",{className:a,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),t.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),E=o.forwardRef(({actions:a,icon:S,openIcon:y,direction:u="up",size:f="md",position:m,fixed:I=!0,openOnHover:x=!1,open:p,onOpenChange:c,showLabels:_=!0,ariaLabel:D="Speed dial",testId:b,className:h,...A},v)=>{const[L,j]=o.useState(!1),d=o.useRef(null),s=p!==void 0?p:L,n=o.useCallback(e=>{j(e),c==null||c(e)},[c]),w=o.useCallback(()=>{n(!s)},[s,n]);o.useEffect(()=>{const e=l=>{d.current&&!d.current.contains(l.target)&&n(!1)};if(s)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[s,n]),o.useEffect(()=>{const e=l=>{l.key==="Escape"&&n(!1)};if(s)return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s,n]);const N=r.SPEED_DIAL_MAIN_SIZES[f],k=r.SPEED_DIAL_ACTION_SIZES[f],P=()=>{switch(u){case"up":return"bottom-full left-1/2 -translate-x-1/2 pb-3 flex-col-reverse";case"down":return"top-full left-1/2 -translate-x-1/2 pt-3 flex-col";case"left":return"right-full top-1/2 -translate-y-1/2 pr-3 flex-row-reverse";case"right":return"left-full top-1/2 -translate-y-1/2 pl-3 flex-row";default:return""}},C=e=>{switch(e.tooltipPosition||(u==="up"||u==="down"?"left":"top")){case"left":return"right-full mr-2";case"right":return"left-full ml-2";case"top":return"bottom-full mb-2";case"bottom":return"top-full mt-2";default:return"right-full mr-2"}},g=e=>{var l;e.disabled||((l=e.onClick)==null||l.call(e),n(!1))};return t.jsxs("div",{ref:d,className:i.cn(r.SPEED_DIAL_BASE,I&&m&&r.SPEED_DIAL_POSITIONS[m],h),"data-testid":b,onMouseEnter:x?()=>n(!0):void 0,onMouseLeave:x?()=>n(!1):void 0,...A,children:[s&&t.jsx("div",{className:i.cn(r.SPEED_DIAL_ACTIONS_CONTAINER,P()),children:a.map((e,l)=>t.jsxs("div",{className:"relative flex items-center",style:{animation:`fadeInUp 150ms ease-out ${l*50}ms forwards`,opacity:0},children:[_&&t.jsx("span",{className:i.cn(r.SPEED_DIAL_LABEL,C(e)),children:e.label}),t.jsx("button",{type:"button",className:i.cn(r.SPEED_DIAL_ACTION,k,e.disabled?"opacity-50 cursor-not-allowed":r.SPEED_DIAL_ACTION_COLORS,"flex items-center justify-center"),style:e.color?{backgroundColor:e.color,color:"white"}:void 0,onClick:()=>g(e),disabled:e.disabled,"aria-label":e.label,children:e.icon})]},l))}),t.jsx("button",{ref:v,type:"button",className:i.cn(r.SPEED_DIAL_MAIN_BUTTON,N,r.SPEED_DIAL_MAIN_COLORS,"flex items-center justify-center",s&&"rotate-45"),onClick:w,"aria-label":D,"aria-expanded":s,children:s?y||t.jsx(T,{}):S||t.jsx(O,{})}),t.jsx("style",{children:`
|
|
2
|
+
@keyframes fadeInUp {
|
|
3
|
+
from {
|
|
4
|
+
opacity: 0;
|
|
5
|
+
transform: translateY(8px);
|
|
6
|
+
}
|
|
7
|
+
to {
|
|
8
|
+
opacity: 1;
|
|
9
|
+
transform: translateY(0);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`})]})});E.displayName="SpeedDial";exports.SpeedDial=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t="Bear-SpeedDial relative inline-flex flex-col items-center",e={"bottom-right":"fixed bottom-6 right-6","bottom-left":"fixed bottom-6 left-6","top-right":"fixed top-6 right-6","top-left":"fixed top-6 left-6"},_="Bear-SpeedDial__trigger rounded-full shadow-lg transition-all duration-200",E={sm:"w-12 h-12",md:"w-14 h-14",lg:"w-16 h-16"},S="bg-pink-500 hover:bg-pink-600 text-white",o="Bear-SpeedDial__action rounded-full shadow-md transition-all duration-200",D={sm:"w-9 h-9",md:"w-10 h-10",lg:"w-12 h-12"},I="bg-white dark:bg-zinc-800 text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-zinc-700",i="Bear-SpeedDial__actions absolute flex items-center gap-2",A="Bear-SpeedDial__label px-2 py-1 text-xs font-medium bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded shadow-md whitespace-nowrap";exports.SPEED_DIAL_ACTION=o;exports.SPEED_DIAL_ACTIONS_CONTAINER=i;exports.SPEED_DIAL_ACTION_COLORS=I;exports.SPEED_DIAL_ACTION_SIZES=D;exports.SPEED_DIAL_BASE=t;exports.SPEED_DIAL_LABEL=A;exports.SPEED_DIAL_MAIN_BUTTON=_;exports.SPEED_DIAL_MAIN_COLORS=S;exports.SPEED_DIAL_MAIN_SIZES=E;exports.SPEED_DIAL_POSITIONS=e;
|