@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,203 +1,186 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { cn as
|
|
1
|
+
import { jsxs as l, Fragment as ue, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as P, useCallback as h } from "react";
|
|
3
|
+
import { cn as O } from "../../utils/cn.js";
|
|
4
4
|
import { useBearStyles as me } from "../../hooks/useBearStyles.js";
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}, ee = N(
|
|
58
|
-
(t) => l && t < l || v && t > v ? !0 : y.some((r) => P(r, t)),
|
|
59
|
-
[l, v, y]
|
|
60
|
-
), re = N(
|
|
61
|
-
(t) => g.some((r) => P(r, t)),
|
|
62
|
-
[g]
|
|
63
|
-
), te = w(
|
|
64
|
-
() => pe(s, d, i),
|
|
65
|
-
[s, d, i]
|
|
66
|
-
), J = w(
|
|
67
|
-
() => i > 0 ? [...p.slice(i), ...p.slice(0, i)] : p,
|
|
68
|
-
[p, i]
|
|
69
|
-
), T = xe[d], A = a != null, ae = X ? "bear-block bear-w-full bear-bg-white bear-rounded-xl bear-shadow-none bear-border bear-border-zinc-200 bear-p-4 bear-text-zinc-900" : "bear-absolute bear-z-50 bear-mt-2 bear-bg-white bear-rounded-xl bear-shadow-xl bear-border bear-border-zinc-200 bear-p-4 bear-w-80 bear-text-zinc-900", ne = () => {
|
|
5
|
+
import { ChevronsLeftIcon as be, ChevronLeftIcon as ke, ChevronRightIcon as xe, ChevronsRightIcon as ve } from "../Icon/index.js";
|
|
6
|
+
import { DEFAULT_WEEKDAYS as ye, NUMBER as c, MONTHS as pe, WEEKEND_LABELS as ze } from "./Calendar.const.js";
|
|
7
|
+
import { isSameDay as y, buildCalendarGrid as ge, reorderWeekdays as Ne, isWeekendDay as fe } from "./Calendar.utils.js";
|
|
8
|
+
import { DefaultHeaderLabel as Ce } from "./Calendar.helpers.js";
|
|
9
|
+
const Te = (_) => {
|
|
10
|
+
const {
|
|
11
|
+
viewDate: B,
|
|
12
|
+
value: L = null,
|
|
13
|
+
onSelect: p,
|
|
14
|
+
onViewChange: o,
|
|
15
|
+
minDate: z,
|
|
16
|
+
maxDate: g,
|
|
17
|
+
disabledDates: W = [],
|
|
18
|
+
highlightedDates: Y = [],
|
|
19
|
+
weekdayLabels: M = ye,
|
|
20
|
+
firstDayOfWeek: k = c.ZERO,
|
|
21
|
+
showWeekNumbers: De = !1,
|
|
22
|
+
slots: e = {},
|
|
23
|
+
clearable: K = !0,
|
|
24
|
+
onClear: u,
|
|
25
|
+
showTodayButton: U = !0,
|
|
26
|
+
onToday: m,
|
|
27
|
+
bis: Z,
|
|
28
|
+
style: q,
|
|
29
|
+
inline: J = !1,
|
|
30
|
+
className: Q
|
|
31
|
+
} = _, i = B.getFullYear(), T = me(Z, q), s = B.getMonth(), X = P(() => /* @__PURE__ */ new Date(), []), N = h(() => {
|
|
32
|
+
o == null || o(new Date(i - c.ONE, s, c.ONE));
|
|
33
|
+
}, [i, s, o]), j = h(() => {
|
|
34
|
+
o == null || o(new Date(i, s - c.ONE, c.ONE));
|
|
35
|
+
}, [i, s, o]), S = h(() => {
|
|
36
|
+
o == null || o(new Date(i, s + c.ONE, c.ONE));
|
|
37
|
+
}, [i, s, o]), f = h(() => {
|
|
38
|
+
o == null || o(new Date(i + c.ONE, s, c.ONE));
|
|
39
|
+
}, [i, s, o]), C = j, D = S, $ = {
|
|
40
|
+
onPrevYear: N,
|
|
41
|
+
onPrevMonth: j,
|
|
42
|
+
onNextMonth: S,
|
|
43
|
+
onNextYear: f
|
|
44
|
+
}, V = h(
|
|
45
|
+
(n) => z && n < z || g && n > g ? !0 : W.some((t) => y(t, n)),
|
|
46
|
+
[z, g, W]
|
|
47
|
+
), ee = h(
|
|
48
|
+
(n) => Y.some((t) => y(t, n)),
|
|
49
|
+
[Y]
|
|
50
|
+
), te = P(
|
|
51
|
+
() => ge(i, s, k),
|
|
52
|
+
[i, s, k]
|
|
53
|
+
), H = P(
|
|
54
|
+
() => Ne(M, k),
|
|
55
|
+
[M, k]
|
|
56
|
+
), F = pe[s], w = L != null, ne = J ? "block w-full bg-white dark:bg-gray-900 rounded-xl shadow-none border border-zinc-200 dark:border-zinc-700 p-4 text-zinc-900 dark:text-zinc-100" : "absolute z-50 mt-2 bg-white dark:bg-gray-900 rounded-xl shadow-xl border border-zinc-200 dark:border-zinc-700 p-4 w-80 text-zinc-900 dark:text-zinc-100", re = () => {
|
|
70
57
|
if (e.header)
|
|
71
|
-
return e.header({ month:
|
|
72
|
-
const
|
|
73
|
-
return /* @__PURE__ */
|
|
74
|
-
/* @__PURE__ */
|
|
75
|
-
|
|
58
|
+
return e.header({ month: F, year: i, onPrev: C, onNext: D, nav: $ });
|
|
59
|
+
const n = e.navPrevYear, t = e.navPrev, a = e.navNext, d = e.navNextYear, x = e.headerLabel || Ce;
|
|
60
|
+
return /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-1 mb-4", children: [
|
|
61
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
|
|
62
|
+
n ? n({ onClick: N }) : /* @__PURE__ */ r(
|
|
76
63
|
"button",
|
|
77
64
|
{
|
|
78
65
|
type: "button",
|
|
79
|
-
onClick:
|
|
80
|
-
className: "
|
|
66
|
+
onClick: N,
|
|
67
|
+
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
81
68
|
"aria-label": "Previous year",
|
|
82
|
-
children:
|
|
69
|
+
children: /* @__PURE__ */ r(be, { size: 16 })
|
|
83
70
|
}
|
|
84
71
|
),
|
|
85
|
-
|
|
72
|
+
t ? t({ onClick: C }) : /* @__PURE__ */ r(
|
|
86
73
|
"button",
|
|
87
74
|
{
|
|
88
75
|
type: "button",
|
|
89
|
-
onClick:
|
|
90
|
-
className: "
|
|
76
|
+
onClick: C,
|
|
77
|
+
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
91
78
|
"aria-label": "Previous month",
|
|
92
|
-
children:
|
|
79
|
+
children: /* @__PURE__ */ r(ke, { size: 16 })
|
|
93
80
|
}
|
|
94
81
|
)
|
|
95
82
|
] }),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
s
|
|
100
|
-
] }),
|
|
101
|
-
/* @__PURE__ */ m("div", { className: "bear-flex bear-items-center bear-gap-0.5", children: [
|
|
102
|
-
o ? o({ onClick: B }) : /* @__PURE__ */ c(
|
|
83
|
+
x({ month: F, year: i }),
|
|
84
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-0.5", children: [
|
|
85
|
+
a ? a({ onClick: D }) : /* @__PURE__ */ r(
|
|
103
86
|
"button",
|
|
104
87
|
{
|
|
105
88
|
type: "button",
|
|
106
|
-
onClick:
|
|
107
|
-
className: "
|
|
89
|
+
onClick: D,
|
|
90
|
+
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
108
91
|
"aria-label": "Next month",
|
|
109
|
-
children:
|
|
92
|
+
children: /* @__PURE__ */ r(xe, { size: 16 })
|
|
110
93
|
}
|
|
111
94
|
),
|
|
112
|
-
|
|
95
|
+
d ? d({ onClick: f }) : /* @__PURE__ */ r(
|
|
113
96
|
"button",
|
|
114
97
|
{
|
|
115
98
|
type: "button",
|
|
116
|
-
onClick:
|
|
117
|
-
className: "
|
|
99
|
+
onClick: f,
|
|
100
|
+
className: "p-1.5 rounded text-zinc-500 dark:text-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800 transition-colors",
|
|
118
101
|
"aria-label": "Next year",
|
|
119
|
-
children:
|
|
102
|
+
children: /* @__PURE__ */ r(ve, { size: 16 })
|
|
120
103
|
}
|
|
121
104
|
)
|
|
122
105
|
] })
|
|
123
106
|
] });
|
|
124
|
-
},
|
|
125
|
-
if (e.weekdays) return e.weekdays({ days:
|
|
126
|
-
const
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
(
|
|
107
|
+
}, oe = () => {
|
|
108
|
+
if (e.weekdays) return e.weekdays({ days: H });
|
|
109
|
+
const n = e.weekday;
|
|
110
|
+
return /* @__PURE__ */ r("div", { className: "grid grid-cols-7 gap-1 mb-2", children: H.map(
|
|
111
|
+
(t) => n ? /* @__PURE__ */ r("div", { children: n({ label: t }) }, t) : /* @__PURE__ */ r(
|
|
129
112
|
"div",
|
|
130
113
|
{
|
|
131
|
-
className:
|
|
132
|
-
"
|
|
133
|
-
(
|
|
114
|
+
className: O(
|
|
115
|
+
"text-center text-xs font-medium uppercase",
|
|
116
|
+
ze.includes(t) && "text-red-500"
|
|
134
117
|
),
|
|
135
|
-
children:
|
|
118
|
+
children: t
|
|
136
119
|
},
|
|
137
|
-
|
|
120
|
+
t
|
|
138
121
|
)
|
|
139
122
|
) });
|
|
140
|
-
},
|
|
141
|
-
const { date:
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
date:
|
|
145
|
-
day:
|
|
146
|
-
isCurrentMonth:
|
|
147
|
-
isSelected:
|
|
148
|
-
isToday:
|
|
149
|
-
isDisabled:
|
|
150
|
-
isHighlighted:
|
|
151
|
-
onClick:
|
|
123
|
+
}, ae = (n, t) => {
|
|
124
|
+
const { date: a, isCurrentMonth: d } = n, x = a.getDate(), de = a.getDay(), le = fe(de), b = y(L, a), E = y(X, a), v = V(a), A = ee(a), G = () => {
|
|
125
|
+
v || p == null || p(a);
|
|
126
|
+
}, he = {
|
|
127
|
+
date: a,
|
|
128
|
+
day: x,
|
|
129
|
+
isCurrentMonth: d,
|
|
130
|
+
isSelected: b,
|
|
131
|
+
isToday: E,
|
|
132
|
+
isDisabled: v,
|
|
133
|
+
isHighlighted: A,
|
|
134
|
+
onClick: G
|
|
152
135
|
};
|
|
153
|
-
return e.day ? /* @__PURE__ */
|
|
136
|
+
return e.day ? /* @__PURE__ */ r("span", { children: e.day(he) }, t) : /* @__PURE__ */ r(
|
|
154
137
|
"button",
|
|
155
138
|
{
|
|
156
139
|
type: "button",
|
|
157
|
-
onClick:
|
|
158
|
-
disabled:
|
|
159
|
-
className:
|
|
160
|
-
"
|
|
161
|
-
|
|
162
|
-
!
|
|
163
|
-
!
|
|
164
|
-
|
|
165
|
-
|
|
140
|
+
onClick: G,
|
|
141
|
+
disabled: v,
|
|
142
|
+
className: O(
|
|
143
|
+
"w-8 h-8 rounded-full text-sm font-medium transition-colors flex items-center justify-center",
|
|
144
|
+
b && "bg-pink-500 text-white hover:bg-pink-600",
|
|
145
|
+
!b && E && "ring-2 ring-pink-500/50 bg-transparent",
|
|
146
|
+
!b && !E && (d ? le ? "text-red-500 dark:text-red-400 hover:bg-zinc-100 dark:hover:bg-zinc-800" : "text-zinc-700 dark:text-zinc-300 hover:bg-zinc-100 dark:hover:bg-zinc-800" : "text-zinc-400 dark:text-zinc-600 hover:bg-zinc-50 dark:hover:bg-zinc-800/50"),
|
|
147
|
+
A && !b && "bg-pink-500/15",
|
|
148
|
+
v && "opacity-40 cursor-not-allowed"
|
|
166
149
|
),
|
|
167
|
-
children:
|
|
150
|
+
children: x
|
|
168
151
|
},
|
|
169
|
-
|
|
152
|
+
t
|
|
170
153
|
);
|
|
171
|
-
},
|
|
172
|
-
const
|
|
173
|
-
return e.daysGrid ? e.daysGrid({ children:
|
|
154
|
+
}, ie = () => {
|
|
155
|
+
const n = te.map((t, a) => ae(t, a));
|
|
156
|
+
return e.daysGrid ? e.daysGrid({ children: n, className: "grid grid-cols-7 gap-1" }) : /* @__PURE__ */ r("div", { className: "grid grid-cols-7 gap-1", children: n });
|
|
174
157
|
}, se = () => {
|
|
175
|
-
const
|
|
176
|
-
if (!
|
|
158
|
+
const n = K && w && u, t = U && m;
|
|
159
|
+
if (!n && !t) return null;
|
|
177
160
|
if (e.footer) {
|
|
178
|
-
const
|
|
161
|
+
const a = e.clearButton, d = e.todayButton;
|
|
179
162
|
return e.footer({
|
|
180
|
-
children: /* @__PURE__ */
|
|
181
|
-
|
|
182
|
-
|
|
163
|
+
children: /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
|
|
164
|
+
n && a ? a({ onClick: u, hasSelection: w }) : n ? /* @__PURE__ */ r("button", { type: "button", onClick: u, className: "text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200", children: "Clear" }) : /* @__PURE__ */ r("span", {}),
|
|
165
|
+
t && d ? d({ onClick: m }) : t ? /* @__PURE__ */ r("button", { type: "button", onClick: m, className: "text-sm text-pink-600 hover:text-pink-700 font-medium", children: "Today" }) : null
|
|
183
166
|
] })
|
|
184
167
|
});
|
|
185
168
|
}
|
|
186
|
-
return e.clearButton && e.todayButton ? /* @__PURE__ */
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
] }) : /* @__PURE__ */
|
|
190
|
-
|
|
191
|
-
|
|
169
|
+
return e.clearButton && e.todayButton ? /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
|
|
170
|
+
n && e.clearButton({ onClick: u, hasSelection: w }),
|
|
171
|
+
t && e.todayButton({ onClick: m })
|
|
172
|
+
] }) : /* @__PURE__ */ l("div", { className: "flex justify-between gap-2 mt-4 pt-3 border-t border-zinc-200 dark:border-zinc-700", children: [
|
|
173
|
+
n ? /* @__PURE__ */ r("button", { type: "button", onClick: u, className: "text-sm text-zinc-500 dark:text-zinc-400 hover:text-zinc-700 dark:hover:text-zinc-200 transition-colors", children: "Clear" }) : /* @__PURE__ */ r("span", {}),
|
|
174
|
+
t ? /* @__PURE__ */ r("button", { type: "button", onClick: m, className: "text-sm text-pink-600 dark:text-pink-400 hover:text-pink-700 dark:hover:text-pink-300 font-medium transition-colors", children: "Today" }) : null
|
|
192
175
|
] });
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
be(),
|
|
176
|
+
}, I = /* @__PURE__ */ l(ue, { children: [
|
|
177
|
+
re(),
|
|
196
178
|
oe(),
|
|
179
|
+
ie(),
|
|
197
180
|
se()
|
|
198
|
-
] }),
|
|
199
|
-
return e.root ? e.root({ children:
|
|
181
|
+
] }), R = O(ne, Q), ce = Object.keys(T).length ? T : void 0;
|
|
182
|
+
return e.root ? e.root({ children: I, className: R }) : /* @__PURE__ */ r("div", { className: R, style: ce, children: I });
|
|
200
183
|
};
|
|
201
184
|
export {
|
|
202
|
-
|
|
185
|
+
Te as Calendar
|
|
203
186
|
};
|
|
@@ -8,6 +8,10 @@ export interface CalendarDayProps {
|
|
|
8
8
|
isDisabled: boolean;
|
|
9
9
|
isHighlighted?: boolean;
|
|
10
10
|
}
|
|
11
|
+
export type HeaderLabelRFC = (props: {
|
|
12
|
+
month: string;
|
|
13
|
+
year: number;
|
|
14
|
+
}) => ReactNode;
|
|
11
15
|
export interface CalendarNavActions {
|
|
12
16
|
onPrevYear: () => void;
|
|
13
17
|
onPrevMonth: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./Calendar.const.cjs"),N=(e,t)=>new Date(e,t+n.NUMBER.ONE,n.NUMBER.ZERO).getDate(),c=(e,t)=>new Date(e,t,n.NUMBER.ONE).getDay(),g=(e,t)=>!e||!t?!1:e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear(),l=e=>e===n.NUMBER.ZERO||e===n.NUMBER.SIX,i=(e,t)=>({prevMonth:t===n.NUMBER.ZERO?n.NUMBER.ELEVEN:t-n.NUMBER.ONE,prevYear:t===n.NUMBER.ZERO?e-n.NUMBER.ONE:e}),B=(e,t)=>({nextMonth:t===n.NUMBER.ELEVEN?n.NUMBER.ZERO:t+n.NUMBER.ONE,nextYear:t===n.NUMBER.ELEVEN?e+n.NUMBER.ONE:e}),D=(e,t)=>t>n.NUMBER.ZERO?[...e.slice(t),...e.slice(n.NUMBER.ZERO,t)]:[...e];function h(e,t,U){const s=(c(e,t)-U+n.NUMBER.SEVEN)%n.NUMBER.SEVEN,o=N(e,t),{prevMonth:a,prevYear:R}=i(e,t),d=N(R,a),M=[];for(let E=n.NUMBER.ZERO;E<n.NUMBER.TOTAL_CELLS;E++)if(E<s){const r=d-s+E+n.NUMBER.ONE;M.push({date:new Date(R,a,r),isCurrentMonth:!1})}else if(E<s+o){const r=E-s+n.NUMBER.ONE;M.push({date:new Date(e,t,r),isCurrentMonth:!0})}else{const r=E-s-o+n.NUMBER.ONE,{nextMonth:O,nextYear:u}=B(e,t);M.push({date:new Date(u,O,r),isCurrentMonth:!1})}return M}exports.buildCalendarGrid=h;exports.getDaysInMonth=N;exports.getFirstDayOfMonth=c;exports.getNextMonthYear=B;exports.getPrevMonthYear=i;exports.isSameDay=g;exports.isWeekendDay=l;exports.reorderWeekdays=D;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get number of days in a given month
|
|
3
|
+
*/
|
|
4
|
+
export declare const getDaysInMonth: (year: number, month: number) => number;
|
|
5
|
+
/**
|
|
6
|
+
* Get the day of week for the first day of a month (0 = Sunday)
|
|
7
|
+
*/
|
|
8
|
+
export declare const getFirstDayOfMonth: (year: number, month: number) => number;
|
|
9
|
+
/**
|
|
10
|
+
* Check if two dates are the same day
|
|
11
|
+
*/
|
|
12
|
+
export declare const isSameDay: (a: Date | null, b: Date | null) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Check if a day is a weekend (Saturday or Sunday)
|
|
15
|
+
*/
|
|
16
|
+
export declare const isWeekendDay: (weekday: number) => boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Get previous month and year
|
|
19
|
+
*/
|
|
20
|
+
export declare const getPrevMonthYear: (year: number, month: number) => {
|
|
21
|
+
prevMonth: number;
|
|
22
|
+
prevYear: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Get next month and year
|
|
26
|
+
*/
|
|
27
|
+
export declare const getNextMonthYear: (year: number, month: number) => {
|
|
28
|
+
nextMonth: number;
|
|
29
|
+
nextYear: number;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Reorder weekday labels based on first day of week
|
|
33
|
+
*/
|
|
34
|
+
export declare const reorderWeekdays: <T>(labels: readonly T[], firstDayOfWeek: number) => T[];
|
|
35
|
+
/**
|
|
36
|
+
* Build 6-week calendar grid: prev month trailing, current month, next month leading
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildCalendarGrid(year: number, month: number, firstDayOfWeek: number): {
|
|
39
|
+
date: Date;
|
|
40
|
+
isCurrentMonth: boolean;
|
|
41
|
+
}[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NUMBER as n } from "./Calendar.const.js";
|
|
2
|
+
const i = (t, e) => new Date(t, e + n.ONE, n.ZERO).getDate(), g = (t, e) => new Date(t, e, n.ONE).getDay(), p = (t, e) => !t || !e ? !1 : t.getDate() === e.getDate() && t.getMonth() === e.getMonth() && t.getFullYear() === e.getFullYear(), R = (t) => t === n.ZERO || t === n.SIX, l = (t, e) => ({
|
|
3
|
+
prevMonth: e === n.ZERO ? n.ELEVEN : e - n.ONE,
|
|
4
|
+
prevYear: e === n.ZERO ? t - n.ONE : t
|
|
5
|
+
}), D = (t, e) => ({
|
|
6
|
+
nextMonth: e === n.ELEVEN ? n.ZERO : e + n.ONE,
|
|
7
|
+
nextYear: e === n.ELEVEN ? t + n.ONE : t
|
|
8
|
+
}), Y = (t, e) => e > n.ZERO ? [...t.slice(e), ...t.slice(n.ZERO, e)] : [...t];
|
|
9
|
+
function Z(t, e, N) {
|
|
10
|
+
const r = (g(t, e) - N + n.SEVEN) % n.SEVEN, c = i(t, e), { prevMonth: a, prevYear: O } = l(t, e), M = i(O, a), o = [];
|
|
11
|
+
for (let s = n.ZERO; s < n.TOTAL_CELLS; s++)
|
|
12
|
+
if (s < r) {
|
|
13
|
+
const E = M - r + s + n.ONE;
|
|
14
|
+
o.push({ date: new Date(O, a, E), isCurrentMonth: !1 });
|
|
15
|
+
} else if (s < r + c) {
|
|
16
|
+
const E = s - r + n.ONE;
|
|
17
|
+
o.push({ date: new Date(t, e, E), isCurrentMonth: !0 });
|
|
18
|
+
} else {
|
|
19
|
+
const E = s - r - c + n.ONE, { nextMonth: u, nextYear: d } = D(t, e);
|
|
20
|
+
o.push({ date: new Date(d, u, E), isCurrentMonth: !1 });
|
|
21
|
+
}
|
|
22
|
+
return o;
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
Z as buildCalendarGrid,
|
|
26
|
+
i as getDaysInMonth,
|
|
27
|
+
g as getFirstDayOfMonth,
|
|
28
|
+
D as getNextMonthYear,
|
|
29
|
+
l as getPrevMonthYear,
|
|
30
|
+
p as isSameDay,
|
|
31
|
+
R as isWeekendDay,
|
|
32
|
+
Y as reorderWeekdays
|
|
33
|
+
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { Calendar } from './Calendar';
|
|
2
2
|
export type { CalendarProps, CalendarSlots, CalendarDayProps, CalendarNavActions } from './Calendar.types';
|
|
3
|
+
export { NUMBER, DEFAULT_WEEKDAYS, MONTHS, WEEKEND, WEEKEND_LABELS } from './Calendar.const';
|
|
4
|
+
export { buildCalendarGrid, isSameDay, isWeekendDay, getDaysInMonth, getFirstDayOfMonth, reorderWeekdays } from './Calendar.utils';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),C=require("react"),c=require("../../utils/cn.cjs"),e=require("./Card.const.cjs"),_=C.forwardRef((t,n)=>{const{variant:r="elevated",padding:a="none",interactive:d=!1,radius:i="lg",className:o,children:l,testId:m,id:E,...N}=t;return s.jsx("div",{ref:n,id:E,className:c.cn("Bear-Card",`Bear-Card--${r}`,"bear-overflow-hidden",e.CARD_VARIANT_CLASSES[r],e.CARD_PADDING_CLASSES[a],e.CARD_RADIUS_CLASSES[i],d&&`Bear-Card--interactive ${e.CARD_INTERACTIVE_CLASSES}`,o),"data-testid":m,...N,children:l})});_.displayName="Card";const S=C.forwardRef((t,n)=>{const{title:r,subtitle:a,action:d,className:i,children:o,...l}=t;return s.jsxs("div",{ref:n,className:c.cn("Bear-Card__header",e.CARD_HEADER_CLASSES,i),...l,children:[s.jsxs("div",{className:"Bear-Card__header-content bear-flex-1 bear-min-w-0",children:[r&&s.jsx("h3",{className:c.cn("Bear-Card__title",e.CARD_TITLE_CLASSES),children:r}),a&&s.jsx("p",{className:c.cn("Bear-Card__subtitle",e.CARD_SUBTITLE_CLASSES),children:a}),o]}),d&&s.jsx("div",{className:"Bear-Card__header-action bear-ml-4 bear-shrink-0",children:d})]})});S.displayName="CardHeader";const A=C.forwardRef((t,n)=>{const{className:r,children:a,...d}=t;return s.jsx("div",{ref:n,className:c.cn("Bear-Card__body",e.CARD_BODY_CLASSES,r),...d,children:a})});A.displayName="CardBody";const R=C.forwardRef((t,n)=>{const{divider:r=!0,className:a,children:d,...i}=t;return s.jsx("div",{ref:n,className:c.cn("Bear-Card__footer",e.CARD_FOOTER_CLASSES,r&&e.CARD_FOOTER_DIVIDER_CLASSES,a),...i,children:d})});R.displayName="CardFooter";const u=Object.assign(_,{Header:S,Body:A,Footer:R});exports.Card=_;exports.CardBody=A;exports.CardCompound=u;exports.CardFooter=R;exports.CardHeader=S;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={none:"",xs:"bear-p-2",sm:"bear-p-3",md:"bear-p-4",lg:"bear-p-6",xl:"bear-p-8"},e={none:"",sm:"bear-rounded-sm",md:"bear-rounded-md",lg:"bear-rounded-lg",xl:"bear-rounded-xl","2xl":"bear-rounded-2xl"},a={elevated:"bear-bg-white dark:bear-bg-zinc-900 bear-shadow-md",outlined:"bear-bg-white dark:bear-bg-zinc-900 bear-border bear-border-gray-200 dark:bear-border-zinc-700",filled:"bear-bg-gray-100 dark:bear-bg-zinc-800",ghost:"bear-bg-transparent"},b="bear-transition-all bear-duration-200 bear-cursor-pointer hover:bear-shadow-lg hover:bear-scale-[1.02]",S="bear-flex bear-items-start bear-justify-between bear-p-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700",A="bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white bear-truncate",t="bear-text-sm bear-text-gray-500 dark:bear-text-gray-400 bear-mt-1",o="bear-p-4",C="bear-p-4",_="bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";exports.CARD_BODY_CLASSES=o;exports.CARD_FOOTER_CLASSES=C;exports.CARD_FOOTER_DIVIDER_CLASSES=_;exports.CARD_HEADER_CLASSES=S;exports.CARD_INTERACTIVE_CLASSES=b;exports.CARD_PADDING_CLASSES=r;exports.CARD_RADIUS_CLASSES=e;exports.CARD_SUBTITLE_CLASSES=t;exports.CARD_TITLE_CLASSES=A;exports.CARD_VARIANT_CLASSES=a;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EmberSize } from '../../types';
|
|
2
|
+
export type CardRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
|
+
export type CardVariant = 'elevated' | 'outlined' | 'filled' | 'ghost';
|
|
4
|
+
export declare const CARD_PADDING_CLASSES: Record<EmberSize | 'none', string>;
|
|
5
|
+
export declare const CARD_RADIUS_CLASSES: Record<CardRadius, string>;
|
|
6
|
+
export declare const CARD_VARIANT_CLASSES: Record<CardVariant, string>;
|
|
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]";
|
|
8
|
+
export declare const CARD_HEADER_CLASSES = "bear-flex bear-items-start bear-justify-between bear-p-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700";
|
|
9
|
+
export declare const CARD_TITLE_CLASSES = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white bear-truncate";
|
|
10
|
+
export declare const CARD_SUBTITLE_CLASSES = "bear-text-sm bear-text-gray-500 dark:bear-text-gray-400 bear-mt-1";
|
|
11
|
+
export declare const CARD_BODY_CLASSES = "bear-p-4";
|
|
12
|
+
export declare const CARD_FOOTER_CLASSES = "bear-p-4";
|
|
13
|
+
export declare const CARD_FOOTER_DIVIDER_CLASSES = "bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
none: "",
|
|
3
|
+
xs: "bear-p-2",
|
|
4
|
+
sm: "bear-p-3",
|
|
5
|
+
md: "bear-p-4",
|
|
6
|
+
lg: "bear-p-6",
|
|
7
|
+
xl: "bear-p-8"
|
|
8
|
+
}, e = {
|
|
9
|
+
none: "",
|
|
10
|
+
sm: "bear-rounded-sm",
|
|
11
|
+
md: "bear-rounded-md",
|
|
12
|
+
lg: "bear-rounded-lg",
|
|
13
|
+
xl: "bear-rounded-xl",
|
|
14
|
+
"2xl": "bear-rounded-2xl"
|
|
15
|
+
}, a = {
|
|
16
|
+
elevated: "bear-bg-white dark:bear-bg-zinc-900 bear-shadow-md",
|
|
17
|
+
outlined: "bear-bg-white dark:bear-bg-zinc-900 bear-border bear-border-gray-200 dark:bear-border-zinc-700",
|
|
18
|
+
filled: "bear-bg-gray-100 dark:bear-bg-zinc-800",
|
|
19
|
+
ghost: "bear-bg-transparent"
|
|
20
|
+
}, b = "bear-transition-all bear-duration-200 bear-cursor-pointer hover:bear-shadow-lg hover:bear-scale-[1.02]", t = "bear-flex bear-items-start bear-justify-between bear-p-4 bear-border-b bear-border-gray-200 dark:bear-border-zinc-700", o = "bear-text-lg bear-font-semibold bear-text-gray-900 dark:bear-text-white bear-truncate", d = "bear-text-sm bear-text-gray-500 dark:bear-text-gray-400 bear-mt-1", n = "bear-p-4", S = "bear-p-4", s = "bear-border-t bear-border-gray-200 dark:bear-border-zinc-700";
|
|
21
|
+
export {
|
|
22
|
+
n as CARD_BODY_CLASSES,
|
|
23
|
+
S as CARD_FOOTER_CLASSES,
|
|
24
|
+
s as CARD_FOOTER_DIVIDER_CLASSES,
|
|
25
|
+
t as CARD_HEADER_CLASSES,
|
|
26
|
+
b as CARD_INTERACTIVE_CLASSES,
|
|
27
|
+
r as CARD_PADDING_CLASSES,
|
|
28
|
+
e as CARD_RADIUS_CLASSES,
|
|
29
|
+
d as CARD_SUBTITLE_CLASSES,
|
|
30
|
+
o as CARD_TITLE_CLASSES,
|
|
31
|
+
a as CARD_VARIANT_CLASSES
|
|
32
|
+
};
|
|
@@ -29,3 +29,4 @@ export declare const CardCompound: import('react').ForwardRefExoticComponent<Car
|
|
|
29
29
|
Body: import('react').ForwardRefExoticComponent<CardBodyProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
30
30
|
Footer: import('react').ForwardRefExoticComponent<CardFooterProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
31
31
|
};
|
|
32
|
+
export default Card;
|