@forgedevstack/bear 1.1.3 → 1.1.8
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/README.md +19 -0
- package/dist/components/ActionIcon/ActionIcon.cjs +1 -0
- package/dist/components/ActionIcon/ActionIcon.const.cjs +1 -0
- package/dist/components/ActionIcon/ActionIcon.const.d.ts +7 -0
- package/dist/components/ActionIcon/ActionIcon.const.js +68 -0
- package/dist/components/ActionIcon/ActionIcon.d.ts +4 -0
- package/dist/components/ActionIcon/ActionIcon.js +42 -0
- package/dist/components/ActionIcon/ActionIcon.types.d.ts +11 -0
- package/dist/components/ActionIcon/index.d.ts +2 -0
- package/dist/components/Affix/Affix.cjs +1 -0
- package/dist/components/Affix/Affix.const.cjs +1 -0
- package/dist/components/Affix/Affix.const.d.ts +6 -0
- package/dist/components/Affix/Affix.const.js +9 -0
- package/dist/components/Affix/Affix.d.ts +4 -0
- package/dist/components/Affix/Affix.js +69 -0
- package/dist/components/Affix/Affix.types.d.ts +10 -0
- package/dist/components/Affix/index.d.ts +2 -0
- package/dist/components/Anchor/Anchor.cjs +1 -0
- package/dist/components/Anchor/Anchor.const.cjs +1 -0
- package/dist/components/Anchor/Anchor.const.d.ts +9 -0
- package/dist/components/Anchor/Anchor.const.js +11 -0
- package/dist/components/Anchor/Anchor.d.ts +4 -0
- package/dist/components/Anchor/Anchor.js +83 -0
- package/dist/components/Anchor/Anchor.types.d.ts +16 -0
- package/dist/components/Anchor/Anchor.utils.cjs +1 -0
- package/dist/components/Anchor/Anchor.utils.d.ts +2 -0
- package/dist/components/Anchor/Anchor.utils.js +12 -0
- package/dist/components/Anchor/index.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.cjs +1 -1
- package/dist/components/Autocomplete/Autocomplete.js +60 -67
- package/dist/components/Autocomplete/Autocomplete.utils.cjs +1 -0
- package/dist/components/Autocomplete/Autocomplete.utils.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.utils.js +12 -0
- package/dist/components/BackTop/BackTop.cjs +1 -1
- package/dist/components/BackTop/BackTop.js +10 -11
- package/dist/components/Blockquote/Blockquote.cjs +1 -0
- package/dist/components/Blockquote/Blockquote.const.cjs +1 -0
- package/dist/components/Blockquote/Blockquote.const.d.ts +5 -0
- package/dist/components/Blockquote/Blockquote.const.js +19 -0
- package/dist/components/Blockquote/Blockquote.d.ts +4 -0
- package/dist/components/Blockquote/Blockquote.js +56 -0
- package/dist/components/Blockquote/Blockquote.types.d.ts +9 -0
- package/dist/components/Blockquote/index.d.ts +2 -0
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.constants.cjs +2 -2
- package/dist/components/Button/Button.constants.d.ts +1 -0
- package/dist/components/Button/Button.constants.js +12 -5
- package/dist/components/Button/Button.d.ts +0 -27
- package/dist/components/Button/Button.js +93 -105
- package/dist/components/Button/Button.types.d.ts +1 -0
- package/dist/components/Button/Button.utils.cjs +1 -0
- package/dist/components/Button/Button.utils.d.ts +2 -0
- package/dist/components/Button/Button.utils.js +5 -0
- package/dist/components/Button/useSpotlight.cjs +1 -0
- package/dist/components/Button/useSpotlight.d.ts +21 -0
- package/dist/components/Button/useSpotlight.js +28 -0
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.const.cjs +1 -0
- package/dist/components/Chart/Chart.const.js +21 -0
- package/dist/components/Chart/Chart.js +55 -71
- package/dist/components/Chart/Chart.utils.cjs +1 -0
- package/dist/components/Chart/Chart.utils.js +5 -0
- package/dist/components/CheckboxCard/CheckboxCard.cjs +1 -0
- package/dist/components/CheckboxCard/CheckboxCard.const.cjs +1 -0
- package/dist/components/CheckboxCard/CheckboxCard.const.d.ts +7 -0
- package/dist/components/CheckboxCard/CheckboxCard.const.js +22 -0
- package/dist/components/CheckboxCard/CheckboxCard.d.ts +5 -0
- package/dist/components/CheckboxCard/CheckboxCard.js +132 -0
- package/dist/components/CheckboxCard/CheckboxCard.types.d.ts +21 -0
- package/dist/components/CheckboxCard/index.d.ts +2 -0
- package/dist/components/ColorPicker/ColorPicker.cjs +1 -1
- package/dist/components/ColorPicker/ColorPicker.const.cjs +1 -0
- package/dist/components/ColorPicker/ColorPicker.const.d.ts +26 -0
- package/dist/components/ColorPicker/ColorPicker.const.js +38 -0
- package/dist/components/ColorPicker/ColorPicker.js +61 -78
- package/dist/components/ColorSwatch/ColorSwatch.cjs +1 -0
- package/dist/components/ColorSwatch/ColorSwatch.const.cjs +1 -0
- package/dist/components/ColorSwatch/ColorSwatch.const.d.ts +16 -0
- package/dist/components/ColorSwatch/ColorSwatch.const.js +19 -0
- package/dist/components/ColorSwatch/ColorSwatch.d.ts +5 -0
- package/dist/components/ColorSwatch/ColorSwatch.js +92 -0
- package/dist/components/ColorSwatch/ColorSwatch.types.d.ts +23 -0
- package/dist/components/ColorSwatch/ColorSwatch.utils.cjs +1 -0
- package/dist/components/ColorSwatch/ColorSwatch.utils.d.ts +6 -0
- package/dist/components/ColorSwatch/ColorSwatch.utils.js +14 -0
- package/dist/components/ColorSwatch/index.d.ts +2 -0
- package/dist/components/Confetti/Confetti.cjs +1 -1
- package/dist/components/Confetti/Confetti.js +37 -34
- package/dist/components/ContextMenu/ContextMenu.cjs +1 -0
- package/dist/components/ContextMenu/ContextMenu.const.cjs +1 -0
- package/dist/components/ContextMenu/ContextMenu.const.d.ts +9 -0
- package/dist/components/ContextMenu/ContextMenu.const.js +12 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenu.js +65 -0
- package/dist/components/ContextMenu/ContextMenu.types.d.ts +23 -0
- package/dist/components/ContextMenu/ContextMenu.utils.cjs +1 -0
- package/dist/components/ContextMenu/ContextMenu.utils.d.ts +5 -0
- package/dist/components/ContextMenu/ContextMenu.utils.js +4 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/CountdownTimer/CountdownTimer.cjs +1 -1
- package/dist/components/CountdownTimer/CountdownTimer.js +62 -71
- package/dist/components/CountdownTimer/CountdownTimer.utils.cjs +1 -0
- package/dist/components/CountdownTimer/CountdownTimer.utils.d.ts +3 -0
- package/dist/components/CountdownTimer/CountdownTimer.utils.js +16 -0
- package/dist/components/DateRangePicker/DateRangePicker.cjs +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.const.cjs +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.const.d.ts +27 -0
- package/dist/components/DateRangePicker/DateRangePicker.const.js +74 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.js +115 -0
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +26 -0
- package/dist/components/DateRangePicker/DateRangePicker.utils.cjs +1 -0
- package/dist/components/DateRangePicker/DateRangePicker.utils.d.ts +4 -0
- package/dist/components/DateRangePicker/DateRangePicker.utils.js +22 -0
- package/dist/components/DateRangePicker/index.d.ts +2 -0
- package/dist/components/Descriptions/Descriptions.cjs +1 -0
- package/dist/components/Descriptions/Descriptions.const.cjs +1 -0
- package/dist/components/Descriptions/Descriptions.const.d.ts +24 -0
- package/dist/components/Descriptions/Descriptions.const.js +27 -0
- package/dist/components/Descriptions/Descriptions.d.ts +4 -0
- package/dist/components/Descriptions/Descriptions.js +65 -0
- package/dist/components/Descriptions/Descriptions.types.d.ts +16 -0
- package/dist/components/Descriptions/index.d.ts +2 -0
- package/dist/components/Dock/Dock.cjs +1 -1
- package/dist/components/Dock/Dock.js +38 -43
- package/dist/components/Dock/Dock.utils.cjs +1 -0
- package/dist/components/Dock/Dock.utils.d.ts +1 -0
- package/dist/components/Dock/Dock.utils.js +10 -0
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.js +59 -60
- package/dist/components/Fieldset/Fieldset.cjs +1 -0
- package/dist/components/Fieldset/Fieldset.const.cjs +1 -0
- package/dist/components/Fieldset/Fieldset.const.d.ts +5 -0
- package/dist/components/Fieldset/Fieldset.const.js +16 -0
- package/dist/components/Fieldset/Fieldset.d.ts +4 -0
- package/dist/components/Fieldset/Fieldset.js +47 -0
- package/dist/components/Fieldset/Fieldset.types.d.ts +10 -0
- package/dist/components/Fieldset/index.d.ts +2 -0
- package/dist/components/FileTree/FileTree.cjs +1 -1
- package/dist/components/FileTree/FileTree.js +20 -32
- package/dist/components/FileTree/FileTree.utils.cjs +1 -0
- package/dist/components/FileTree/FileTree.utils.d.ts +4 -0
- package/dist/components/FileTree/FileTree.utils.js +15 -0
- package/dist/components/GradientText/GradientText.cjs +1 -1
- package/dist/components/GradientText/GradientText.js +27 -29
- package/dist/components/Icon/icons/bear.cjs +1 -0
- package/dist/components/Icon/icons/bear.d.ts +12 -0
- package/dist/components/Icon/icons/bear.js +47 -0
- package/dist/components/Icon/index.cjs +1 -1
- package/dist/components/Icon/index.d.ts +18 -0
- package/dist/components/Icon/index.js +17 -15
- package/dist/components/ImageGallery/ImageGallery.cjs +1 -0
- package/dist/components/ImageGallery/ImageGallery.const.cjs +1 -0
- package/dist/components/ImageGallery/ImageGallery.const.d.ts +13 -0
- package/dist/components/ImageGallery/ImageGallery.const.js +16 -0
- package/dist/components/ImageGallery/ImageGallery.d.ts +4 -0
- package/dist/components/ImageGallery/ImageGallery.js +61 -0
- package/dist/components/ImageGallery/ImageGallery.types.d.ts +22 -0
- package/dist/components/ImageGallery/index.d.ts +2 -0
- package/dist/components/Indicator/Indicator.cjs +1 -0
- package/dist/components/Indicator/Indicator.const.cjs +1 -0
- package/dist/components/Indicator/Indicator.const.d.ts +15 -0
- package/dist/components/Indicator/Indicator.const.js +26 -0
- package/dist/components/Indicator/Indicator.d.ts +4 -0
- package/dist/components/Indicator/Indicator.js +56 -0
- package/dist/components/Indicator/Indicator.types.d.ts +16 -0
- package/dist/components/Indicator/index.d.ts +2 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.cjs +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.const.cjs +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.const.d.ts +7 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.const.js +9 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.d.ts +4 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.js +51 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.types.d.ts +13 -0
- package/dist/components/InfiniteScroll/index.d.ts +2 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.js +99 -66
- package/dist/components/Input/Input.types.d.ts +10 -0
- package/dist/components/Input/Input.utils.cjs +1 -0
- package/dist/components/Input/Input.utils.d.ts +2 -0
- package/dist/components/Input/Input.utils.js +15 -0
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/LoadingOverlay/LoadingOverlay.cjs +1 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.const.cjs +1 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.const.d.ts +6 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.const.js +9 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.d.ts +4 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.js +42 -0
- package/dist/components/LoadingOverlay/LoadingOverlay.types.d.ts +11 -0
- package/dist/components/LoadingOverlay/index.d.ts +2 -0
- package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
- package/dist/components/MentionsInput/MentionsInput.js +64 -68
- package/dist/components/MentionsInput/MentionsInput.utils.cjs +1 -0
- package/dist/components/MentionsInput/MentionsInput.utils.d.ts +2 -0
- package/dist/components/MentionsInput/MentionsInput.utils.js +9 -0
- package/dist/components/NumberFormatter/NumberFormatter.cjs +1 -0
- package/dist/components/NumberFormatter/NumberFormatter.const.cjs +1 -0
- package/dist/components/NumberFormatter/NumberFormatter.const.d.ts +5 -0
- package/dist/components/NumberFormatter/NumberFormatter.const.js +8 -0
- package/dist/components/NumberFormatter/NumberFormatter.d.ts +4 -0
- package/dist/components/NumberFormatter/NumberFormatter.js +53 -0
- package/dist/components/NumberFormatter/NumberFormatter.types.d.ts +20 -0
- package/dist/components/NumberFormatter/NumberFormatter.utils.cjs +1 -0
- package/dist/components/NumberFormatter/NumberFormatter.utils.d.ts +2 -0
- package/dist/components/NumberFormatter/NumberFormatter.utils.js +19 -0
- package/dist/components/NumberFormatter/index.d.ts +2 -0
- package/dist/components/PageNav/PageNav.cjs +1 -0
- package/dist/components/PageNav/PageNav.const.cjs +1 -0
- package/dist/components/PageNav/PageNav.const.d.ts +22 -0
- package/dist/components/PageNav/PageNav.const.js +42 -0
- package/dist/components/PageNav/PageNav.d.ts +3 -0
- package/dist/components/PageNav/PageNav.js +81 -0
- package/dist/components/PageNav/PageNav.types.d.ts +17 -0
- package/dist/components/PageNav/index.d.ts +2 -0
- package/dist/components/Popconfirm/Popconfirm.cjs +1 -0
- package/dist/components/Popconfirm/Popconfirm.const.cjs +1 -0
- package/dist/components/Popconfirm/Popconfirm.const.d.ts +13 -0
- package/dist/components/Popconfirm/Popconfirm.const.js +20 -0
- package/dist/components/Popconfirm/Popconfirm.d.ts +4 -0
- package/dist/components/Popconfirm/Popconfirm.js +65 -0
- package/dist/components/Popconfirm/Popconfirm.types.d.ts +16 -0
- package/dist/components/Popconfirm/index.d.ts +2 -0
- package/dist/components/Progress/Progress.cjs +1 -1
- package/dist/components/Progress/Progress.js +6 -6
- package/dist/components/PropsPlayground/PropsPlayground.cjs +1 -0
- package/dist/components/PropsPlayground/PropsPlayground.const.cjs +1 -0
- package/dist/components/PropsPlayground/PropsPlayground.const.d.ts +11 -0
- package/dist/components/PropsPlayground/PropsPlayground.const.js +23 -0
- package/dist/components/PropsPlayground/PropsPlayground.d.ts +3 -0
- package/dist/components/PropsPlayground/PropsPlayground.js +221 -0
- package/dist/components/PropsPlayground/PropsPlayground.types.d.ts +29 -0
- package/dist/components/PropsPlayground/PropsPlayground.utils.cjs +1 -0
- package/dist/components/PropsPlayground/PropsPlayground.utils.d.ts +2 -0
- package/dist/components/PropsPlayground/PropsPlayground.utils.js +9 -0
- package/dist/components/PropsPlayground/index.d.ts +2 -0
- package/dist/components/RadioCard/RadioCard.cjs +1 -0
- package/dist/components/RadioCard/RadioCard.const.cjs +1 -0
- package/dist/components/RadioCard/RadioCard.const.d.ts +7 -0
- package/dist/components/RadioCard/RadioCard.const.js +22 -0
- package/dist/components/RadioCard/RadioCard.d.ts +5 -0
- package/dist/components/RadioCard/RadioCard.js +111 -0
- package/dist/components/RadioCard/RadioCard.types.d.ts +22 -0
- package/dist/components/RadioCard/index.d.ts +2 -0
- package/dist/components/Result/Result.cjs +1 -0
- package/dist/components/Result/Result.const.cjs +1 -0
- package/dist/components/Result/Result.const.d.ts +10 -0
- package/dist/components/Result/Result.const.js +20 -0
- package/dist/components/Result/Result.d.ts +4 -0
- package/dist/components/Result/Result.icons.cjs +1 -0
- package/dist/components/Result/Result.icons.d.ts +3 -0
- package/dist/components/Result/Result.icons.js +31 -0
- package/dist/components/Result/Result.js +35 -0
- package/dist/components/Result/Result.types.d.ts +10 -0
- package/dist/components/Result/index.d.ts +2 -0
- package/dist/components/RingProgress/RingProgress.cjs +1 -0
- package/dist/components/RingProgress/RingProgress.const.cjs +1 -0
- package/dist/components/RingProgress/RingProgress.const.d.ts +4 -0
- package/dist/components/RingProgress/RingProgress.const.js +7 -0
- package/dist/components/RingProgress/RingProgress.d.ts +4 -0
- package/dist/components/RingProgress/RingProgress.js +67 -0
- package/dist/components/RingProgress/RingProgress.types.d.ts +15 -0
- package/dist/components/RingProgress/index.d.ts +2 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.js +28 -30
- package/dist/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/SignPad/SignPad.const.cjs +1 -1
- package/dist/components/SignPad/SignPad.const.js +10 -11
- package/dist/components/SignPad/SignPad.d.ts +4 -6
- package/dist/components/SignPad/SignPad.js +114 -122
- package/dist/components/SignPad/SignPad.types.d.ts +2 -2
- package/dist/components/Skeleton/Skeleton.cjs +1 -1
- package/dist/components/Skeleton/Skeleton.js +89 -94
- package/dist/components/Skeleton/Skeleton.utils.cjs +1 -0
- package/dist/components/Skeleton/Skeleton.utils.d.ts +1 -0
- package/dist/components/Skeleton/Skeleton.utils.js +10 -0
- package/dist/components/SliderRange/SliderRange.cjs +1 -1
- package/dist/components/SliderRange/SliderRange.js +61 -63
- package/dist/components/SliderRange/SliderRange.utils.cjs +1 -0
- package/dist/components/SliderRange/SliderRange.utils.d.ts +1 -0
- package/dist/components/SliderRange/SliderRange.utils.js +7 -0
- package/dist/components/SplitButton/SplitButton.cjs +1 -0
- package/dist/components/SplitButton/SplitButton.const.cjs +1 -0
- package/dist/components/SplitButton/SplitButton.const.d.ts +25 -0
- package/dist/components/SplitButton/SplitButton.const.js +27 -0
- package/dist/components/SplitButton/SplitButton.d.ts +4 -0
- package/dist/components/SplitButton/SplitButton.js +73 -0
- package/dist/components/SplitButton/SplitButton.types.d.ts +21 -0
- package/dist/components/SplitButton/index.d.ts +2 -0
- package/dist/components/Spoiler/Spoiler.cjs +1 -0
- package/dist/components/Spoiler/Spoiler.const.cjs +1 -0
- package/dist/components/Spoiler/Spoiler.const.d.ts +6 -0
- package/dist/components/Spoiler/Spoiler.const.js +9 -0
- package/dist/components/Spoiler/Spoiler.d.ts +4 -0
- package/dist/components/Spoiler/Spoiler.js +59 -0
- package/dist/components/Spoiler/Spoiler.types.d.ts +10 -0
- package/dist/components/Spoiler/index.d.ts +2 -0
- package/dist/components/Spotlight/Spotlight.cjs +1 -1
- package/dist/components/Spotlight/Spotlight.js +62 -73
- package/dist/components/Spotlight/Spotlight.utils.cjs +1 -0
- package/dist/components/Spotlight/Spotlight.utils.d.ts +3 -0
- package/dist/components/Spotlight/Spotlight.utils.js +18 -0
- package/dist/components/Tabs/Tabs.cjs +1 -1
- package/dist/components/Tabs/Tabs.js +39 -38
- package/dist/components/Tabs/Tabs.types.d.ts +3 -1
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.cjs +1 -1
- package/dist/components/TimePicker/components/TimePickerDialDropdown/TimePickerDialDropdown.js +63 -57
- package/dist/components/TimePicker/helpers/ClockFaceSvg.cjs +1 -1
- package/dist/components/TimePicker/helpers/ClockFaceSvg.d.ts +0 -7
- package/dist/components/TimePicker/helpers/ClockFaceSvg.js +32 -31
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.js +18 -17
- package/dist/components/Toast/Toast.utils.cjs +1 -0
- package/dist/components/Toast/Toast.utils.d.ts +1 -0
- package/dist/components/Toast/Toast.utils.js +4 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -1
- package/dist/components/Tooltip/Tooltip.js +10 -11
- package/dist/components/Tour/Tour.cjs +1 -1
- package/dist/components/Tour/Tour.js +1 -2
- package/dist/components/TreeSelect/TreeSelect.cjs +1 -0
- package/dist/components/TreeSelect/TreeSelect.const.cjs +1 -0
- package/dist/components/TreeSelect/TreeSelect.const.d.ts +19 -0
- package/dist/components/TreeSelect/TreeSelect.const.js +22 -0
- package/dist/components/TreeSelect/TreeSelect.d.ts +4 -0
- package/dist/components/TreeSelect/TreeSelect.js +128 -0
- package/dist/components/TreeSelect/TreeSelect.types.d.ts +25 -0
- package/dist/components/TreeSelect/TreeSelect.utils.cjs +1 -0
- package/dist/components/TreeSelect/TreeSelect.utils.d.ts +5 -0
- package/dist/components/TreeSelect/TreeSelect.utils.js +25 -0
- package/dist/components/TreeSelect/index.d.ts +2 -0
- package/dist/components/VirtualList/VirtualList.cjs +1 -1
- package/dist/components/VirtualList/VirtualList.js +38 -43
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +48 -0
- package/dist/components/index.js +351 -300
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +60 -58
- package/dist/hooks/useResizeObserver/index.d.ts +2 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.cjs +1 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.d.ts +3 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.js +20 -0
- package/dist/hooks/useResizeObserver/useResizeObserver.types.d.ts +8 -0
- package/dist/icons.cjs +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +443 -390
- package/dist/postcss/bear-plugin.cjs +86 -0
- package/dist/styles/_alerts.css +14 -0
- package/dist/styles/_base.css +60 -0
- package/dist/styles/_buttons.css +108 -0
- package/dist/styles/_effects.css +90 -0
- package/dist/styles/_marquee.css +25 -0
- package/dist/styles/main.css +5 -0
- package/dist/styles.css +1 -1
- package/package.json +15 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { DateRangePreset } from './DateRangePicker.types';
|
|
2
|
+
export declare const DAYS_IN_WEEK = 7;
|
|
3
|
+
export declare const MONTHS_IN_YEAR = 12;
|
|
4
|
+
export declare const CALENDAR_ROWS = 6;
|
|
5
|
+
export declare const DAY_LABELS: readonly ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
6
|
+
export declare const MONTH_LABELS: readonly ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
|
|
7
|
+
export declare const SIZE_CLASSES: {
|
|
8
|
+
readonly sm: "bear-py-1.5 bear-px-3 bear-text-sm";
|
|
9
|
+
readonly md: "bear-py-2 bear-px-4 bear-text-base";
|
|
10
|
+
readonly lg: "bear-py-2.5 bear-px-5 bear-text-lg";
|
|
11
|
+
};
|
|
12
|
+
export declare const ROOT_CLASSES = "Bear-DateRangePicker bear-relative bear-inline-block";
|
|
13
|
+
export declare const TRIGGER_CLASSES = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none";
|
|
14
|
+
export declare const DROPDOWN_CLASSES = "bear-absolute bear-z-[9999] bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-p-4";
|
|
15
|
+
export declare const CALENDAR_HEADER_CLASSES = "bear-flex bear-items-center bear-justify-between bear-mb-2";
|
|
16
|
+
export declare const NAV_BTN_CLASSES = "bear-p-1 bear-rounded hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-text-gray-500 dark:bear-text-zinc-400";
|
|
17
|
+
export declare const DAY_BASE_CLASSES = "bear-w-8 bear-h-8 bear-text-sm bear-rounded-full bear-transition-colors bear-cursor-pointer";
|
|
18
|
+
export declare const DAY_SELECTED_CLASSES = "bear-bg-pink-500 bear-text-white";
|
|
19
|
+
export declare const DAY_IN_RANGE_CLASSES = "bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-800 dark:bear-text-pink-200";
|
|
20
|
+
export declare const DAY_HOVER_CLASSES = "hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700";
|
|
21
|
+
export declare const DAY_DISABLED_CLASSES = "bear-text-gray-300 dark:bear-text-zinc-600 bear-cursor-not-allowed";
|
|
22
|
+
export declare const DAY_TODAY_CLASSES = "bear-ring-1 bear-ring-pink-400";
|
|
23
|
+
export declare const PRESET_BTN_CLASSES = "bear-w-full bear-text-left bear-px-3 bear-py-1.5 bear-text-sm bear-rounded bear-transition-colors hover:bear-bg-pink-50 dark:hover:bear-bg-pink-900/20 bear-text-gray-700 dark:bear-text-zinc-300";
|
|
24
|
+
export declare const LABEL_CLASSES = "Bear-DateRangePicker__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5";
|
|
25
|
+
export declare const ERROR_CLASSES = "bear-mt-1 bear-text-xs bear-text-red-500";
|
|
26
|
+
export declare const HELPER_CLASSES = "bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500";
|
|
27
|
+
export declare const getDefaultPresets: () => DateRangePreset[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
const t = 7, b = 6, n = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"], o = [
|
|
2
|
+
"January",
|
|
3
|
+
"February",
|
|
4
|
+
"March",
|
|
5
|
+
"April",
|
|
6
|
+
"May",
|
|
7
|
+
"June",
|
|
8
|
+
"July",
|
|
9
|
+
"August",
|
|
10
|
+
"September",
|
|
11
|
+
"October",
|
|
12
|
+
"November",
|
|
13
|
+
"December"
|
|
14
|
+
], s = {
|
|
15
|
+
sm: "bear-py-1.5 bear-px-3 bear-text-sm",
|
|
16
|
+
md: "bear-py-2 bear-px-4 bear-text-base",
|
|
17
|
+
lg: "bear-py-2.5 bear-px-5 bear-text-lg"
|
|
18
|
+
}, S = "Bear-DateRangePicker bear-relative bear-inline-block", c = "bear-w-full bear-flex bear-items-center bear-justify-between bear-rounded-lg bear-border bear-border-gray-300 dark:bear-border-zinc-600 bear-bg-white dark:bear-bg-zinc-800 bear-text-gray-900 dark:bear-text-white bear-transition-colors focus:bear-ring-2 focus:bear-ring-pink-500 bear-outline-none", i = "bear-absolute bear-z-[9999] bear-mt-1 bear-bg-white dark:bear-bg-zinc-800 bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-xl bear-shadow-xl bear-p-4", g = "bear-flex bear-items-center bear-justify-between bear-mb-2", l = "bear-p-1 bear-rounded hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700 bear-text-gray-500 dark:bear-text-zinc-400", d = "bear-w-8 bear-h-8 bear-text-sm bear-rounded-full bear-transition-colors bear-cursor-pointer", A = "bear-bg-pink-500 bear-text-white", E = "bear-bg-pink-100 dark:bear-bg-pink-900/30 bear-text-pink-800 dark:bear-text-pink-200", x = "hover:bear-bg-gray-100 dark:hover:bear-bg-zinc-700", D = "bear-text-gray-300 dark:bear-text-zinc-600 bear-cursor-not-allowed", u = "bear-ring-1 bear-ring-pink-400", _ = "bear-w-full bear-text-left bear-px-3 bear-py-1.5 bear-text-sm bear-rounded bear-transition-colors hover:bear-bg-pink-50 dark:hover:bear-bg-pink-900/20 bear-text-gray-700 dark:bear-text-zinc-300", L = "Bear-DateRangePicker__label bear-block bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-zinc-300 bear-mb-1.5", k = "bear-mt-1 bear-text-xs bear-text-red-500", y = "bear-mt-1 bear-text-xs bear-text-gray-500 dark:bear-text-zinc-500", p = () => {
|
|
19
|
+
const e = /* @__PURE__ */ new Date();
|
|
20
|
+
return e.setHours(0, 0, 0, 0), [
|
|
21
|
+
{
|
|
22
|
+
label: "Today",
|
|
23
|
+
range: () => ({ start: new Date(e), end: new Date(e) })
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: "Last 7 days",
|
|
27
|
+
range: () => {
|
|
28
|
+
const r = new Date(e);
|
|
29
|
+
return r.setDate(r.getDate() - 6), { start: r, end: new Date(e) };
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "Last 30 days",
|
|
34
|
+
range: () => {
|
|
35
|
+
const r = new Date(e);
|
|
36
|
+
return r.setDate(r.getDate() - 29), { start: r, end: new Date(e) };
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
label: "This month",
|
|
41
|
+
range: () => ({ start: new Date(e.getFullYear(), e.getMonth(), 1), end: new Date(e) })
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
label: "Last month",
|
|
45
|
+
range: () => {
|
|
46
|
+
const r = new Date(e.getFullYear(), e.getMonth() - 1, 1), a = new Date(e.getFullYear(), e.getMonth(), 0);
|
|
47
|
+
return { start: r, end: a };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
g as CALENDAR_HEADER_CLASSES,
|
|
54
|
+
b as CALENDAR_ROWS,
|
|
55
|
+
t as DAYS_IN_WEEK,
|
|
56
|
+
d as DAY_BASE_CLASSES,
|
|
57
|
+
D as DAY_DISABLED_CLASSES,
|
|
58
|
+
x as DAY_HOVER_CLASSES,
|
|
59
|
+
E as DAY_IN_RANGE_CLASSES,
|
|
60
|
+
n as DAY_LABELS,
|
|
61
|
+
A as DAY_SELECTED_CLASSES,
|
|
62
|
+
u as DAY_TODAY_CLASSES,
|
|
63
|
+
i as DROPDOWN_CLASSES,
|
|
64
|
+
k as ERROR_CLASSES,
|
|
65
|
+
y as HELPER_CLASSES,
|
|
66
|
+
L as LABEL_CLASSES,
|
|
67
|
+
o as MONTH_LABELS,
|
|
68
|
+
l as NAV_BTN_CLASSES,
|
|
69
|
+
_ as PRESET_BTN_CLASSES,
|
|
70
|
+
S as ROOT_CLASSES,
|
|
71
|
+
s as SIZE_CLASSES,
|
|
72
|
+
c as TRIGGER_CLASSES,
|
|
73
|
+
p as getDefaultPresets
|
|
74
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p, useRef as Q, useEffect as O, useCallback as g } from "react";
|
|
3
|
+
import { cn as E } from "../../utils/cn.js";
|
|
4
|
+
import { getDefaultPresets as U, LABEL_CLASSES as X, SIZE_CLASSES as ee, TRIGGER_CLASSES as te, DROPDOWN_CLASSES as re, PRESET_BTN_CLASSES as P, ERROR_CLASSES as ae, HELPER_CLASSES as se, ROOT_CLASSES as ne, CALENDAR_HEADER_CLASSES as le, NAV_BTN_CLASSES as I, MONTH_LABELS as oe, DAY_LABELS as ce, DAY_TODAY_CLASSES as ie, DAY_IN_RANGE_CLASSES as de, DAY_SELECTED_CLASSES as be, DAY_DISABLED_CLASSES as me, DAY_HOVER_CLASSES as Se, DAY_BASE_CLASSES as ue } from "./DateRangePicker.const.js";
|
|
5
|
+
import { formatDate as z, getCalendarDays as he, isSameDay as w, isInRange as pe } from "./DateRangePicker.utils.js";
|
|
6
|
+
const H = ({ year: L, month: o, range: r, onDayClick: A, onNav: N, minDate: i, maxDate: f }) => {
|
|
7
|
+
const k = he(L, o), m = /* @__PURE__ */ new Date();
|
|
8
|
+
return m.setHours(0, 0, 0, 0), /* @__PURE__ */ c("div", { className: "bear-w-64", children: [
|
|
9
|
+
/* @__PURE__ */ c("div", { className: le, children: [
|
|
10
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => N(-1), className: I, "aria-label": "Previous month", children: /* @__PURE__ */ e("svg", { className: "bear-w-4 bear-h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) }) }),
|
|
11
|
+
/* @__PURE__ */ c("span", { className: "bear-text-sm bear-font-semibold bear-text-gray-900 dark:bear-text-white", children: [
|
|
12
|
+
oe[o],
|
|
13
|
+
" ",
|
|
14
|
+
L
|
|
15
|
+
] }),
|
|
16
|
+
/* @__PURE__ */ e("button", { type: "button", onClick: () => N(1), className: I, "aria-label": "Next month", children: /* @__PURE__ */ e("svg", { className: "bear-w-4 bear-h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) })
|
|
17
|
+
] }),
|
|
18
|
+
/* @__PURE__ */ e("div", { className: "bear-grid bear-grid-cols-7 bear-gap-0.5 bear-mb-1", children: ce.map((a) => /* @__PURE__ */ e("div", { className: "bear-text-xs bear-text-center bear-font-medium bear-text-gray-400 dark:bear-text-zinc-500 bear-py-1", children: a }, a)) }),
|
|
19
|
+
/* @__PURE__ */ e("div", { className: "bear-grid bear-grid-cols-7 bear-gap-0.5", children: k.map((a, _) => {
|
|
20
|
+
if (!a) return /* @__PURE__ */ e("div", {}, `e-${_}`);
|
|
21
|
+
const S = i && a < i || f && a > f, l = w(a, r.start) || w(a, r.end), d = pe(a, r.start, r.end), D = w(a, m);
|
|
22
|
+
return /* @__PURE__ */ e(
|
|
23
|
+
"button",
|
|
24
|
+
{
|
|
25
|
+
type: "button",
|
|
26
|
+
disabled: !!S,
|
|
27
|
+
onClick: () => A(a),
|
|
28
|
+
className: E(
|
|
29
|
+
ue,
|
|
30
|
+
S ? me : Se,
|
|
31
|
+
l && be,
|
|
32
|
+
!l && d && de,
|
|
33
|
+
!l && !d && D && ie,
|
|
34
|
+
!l && !d && !S && "bear-text-gray-700 dark:bear-text-zinc-300"
|
|
35
|
+
),
|
|
36
|
+
children: a.getDate()
|
|
37
|
+
},
|
|
38
|
+
a.getTime()
|
|
39
|
+
);
|
|
40
|
+
}) })
|
|
41
|
+
] });
|
|
42
|
+
}, ke = (L) => {
|
|
43
|
+
const {
|
|
44
|
+
value: o,
|
|
45
|
+
onChange: r,
|
|
46
|
+
label: A,
|
|
47
|
+
placeholder: N = "Select date range",
|
|
48
|
+
disabled: i = !1,
|
|
49
|
+
clearable: f = !0,
|
|
50
|
+
minDate: k,
|
|
51
|
+
maxDate: m,
|
|
52
|
+
presets: a,
|
|
53
|
+
showPresets: _ = !0,
|
|
54
|
+
size: S = "md",
|
|
55
|
+
error: l,
|
|
56
|
+
helperText: d,
|
|
57
|
+
className: D,
|
|
58
|
+
testId: j,
|
|
59
|
+
...V
|
|
60
|
+
} = L, [y, v] = p(!1), [s, u] = p(o ?? { start: null, end: null }), [T, C] = p("start"), x = Q(null), Y = /* @__PURE__ */ new Date(), [b, W] = p(Y.getMonth()), [h, $] = p(Y.getFullYear()), G = b === 11 ? 0 : b + 1, F = b === 11 ? h + 1 : h;
|
|
61
|
+
O(() => {
|
|
62
|
+
o && u(o);
|
|
63
|
+
}, [o]), O(() => {
|
|
64
|
+
const t = (n) => {
|
|
65
|
+
x.current && !x.current.contains(n.target) && v(!1);
|
|
66
|
+
};
|
|
67
|
+
return document.addEventListener("mousedown", t), () => document.removeEventListener("mousedown", t);
|
|
68
|
+
}, []);
|
|
69
|
+
const B = g((t) => {
|
|
70
|
+
if (T === "start")
|
|
71
|
+
u({ start: t, end: null }), C("end");
|
|
72
|
+
else {
|
|
73
|
+
const n = t >= (s.start ?? t) ? { start: s.start, end: t } : { start: t, end: s.start };
|
|
74
|
+
u(n), C("start"), r == null || r(n);
|
|
75
|
+
}
|
|
76
|
+
}, [T, s.start, r]), Z = g((t) => {
|
|
77
|
+
u(t), r == null || r(t), v(!1), C("start");
|
|
78
|
+
}, [r]), q = g(() => {
|
|
79
|
+
const t = { start: null, end: null };
|
|
80
|
+
u(t), r == null || r(t), C("start");
|
|
81
|
+
}, [r]), J = g((t) => {
|
|
82
|
+
let n = b + t, R = h;
|
|
83
|
+
n < 0 && (n = 11, R--), n > 11 && (n = 0, R++), W(n), $(R);
|
|
84
|
+
}, [b, h]), M = a ?? (_ ? U() : []), K = s.start ? `${z(s.start)}${s.end ? ` – ${z(s.end)}` : ""}` : N;
|
|
85
|
+
return /* @__PURE__ */ c("div", { ref: x, className: E(ne, D), "data-testid": j, ...V, children: [
|
|
86
|
+
A && /* @__PURE__ */ e("label", { className: X, children: A }),
|
|
87
|
+
/* @__PURE__ */ c(
|
|
88
|
+
"button",
|
|
89
|
+
{
|
|
90
|
+
type: "button",
|
|
91
|
+
disabled: i,
|
|
92
|
+
onClick: () => !i && v(!y),
|
|
93
|
+
className: E(te, ee[S], i && "bear-opacity-50 bear-cursor-not-allowed"),
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ e("span", { className: E(!s.start && "bear-text-gray-400 dark:bear-text-zinc-500"), children: K }),
|
|
96
|
+
/* @__PURE__ */ e("svg", { className: "bear-w-4 bear-h-4 bear-ml-2 bear-text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
y && /* @__PURE__ */ e("div", { className: re, children: /* @__PURE__ */ c("div", { className: "bear-flex bear-gap-4", children: [
|
|
101
|
+
M.length > 0 && /* @__PURE__ */ c("div", { className: "bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-pr-3 bear-space-y-1 bear-min-w-[120px]", children: [
|
|
102
|
+
M.map((t) => /* @__PURE__ */ e("button", { type: "button", onClick: () => Z(t.range()), className: P, children: t.label }, t.label)),
|
|
103
|
+
f && s.start && /* @__PURE__ */ e("button", { type: "button", onClick: q, className: E(P, "bear-text-red-500"), children: "Clear" })
|
|
104
|
+
] }),
|
|
105
|
+
/* @__PURE__ */ e(H, { year: h, month: b, range: s, onDayClick: B, onNav: J, minDate: k, maxDate: m }),
|
|
106
|
+
/* @__PURE__ */ e(H, { year: F, month: G, range: s, onDayClick: B, onNav: () => {
|
|
107
|
+
}, minDate: k, maxDate: m })
|
|
108
|
+
] }) }),
|
|
109
|
+
l && /* @__PURE__ */ e("p", { className: ae, children: l }),
|
|
110
|
+
!l && d && /* @__PURE__ */ e("p", { className: se, children: d })
|
|
111
|
+
] });
|
|
112
|
+
};
|
|
113
|
+
export {
|
|
114
|
+
ke as DateRangePicker
|
|
115
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export interface DateRange {
|
|
3
|
+
start: Date | null;
|
|
4
|
+
end: Date | null;
|
|
5
|
+
}
|
|
6
|
+
export interface DateRangePreset {
|
|
7
|
+
label: string;
|
|
8
|
+
range: () => DateRange;
|
|
9
|
+
}
|
|
10
|
+
export interface DateRangePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
11
|
+
value?: DateRange;
|
|
12
|
+
onChange?: (range: DateRange) => void;
|
|
13
|
+
label?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
clearable?: boolean;
|
|
17
|
+
format?: string;
|
|
18
|
+
minDate?: Date;
|
|
19
|
+
maxDate?: Date;
|
|
20
|
+
presets?: DateRangePreset[];
|
|
21
|
+
showPresets?: boolean;
|
|
22
|
+
size?: 'sm' | 'md' | 'lg';
|
|
23
|
+
error?: string;
|
|
24
|
+
helperText?: string;
|
|
25
|
+
testId?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./DateRangePicker.const.cjs"),l=(t,e)=>!t||!e?!1:t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate(),i=(t,e,n)=>{if(!e||!n)return!1;const s=t.getTime();return s>e.getTime()&&s<n.getTime()},u=t=>{if(!t)return"";const e=(t.getMonth()+1).toString().padStart(2,"0"),n=t.getDate().toString().padStart(2,"0");return`${e}/${n}/${t.getFullYear()}`},D=(t,e)=>{const n=new Date(t,e,1).getDay(),s=new Date(t,e+1,0).getDate(),g=o.CALENDAR_ROWS*o.DAYS_IN_WEEK,r=[];for(let a=0;a<n;a++)r.push(null);for(let a=1;a<=s;a++)r.push(new Date(t,e,a));for(;r.length<g;)r.push(null);return r};exports.formatDate=u;exports.getCalendarDays=D;exports.isInRange=i;exports.isSameDay=l;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isSameDay: (a: Date | null, b: Date | null) => boolean;
|
|
2
|
+
export declare const isInRange: (day: Date, start: Date | null, end: Date | null) => boolean;
|
|
3
|
+
export declare const formatDate: (d: Date | null) => string;
|
|
4
|
+
export declare const getCalendarDays: (year: number, month: number) => (Date | null)[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CALENDAR_ROWS as l, DAYS_IN_WEEK as g } from "./DateRangePicker.const.js";
|
|
2
|
+
const i = (t, e) => !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth() && t.getDate() === e.getDate(), D = (t, e, n) => {
|
|
3
|
+
if (!e || !n) return !1;
|
|
4
|
+
const o = t.getTime();
|
|
5
|
+
return o > e.getTime() && o < n.getTime();
|
|
6
|
+
}, c = (t) => {
|
|
7
|
+
if (!t) return "";
|
|
8
|
+
const e = (t.getMonth() + 1).toString().padStart(2, "0"), n = t.getDate().toString().padStart(2, "0");
|
|
9
|
+
return `${e}/${n}/${t.getFullYear()}`;
|
|
10
|
+
}, f = (t, e) => {
|
|
11
|
+
const n = new Date(t, e, 1).getDay(), o = new Date(t, e + 1, 0).getDate(), s = l * g, a = [];
|
|
12
|
+
for (let r = 0; r < n; r++) a.push(null);
|
|
13
|
+
for (let r = 1; r <= o; r++) a.push(new Date(t, e, r));
|
|
14
|
+
for (; a.length < s; ) a.push(null);
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
c as formatDate,
|
|
19
|
+
f as getCalendarDays,
|
|
20
|
+
D as isInRange,
|
|
21
|
+
i as isSameDay
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),n=require("../../utils/cn.cjs");require("react");const S=require("../Typography/Typography.cjs"),e=require("./Descriptions.const.cjs"),N=b=>{const{title:p,items:d,columns:y=e.DEFAULT_COLUMNS,bordered:c=!1,size:D="md",layout:o="horizontal",labelWidth:L,className:A,testId:R,...g}=b,_=e.SIZE_CLASSES[D],v=c?e.BORDERED_LABEL_CELL_CLASSES:e.UNBORDERED_LABEL_CELL_CLASSES,B=c?e.BORDERED_VALUE_CELL_CLASSES:e.UNBORDERED_VALUE_CELL_CLASSES,h=(r,s)=>a.jsx("tr",{className:"Bear-Descriptions__row",children:r.flatMap((l,m)=>{const u=l.span??1,C=s*100+m;return[a.jsx("td",{colSpan:u,className:n.cn("Bear-Descriptions__label-cell",_.label,v,o==="vertical"&&"bear-align-top"),style:L?{width:L}:void 0,children:a.jsx(S.Typography,{variant:"body2",weight:"medium",color:"secondary",children:l.label})},`${C}-l`),a.jsx("td",{colSpan:u,className:n.cn("Bear-Descriptions__value-cell",_.cell,B,o==="vertical"&&"bear-align-top"),children:typeof l.value=="string"?a.jsx(S.Typography,{variant:"body2",className:"bear-text-gray-900 dark:bear-text-zinc-100",children:l.value}):l.value},`${C}-v`)]})},s),i=[];let t=[],E=0;d.forEach(r=>{const s=r.span??1;E+s>y&&t.length>0&&(i.push(t),t=[],E=0),t.push(r),E+=s}),t.length>0&&i.push(t);const x=c?e.BORDERED_TABLE_CLASSES:e.UNBORDERED_TABLE_CLASSES;return a.jsxs("div",{className:n.cn(e.ROOT_CLASS,A),"data-testid":R,...g,children:[p&&a.jsx(S.Typography,{variant:"h6",className:n.cn(e.TITLE_CLASSES,"bear-text-gray-900 dark:bear-text-zinc-100"),children:p}),a.jsx("table",{className:n.cn(e.TABLE_CLASSES,x),children:a.jsx("tbody",{children:o==="horizontal"?i.map((r,s)=>h(r,s)):d.map((r,s)=>h([r],s))})})]})};exports.Descriptions=N;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="Bear-Descriptions",e=3,a="bear-mb-4",b="bear-w-full",E="bear-border-collapse bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-overflow-hidden",S="bear-border-separate",L={sm:{cell:"bear-px-3 bear-py-2 bear-text-sm",label:"bear-px-3 bear-py-2 bear-text-sm"},md:{cell:"bear-px-4 bear-py-3 bear-text-sm",label:"bear-px-4 bear-py-3 bear-text-sm"},lg:{cell:"bear-px-5 bear-py-4 bear-text-base",label:"bear-px-5 bear-py-4 bear-text-base"}},t="bear-bg-gray-50 dark:bear-bg-zinc-800/50 bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700",_="bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-text-gray-900 dark:bear-text-zinc-100",A="bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium",o="bear-text-gray-900 dark:bear-text-zinc-100";exports.BORDERED_LABEL_CELL_CLASSES=t;exports.BORDERED_TABLE_CLASSES=E;exports.BORDERED_VALUE_CELL_CLASSES=_;exports.DEFAULT_COLUMNS=e;exports.ROOT_CLASS=r;exports.SIZE_CLASSES=L;exports.TABLE_CLASSES=b;exports.TITLE_CLASSES=a;exports.UNBORDERED_LABEL_CELL_CLASSES=A;exports.UNBORDERED_TABLE_CLASSES=S;exports.UNBORDERED_VALUE_CELL_CLASSES=o;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const ROOT_CLASS = "Bear-Descriptions";
|
|
2
|
+
export declare const DEFAULT_COLUMNS = 3;
|
|
3
|
+
export declare const TITLE_CLASSES = "bear-mb-4";
|
|
4
|
+
export declare const TABLE_CLASSES = "bear-w-full";
|
|
5
|
+
export declare const BORDERED_TABLE_CLASSES = "bear-border-collapse bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-overflow-hidden";
|
|
6
|
+
export declare const UNBORDERED_TABLE_CLASSES = "bear-border-separate";
|
|
7
|
+
export declare const SIZE_CLASSES: {
|
|
8
|
+
readonly sm: {
|
|
9
|
+
readonly cell: "bear-px-3 bear-py-2 bear-text-sm";
|
|
10
|
+
readonly label: "bear-px-3 bear-py-2 bear-text-sm";
|
|
11
|
+
};
|
|
12
|
+
readonly md: {
|
|
13
|
+
readonly cell: "bear-px-4 bear-py-3 bear-text-sm";
|
|
14
|
+
readonly label: "bear-px-4 bear-py-3 bear-text-sm";
|
|
15
|
+
};
|
|
16
|
+
readonly lg: {
|
|
17
|
+
readonly cell: "bear-px-5 bear-py-4 bear-text-base";
|
|
18
|
+
readonly label: "bear-px-5 bear-py-4 bear-text-base";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export declare const BORDERED_LABEL_CELL_CLASSES = "bear-bg-gray-50 dark:bear-bg-zinc-800/50 bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700";
|
|
22
|
+
export declare const BORDERED_VALUE_CELL_CLASSES = "bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-text-gray-900 dark:bear-text-zinc-100";
|
|
23
|
+
export declare const UNBORDERED_LABEL_CELL_CLASSES = "bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium";
|
|
24
|
+
export declare const UNBORDERED_VALUE_CELL_CLASSES = "bear-text-gray-900 dark:bear-text-zinc-100";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const r = "Bear-Descriptions", e = 3, a = "bear-mb-4", b = "bear-w-full", t = "bear-border-collapse bear-border bear-border-gray-200 dark:bear-border-zinc-700 bear-rounded-lg bear-overflow-hidden", E = "bear-border-separate", o = {
|
|
2
|
+
sm: {
|
|
3
|
+
cell: "bear-px-3 bear-py-2 bear-text-sm",
|
|
4
|
+
label: "bear-px-3 bear-py-2 bear-text-sm"
|
|
5
|
+
},
|
|
6
|
+
md: {
|
|
7
|
+
cell: "bear-px-4 bear-py-3 bear-text-sm",
|
|
8
|
+
label: "bear-px-4 bear-py-3 bear-text-sm"
|
|
9
|
+
},
|
|
10
|
+
lg: {
|
|
11
|
+
cell: "bear-px-5 bear-py-4 bear-text-base",
|
|
12
|
+
label: "bear-px-5 bear-py-4 bear-text-base"
|
|
13
|
+
}
|
|
14
|
+
}, S = "bear-bg-gray-50 dark:bear-bg-zinc-800/50 bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700", L = "bear-border-b bear-border-r bear-border-gray-200 dark:bear-border-zinc-700 bear-text-gray-900 dark:bear-text-zinc-100", d = "bear-text-gray-600 dark:bear-text-zinc-400 bear-font-medium", c = "bear-text-gray-900 dark:bear-text-zinc-100";
|
|
15
|
+
export {
|
|
16
|
+
S as BORDERED_LABEL_CELL_CLASSES,
|
|
17
|
+
t as BORDERED_TABLE_CLASSES,
|
|
18
|
+
L as BORDERED_VALUE_CELL_CLASSES,
|
|
19
|
+
e as DEFAULT_COLUMNS,
|
|
20
|
+
r as ROOT_CLASS,
|
|
21
|
+
o as SIZE_CLASSES,
|
|
22
|
+
b as TABLE_CLASSES,
|
|
23
|
+
a as TITLE_CLASSES,
|
|
24
|
+
d as UNBORDERED_LABEL_CELL_CLASSES,
|
|
25
|
+
E as UNBORDERED_TABLE_CLASSES,
|
|
26
|
+
c as UNBORDERED_VALUE_CELL_CLASSES
|
|
27
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { cn as r } from "../../utils/cn.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Typography as E } from "../Typography/Typography.js";
|
|
5
|
+
import { DEFAULT_COLUMNS as g, TITLE_CLASSES as O, BORDERED_TABLE_CLASSES as T, UNBORDERED_TABLE_CLASSES as U, TABLE_CLASSES as x, ROOT_CLASS as z, BORDERED_LABEL_CELL_CLASSES as w, UNBORDERED_LABEL_CELL_CLASSES as j, SIZE_CLASSES as k, BORDERED_VALUE_CELL_CLASSES as I, UNBORDERED_VALUE_CELL_CLASSES as M } from "./Descriptions.const.js";
|
|
6
|
+
const Z = (m) => {
|
|
7
|
+
const {
|
|
8
|
+
title: S,
|
|
9
|
+
items: L,
|
|
10
|
+
columns: b = g,
|
|
11
|
+
bordered: n = !1,
|
|
12
|
+
size: A = "md",
|
|
13
|
+
layout: o = "horizontal",
|
|
14
|
+
labelWidth: d,
|
|
15
|
+
className: D,
|
|
16
|
+
testId: u,
|
|
17
|
+
...R
|
|
18
|
+
} = m, p = k[A], B = n ? w : j, v = n ? I : M, _ = (a, e) => /* @__PURE__ */ s("tr", { className: "Bear-Descriptions__row", children: a.flatMap((t, N) => {
|
|
19
|
+
const h = t.span ?? 1, C = e * 100 + N;
|
|
20
|
+
return [
|
|
21
|
+
/* @__PURE__ */ s(
|
|
22
|
+
"td",
|
|
23
|
+
{
|
|
24
|
+
colSpan: h,
|
|
25
|
+
className: r(
|
|
26
|
+
"Bear-Descriptions__label-cell",
|
|
27
|
+
p.label,
|
|
28
|
+
B,
|
|
29
|
+
o === "vertical" && "bear-align-top"
|
|
30
|
+
),
|
|
31
|
+
style: d ? { width: d } : void 0,
|
|
32
|
+
children: /* @__PURE__ */ s(E, { variant: "body2", weight: "medium", color: "secondary", children: t.label })
|
|
33
|
+
},
|
|
34
|
+
`${C}-l`
|
|
35
|
+
),
|
|
36
|
+
/* @__PURE__ */ s(
|
|
37
|
+
"td",
|
|
38
|
+
{
|
|
39
|
+
colSpan: h,
|
|
40
|
+
className: r(
|
|
41
|
+
"Bear-Descriptions__value-cell",
|
|
42
|
+
p.cell,
|
|
43
|
+
v,
|
|
44
|
+
o === "vertical" && "bear-align-top"
|
|
45
|
+
),
|
|
46
|
+
children: typeof t.value == "string" ? /* @__PURE__ */ s(E, { variant: "body2", className: "bear-text-gray-900 dark:bear-text-zinc-100", children: t.value }) : t.value
|
|
47
|
+
},
|
|
48
|
+
`${C}-v`
|
|
49
|
+
)
|
|
50
|
+
];
|
|
51
|
+
}) }, e), c = [];
|
|
52
|
+
let l = [], i = 0;
|
|
53
|
+
L.forEach((a) => {
|
|
54
|
+
const e = a.span ?? 1;
|
|
55
|
+
i + e > b && l.length > 0 && (c.push(l), l = [], i = 0), l.push(a), i += e;
|
|
56
|
+
}), l.length > 0 && c.push(l);
|
|
57
|
+
const y = n ? T : U;
|
|
58
|
+
return /* @__PURE__ */ f("div", { className: r(z, D), "data-testid": u, ...R, children: [
|
|
59
|
+
S && /* @__PURE__ */ s(E, { variant: "h6", className: r(O, "bear-text-gray-900 dark:bear-text-zinc-100"), children: S }),
|
|
60
|
+
/* @__PURE__ */ s("table", { className: r(x, y), children: /* @__PURE__ */ s("tbody", { children: o === "horizontal" ? c.map((a, e) => _(a, e)) : L.map((a, e) => _([a], e)) }) })
|
|
61
|
+
] });
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
Z as Descriptions
|
|
65
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode, HTMLAttributes } from 'react';
|
|
2
|
+
export interface DescriptionItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: ReactNode;
|
|
5
|
+
span?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface DescriptionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
title?: string;
|
|
9
|
+
items: DescriptionItem[];
|
|
10
|
+
columns?: number;
|
|
11
|
+
bordered?: boolean;
|
|
12
|
+
size?: 'sm' | 'md' | 'lg';
|
|
13
|
+
layout?: 'horizontal' | 'vertical';
|
|
14
|
+
labelWidth?: number;
|
|
15
|
+
testId?: string;
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),n=require("react"),t=require("../../utils/cn.cjs"),a=require("./Dock.const.cjs"),N=require("./Dock.utils.cjs"),O=u=>{const{items:g,position:b="bottom",iconSize:i=a.DEFAULT_ICON_SIZE,magnifiedSize:x=a.DEFAULT_MAGNIFIED_SIZE,magnification:_=!0,magnificationDistance:f=a.DEFAULT_MAGNIFICATION_DISTANCE,showLabels:p=!0,className:h,style:D,testId:I}=u,[l,c]=n.useState(-1),[k,d]=n.useState(""),m=n.useRef(null),y=b==="left"||b==="right",S=n.useCallback((e,o)=>{c(e),d(o.label)},[]),v=n.useCallback(()=>{c(-1),d("")},[]);return r.jsx("div",{ref:m,className:t.cn("Bear-Dock","bear-flex bear-items-end bear-gap-1","bear-rounded-2xl bear-px-2 bear-py-1.5","bear-bg-white/80 dark:bear-bg-gray-900/80","bear-backdrop-blur-xl","bear-border bear-border-gray-200/50 dark:bear-border-gray-700/50","bear-shadow-lg",a.DOCK_POSITION_CLASSES[b],y&&"bear-items-center",h),style:{padding:a.DOCK_PADDING,zIndex:a.DOCK_Z_INDEX,...D},"data-testid":I,role:"toolbar","aria-label":"Dock",onMouseLeave:v,children:g.map((e,o)=>{const s=_?N.getScale(o,l,f,i,x):i;return r.jsxs("div",{className:"Bear-Dock__item bear-relative bear-flex bear-flex-col bear-items-center",children:[p&&l===o&&k&&r.jsx("div",{className:t.cn("Bear-Dock__tooltip","bear-absolute bear-whitespace-nowrap","bear-px-2 bear-py-1 bear-rounded-lg","bear-bg-gray-900 dark:bear-bg-gray-100","bear-text-white dark:bear-text-gray-900","bear-text-xs bear-font-medium","bear-shadow-md bear-pointer-events-none",a.TOOLTIP_POSITION_CLASSES[b]),role:"tooltip",children:e.label}),r.jsx("button",{className:t.cn("Bear-Dock__button","bear-flex bear-items-center bear-justify-center bear-rounded-xl","bear-transition-all bear-origin-bottom","hover:bear-cursor-pointer",e.active&&"bear-ring-2 bear-ring-offset-1",e.disabled&&"bear-opacity-40 bear-cursor-not-allowed"),style:{width:s,height:s,transitionDuration:`${a.SPRING_DURATION}ms`,transitionTimingFunction:"cubic-bezier(0.25, 0.1, 0.25, 1)"},onClick:e.disabled?void 0:e.onClick,onMouseEnter:()=>S(o,e),disabled:e.disabled,"aria-label":e.label,children:r.jsx("span",{className:t.cn("Bear-Dock__icon","bear-flex bear-items-center bear-justify-center","bear-w-full bear-h-full bear-rounded-xl","bear-transition-transform",e.active?"bear-bg-[var(--bear-primary-500)] bear-text-white":"bear-bg-gray-100 dark:bear-bg-gray-800"),style:{fontSize:s*a.ICON_SCALE_RATIO},children:e.icon})}),e.badge!==void 0&&r.jsx("span",{className:t.cn("Bear-Dock__badge","bear-absolute bear--top-1 bear--right-1","bear-min-w-[18px] bear-h-[18px]","bear-flex bear-items-center bear-justify-center","bear-rounded-full bear-text-[10px] bear-font-bold","bear-text-white bear-leading-none bear-px-1","bear-bg-[var(--bear-danger-500,#ef4444)]"),children:e.badge}),e.active&&b==="bottom"&&r.jsx("div",{className:t.cn("Bear-Dock__dot","bear-w-1 bear-h-1 bear-rounded-full bear-mt-0.5","bear-bg-[var(--bear-primary-500)]"),"aria-hidden":"true"})]},e.id)})})};exports.Dock=O;
|