@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
|
@@ -1,136 +1,124 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Spinner as
|
|
5
|
-
import { Typography as
|
|
6
|
-
import { useBearStyles as
|
|
1
|
+
import { jsxs as h, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Q, useContext as X, useMemo as ee, useCallback as re } from "react";
|
|
3
|
+
import { cn as n } from "../../utils/cn.js";
|
|
4
|
+
import { Spinner as te } from "../Spinner/Spinner.js";
|
|
5
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
6
|
+
import { useBearStyles as ae } from "../../hooks/useBearStyles.js";
|
|
7
7
|
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
8
|
-
import { BearContext as
|
|
9
|
-
import { VARIANT_DEFAULTS as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import { BearContext as oe } from "../../context/BearProvider.js";
|
|
9
|
+
import { VARIANT_DEFAULTS as w, BUTTON_ICON_SIZE as O, BUTTON_VARIANT as ne, BUTTON_ICON_ONLY_SIZE as ie, BUTTON_SIZE as se } from "./Button.constants.js";
|
|
10
|
+
import { isBuiltInVariant as V } from "./Button.utils.js";
|
|
11
|
+
import { useSpotlight as le } from "./useSpotlight.js";
|
|
12
|
+
const be = Q(
|
|
13
|
+
(E, i) => {
|
|
14
|
+
var T, $;
|
|
13
15
|
const {
|
|
14
16
|
variant: e = "primary",
|
|
15
|
-
size:
|
|
16
|
-
loading:
|
|
17
|
-
loadingText:
|
|
18
|
-
fullWidth:
|
|
19
|
-
icon:
|
|
20
|
-
iconPosition:
|
|
21
|
-
leftIcon:
|
|
22
|
-
rightIcon:
|
|
23
|
-
textVariant:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
if (l && (k(!0), c.current)) {
|
|
45
|
-
const b = c.current.getBoundingClientRect();
|
|
46
|
-
I({
|
|
47
|
-
x: t.clientX - b.left,
|
|
48
|
-
y: t.clientY - b.top
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
p == null || p(t);
|
|
52
|
-
}, [l, p]), re = B((t) => {
|
|
53
|
-
k(!1), I({ x: -1e3, y: -1e3 }), h == null || h(t);
|
|
54
|
-
}, [h]), o = P[e] || P.primary, ne = be(() => N && r ? {
|
|
17
|
+
size: s = "md",
|
|
18
|
+
loading: l = !1,
|
|
19
|
+
loadingText: d,
|
|
20
|
+
fullWidth: k = !1,
|
|
21
|
+
icon: b,
|
|
22
|
+
iconPosition: B = "left",
|
|
23
|
+
leftIcon: z,
|
|
24
|
+
rightIcon: A,
|
|
25
|
+
textVariant: v = "inherit",
|
|
26
|
+
iconOnly: _ = !1,
|
|
27
|
+
spotlight: y = !1,
|
|
28
|
+
spotlightColor: L = "rgba(255, 255, 255, 0.35)",
|
|
29
|
+
spotlightSize: c = 150,
|
|
30
|
+
disabled: R,
|
|
31
|
+
className: U,
|
|
32
|
+
children: j,
|
|
33
|
+
testId: P,
|
|
34
|
+
bis: Z,
|
|
35
|
+
style: D,
|
|
36
|
+
onMouseMove: F,
|
|
37
|
+
onMouseEnter: H,
|
|
38
|
+
onMouseLeave: W,
|
|
39
|
+
...Y
|
|
40
|
+
} = E, q = R || l, m = ae(Z, D), x = z ?? (b && B === "left" ? b : void 0), N = A ?? (b && B === "right" ? b : void 0), t = X(oe), f = (($ = (T = t == null ? void 0 : t.components) == null ? void 0 : T.Button) == null ? void 0 : $.root) || {}, I = (t == null ? void 0 : t.customVariants) || {}, p = !V(e) && e in I, r = p ? I[e] : null, { spotlightRef: M, position: C, isHovered: G, handlers: g } = le({
|
|
41
|
+
enabled: y,
|
|
42
|
+
onMouseMove: F,
|
|
43
|
+
onMouseEnter: H,
|
|
44
|
+
onMouseLeave: W
|
|
45
|
+
}), a = w[e] || w.primary, J = ee(() => p && r ? {
|
|
55
46
|
backgroundColor: `var(--bear-${e}-bg, ${r.bg})`,
|
|
56
47
|
color: r.text || "#ffffff",
|
|
57
48
|
borderColor: r.border,
|
|
58
49
|
"--bear-ring-color": r.ring || r.bg,
|
|
59
|
-
...
|
|
60
|
-
...
|
|
50
|
+
...f,
|
|
51
|
+
...m
|
|
61
52
|
} : {
|
|
62
|
-
backgroundColor: `var(--bear-btn-${e}-bg, ${
|
|
63
|
-
color: e === "outline" || e === "ghost" ? `var(--bear-btn-${e}-text, ${
|
|
64
|
-
borderColor: e === "outline" ? `var(--bear-btn-${e}-border, ${
|
|
65
|
-
"--bear-ring-color": `var(--bear-btn-${e}-ring, ${
|
|
66
|
-
...
|
|
67
|
-
...
|
|
68
|
-
}, [e,
|
|
69
|
-
|
|
70
|
-
}, [i]);
|
|
71
|
-
return /* @__PURE__ */
|
|
53
|
+
backgroundColor: `var(--bear-btn-${e}-bg, ${a.bg})`,
|
|
54
|
+
color: e === "outline" || e === "ghost" ? `var(--bear-btn-${e}-text, ${a.text || "inherit"})` : "white",
|
|
55
|
+
borderColor: e === "outline" ? `var(--bear-btn-${e}-border, ${a.border || a.bg})` : void 0,
|
|
56
|
+
"--bear-ring-color": `var(--bear-btn-${e}-ring, ${a.ring})`,
|
|
57
|
+
...f,
|
|
58
|
+
...m
|
|
59
|
+
}, [e, a, f, m, p, r]), K = re((u) => {
|
|
60
|
+
M.current = u, typeof i == "function" ? i(u) : i && (i.current = u);
|
|
61
|
+
}, [i, M]);
|
|
62
|
+
return /* @__PURE__ */ h(
|
|
72
63
|
"button",
|
|
73
64
|
{
|
|
74
|
-
ref:
|
|
75
|
-
disabled:
|
|
76
|
-
"aria-busy":
|
|
77
|
-
style:
|
|
78
|
-
className:
|
|
65
|
+
ref: K,
|
|
66
|
+
disabled: q,
|
|
67
|
+
"aria-busy": l || void 0,
|
|
68
|
+
style: J,
|
|
69
|
+
className: n(
|
|
79
70
|
"Bear-Button",
|
|
80
71
|
"bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-lg bear-transition-all bear-duration-200 bear-outline-none bear-relative bear-overflow-hidden",
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
72
|
+
_ ? ie[s] : se[s],
|
|
73
|
+
_ && "bear-rounded-lg",
|
|
74
|
+
V(e) ? ne[e] : "bear-btn-custom bear-text-white focus:bear-ring-2 focus:bear-ring-offset-2 disabled:bear-opacity-50 disabled:bear-cursor-not-allowed hover:bear-brightness-110 active:bear-brightness-95",
|
|
75
|
+
k && "bear-w-full",
|
|
76
|
+
l && "bear-cursor-wait",
|
|
77
|
+
U
|
|
87
78
|
),
|
|
88
|
-
"data-testid":
|
|
89
|
-
onMouseMove:
|
|
90
|
-
onMouseEnter:
|
|
91
|
-
onMouseLeave:
|
|
92
|
-
...
|
|
79
|
+
"data-testid": P,
|
|
80
|
+
onMouseMove: g.handleMouseMove,
|
|
81
|
+
onMouseEnter: g.handleMouseEnter,
|
|
82
|
+
onMouseLeave: g.handleMouseLeave,
|
|
83
|
+
...Y,
|
|
93
84
|
children: [
|
|
94
|
-
|
|
85
|
+
y && /* @__PURE__ */ o(
|
|
95
86
|
"span",
|
|
96
87
|
{
|
|
97
|
-
className:
|
|
88
|
+
className: n(
|
|
89
|
+
"Bear-Button__spotlight",
|
|
90
|
+
"bear-absolute bear-left-0 bear-top-0 bear-rounded-full bear-pointer-events-none bear-z-[1]",
|
|
91
|
+
"bear-transition-opacity bear-duration-150 bear-ease-out",
|
|
92
|
+
G ? "bear-opacity-100" : "bear-opacity-0"
|
|
93
|
+
),
|
|
98
94
|
"aria-hidden": "true",
|
|
99
95
|
style: {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
width: m,
|
|
105
|
-
height: m,
|
|
106
|
-
borderRadius: "50%",
|
|
107
|
-
background: `radial-gradient(circle at center, ${X} 0%, transparent 70%)`,
|
|
108
|
-
opacity: Q ? 1 : 0,
|
|
109
|
-
transform: `translate(${V.x - m / 2}px, ${V.y - m / 2}px)`,
|
|
110
|
-
transition: "opacity 0.15s ease-out",
|
|
111
|
-
zIndex: 1,
|
|
96
|
+
width: c,
|
|
97
|
+
height: c,
|
|
98
|
+
background: `radial-gradient(circle at center, ${L} 0%, transparent 70%)`,
|
|
99
|
+
transform: `translate(${C.x - c / 2}px, ${C.y - c / 2}px)`,
|
|
112
100
|
mixBlendMode: "overlay"
|
|
113
101
|
}
|
|
114
102
|
}
|
|
115
103
|
),
|
|
116
|
-
|
|
104
|
+
l && /* @__PURE__ */ h("span", { className: n(
|
|
117
105
|
"Bear-Button__loading bear-inline-flex bear-items-center bear-gap-2 bear-relative bear-z-10",
|
|
118
|
-
!
|
|
106
|
+
!d && "bear-absolute"
|
|
119
107
|
), children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
|
|
108
|
+
/* @__PURE__ */ o(te, { size: s === "xs" ? "xs" : "sm", className: "Bear-Button__spinner" }),
|
|
109
|
+
d && /* @__PURE__ */ o(S, { variant: v, className: "Bear-Button__text", children: d })
|
|
122
110
|
] }),
|
|
123
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ h(
|
|
124
112
|
"span",
|
|
125
113
|
{
|
|
126
|
-
className:
|
|
114
|
+
className: n(
|
|
127
115
|
"Bear-Button__content bear-inline-flex bear-items-center bear-gap-inherit bear-relative bear-z-10",
|
|
128
|
-
|
|
116
|
+
l && "bear-invisible"
|
|
129
117
|
),
|
|
130
118
|
children: [
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
119
|
+
x && /* @__PURE__ */ o("span", { className: n("Bear-Button__icon Bear-Button__icon--left bear-inline-flex bear-shrink-0", O[s]), children: x }),
|
|
120
|
+
/* @__PURE__ */ o(S, { variant: v, className: "Bear-Button__text", children: j }),
|
|
121
|
+
N && /* @__PURE__ */ o("span", { className: n("Bear-Button__icon Bear-Button__icon--right bear-inline-flex bear-shrink-0", O[s]), children: N })
|
|
134
122
|
]
|
|
135
123
|
}
|
|
136
124
|
)
|
|
@@ -139,7 +127,7 @@ const U = (y) => y in j, ge = se(
|
|
|
139
127
|
);
|
|
140
128
|
}
|
|
141
129
|
);
|
|
142
|
-
|
|
130
|
+
be.displayName = "Button";
|
|
143
131
|
export {
|
|
144
|
-
|
|
132
|
+
be as Button
|
|
145
133
|
};
|
|
@@ -45,6 +45,7 @@ export interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement
|
|
|
45
45
|
spotlightColor?: string;
|
|
46
46
|
/** Spotlight size in pixels (default: 120) */
|
|
47
47
|
spotlightSize?: number;
|
|
48
|
+
iconOnly?: boolean;
|
|
48
49
|
/** Test ID for testing */
|
|
49
50
|
testId?: string;
|
|
50
51
|
/** Bear Inner Style - sx-like overrides */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./Button.constants.cjs"),i=t=>t in n.BUTTON_VARIANT;exports.isBuiltInVariant=i;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),f=-1e3;function y({enabled:r,onMouseMove:s,onMouseEnter:e,onMouseLeave:n}){const l=c.useRef(null),[g,a]=c.useState({x:f,y:f}),[d,u]=c.useState(!1),h=c.useCallback(t=>{if(r&&l.current){const i=l.current.getBoundingClientRect();a({x:t.clientX-i.left,y:t.clientY-i.top})}s==null||s(t)},[r,s]),p=c.useCallback(t=>{if(r&&(u(!0),l.current)){const i=l.current.getBoundingClientRect();a({x:t.clientX-i.left,y:t.clientY-i.top})}e==null||e(t)},[r,e]),S=c.useCallback(t=>{u(!1),a({x:f,y:f}),n==null||n(t)},[n]);return{spotlightRef:l,position:g,isHovered:d,handlers:{handleMouseMove:h,handleMouseEnter:p,handleMouseLeave:S}}}exports.useSpotlight=y;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface SpotlightPosition {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
interface UseSpotlightOptions {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
onMouseMove?: React.MouseEventHandler<HTMLButtonElement>;
|
|
8
|
+
onMouseEnter?: React.MouseEventHandler<HTMLButtonElement>;
|
|
9
|
+
onMouseLeave?: React.MouseEventHandler<HTMLButtonElement>;
|
|
10
|
+
}
|
|
11
|
+
export declare function useSpotlight({ enabled, onMouseMove, onMouseEnter, onMouseLeave }: UseSpotlightOptions): {
|
|
12
|
+
spotlightRef: import('react').MutableRefObject<HTMLButtonElement | null>;
|
|
13
|
+
position: SpotlightPosition;
|
|
14
|
+
isHovered: boolean;
|
|
15
|
+
handlers: {
|
|
16
|
+
handleMouseMove: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
17
|
+
handleMouseEnter: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
|
+
handleMouseLeave: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useRef as S, useState as d, useCallback as g } from "react";
|
|
2
|
+
const s = -1e3;
|
|
3
|
+
function m({ enabled: l, onMouseMove: r, onMouseEnter: f, onMouseLeave: n }) {
|
|
4
|
+
const c = S(null), [x, p] = d({ x: s, y: s }), [R, h] = d(!1), y = g((t) => {
|
|
5
|
+
if (l && c.current) {
|
|
6
|
+
const i = c.current.getBoundingClientRect();
|
|
7
|
+
p({ x: t.clientX - i.left, y: t.clientY - i.top });
|
|
8
|
+
}
|
|
9
|
+
r == null || r(t);
|
|
10
|
+
}, [l, r]), C = g((t) => {
|
|
11
|
+
if (l && (h(!0), c.current)) {
|
|
12
|
+
const i = c.current.getBoundingClientRect();
|
|
13
|
+
p({ x: t.clientX - i.left, y: t.clientY - i.top });
|
|
14
|
+
}
|
|
15
|
+
f == null || f(t);
|
|
16
|
+
}, [l, f]), e = g((t) => {
|
|
17
|
+
h(!1), p({ x: s, y: s }), n == null || n(t);
|
|
18
|
+
}, [n]);
|
|
19
|
+
return {
|
|
20
|
+
spotlightRef: c,
|
|
21
|
+
position: x,
|
|
22
|
+
isHovered: R,
|
|
23
|
+
handlers: { handleMouseMove: y, handleMouseEnter: C, handleMouseLeave: e }
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
m as useSpotlight
|
|
28
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("react"),d=require("../../utils/cn.cjs"),w=require("./Chart.utils.cjs"),M=({data:r,height:o=200,showLabels:y=!0,showValues:f=!1,animated:h=!0,color:m,orientation:p="vertical",barRadius:i=4,barGap:$=.2,className:j,...v})=>{const n=Math.max(...r.map(l=>l.value));return e.jsx("div",{className:d.cn("w-full",j),style:{height:o},...v,children:p==="vertical"?e.jsx("div",{className:"flex items-end justify-between h-full gap-2",children:r.map((l,a)=>{const t=l.value/n*100,s=w.getChartColor(a,l.color||m);return e.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1",children:[e.jsx("div",{className:"w-full flex-1 flex items-end",children:e.jsx("div",{className:d.cn("w-full transition-all duration-500 ease-out",h&&"animate-grow-up"),style:{height:`${t}%`,backgroundColor:s,borderRadius:`${i}px ${i}px 0 0`,opacity:.9}})}),f&&e.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400",children:l.value}),y&&e.jsx("span",{className:"text-xs text-gray-600 dark:text-slate-300 truncate max-w-full",children:l.label})]},a)})}):e.jsx("div",{className:"flex flex-col justify-between h-full gap-2",children:r.map((l,a)=>{const t=l.value/n*100,s=w.getChartColor(a,l.color||m);return e.jsxs("div",{className:"flex-1 flex items-center gap-2",children:[y&&e.jsx("span",{className:"text-xs text-gray-600 dark:text-slate-300 w-16 truncate",children:l.label}),e.jsx("div",{className:"flex-1 h-full flex items-center",children:e.jsx("div",{className:d.cn("h-3/4 transition-all duration-500 ease-out",h&&"animate-grow-right"),style:{width:`${t}%`,backgroundColor:s,borderRadius:`0 ${i}px ${i}px 0`,opacity:.9}})}),f&&e.jsx("span",{className:"text-xs text-gray-500 dark:text-slate-400 w-10 text-right",children:l.value})]},a)})})})},R=({data:r,height:o=200,showLabels:y=!0,showDots:f=!0,smooth:h=!0,fill:m=!1,strokeWidth:p=2,color:i="#ec4899",animated:$=!0,className:j,...v})=>{const n=C.useMemo(()=>{const t=Math.max(...r.map(c=>c.value)),s=Math.min(...r.map(c=>c.value)),x=t-s||1;return r.map((c,u)=>({x:u/(r.length-1||1)*100,y:100-(c.value-s)/x*80-10,...c}))},[r]),l=C.useMemo(()=>n.length===0?"":h?n.reduce((t,s,x,c)=>{if(x===0)return`M ${s.x},${s.y}`;const u=c[x-1],g=u.x+(s.x-u.x)/3,N=s.x-(s.x-u.x)/3;return`${t} C ${g},${u.y} ${N},${s.y} ${s.x},${s.y}`},""):n.reduce((t,s,x)=>`${t} ${x===0?"M":"L"} ${s.x},${s.y}`,""),[n,h]),a=C.useMemo(()=>n.length===0?"":`${l} L 100,100 L 0,100 Z`,[l,n]);return e.jsxs("div",{className:d.cn("w-full",j),style:{height:o},...v,children:[e.jsxs("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",className:"w-full h-full",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:"line-gradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[e.jsx("stop",{offset:"0%",stopColor:i,stopOpacity:"0.3"}),e.jsx("stop",{offset:"100%",stopColor:i,stopOpacity:"0"})]})}),m&&e.jsx("path",{d:a,fill:"url(#line-gradient)",className:d.cn($&&"animate-fade-in")}),e.jsx("path",{d:l,fill:"none",stroke:i,strokeWidth:p/10,strokeLinecap:"round",strokeLinejoin:"round",className:d.cn($&&"animate-draw-line")}),f&&n.map((t,s)=>e.jsx("circle",{cx:t.x,cy:t.y,r:1.5,fill:i,className:d.cn($&&"animate-scale-in"),style:{animationDelay:`${s*50}ms`}},s))]}),y&&e.jsx("div",{className:"flex justify-between mt-2",children:r.map((t,s)=>e.jsx("span",{className:"text-xs text-gray-600 dark:text-slate-300",children:t.label},s))})]})},k=({data:r,height:o=200,showLabels:y=!0,innerRadius:f=0,startAngle:h=-90,padAngle:m=2,animated:p=!0,className:i,...$})=>{const j=r.reduce((a,t)=>a+t.value,0),v=C.useMemo(()=>{let a=h;return r.map((t,s)=>{const x=t.value/j*360-m,c={startAngle:a,endAngle:a+x,color:w.getChartColor(s,t.color),...t};return a+=x+m,c})},[r,j,h,m]),n=(a,t)=>{const s=a*Math.PI/180;return{x:50+t*Math.cos(s),y:50+t*Math.sin(s)}},l=(a,t)=>{const x=f*45,c=n(a,45),u=n(t,45),g=n(a,x),N=n(t,x),b=t-a>180?1:0;return f>0?`M ${c.x},${c.y} A 45,45 0 ${b},1 ${u.x},${u.y} L ${N.x},${N.y} A ${x},${x} 0 ${b},0 ${g.x},${g.y} Z`:`M 50,50 L ${c.x},${c.y} A 45,45 0 ${b},1 ${u.x},${u.y} Z`};return e.jsxs("div",{className:d.cn("flex items-center gap-4",i),...$,children:[e.jsx("div",{style:{width:o,height:o},children:e.jsx("svg",{viewBox:"0 0 100 100",className:"w-full h-full",children:v.map((a,t)=>e.jsx("path",{d:l(a.startAngle,a.endAngle),fill:a.color,className:d.cn("transition-opacity hover:opacity-80",p&&"animate-scale-in"),style:{animationDelay:`${t*100}ms`}},t))})}),y&&e.jsx("div",{className:"flex flex-col gap-2",children:r.map((a,t)=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:w.getChartColor(t,a.color)}}),e.jsx("span",{className:"text-sm text-gray-600 dark:text-slate-300",children:a.label}),e.jsxs("span",{className:"text-sm text-gray-400 dark:text-slate-500",children:[Math.round(a.value/j*100),"%"]})]},t))})]})},L=({type:r,...o})=>{switch(r){case"bar":return e.jsx(M,{...o});case"line":case"area":return e.jsx(R,{...o,fill:r==="area"});case"pie":return e.jsx(k,{...o});case"donut":return e.jsx(k,{...o,innerRadius:.6});default:return e.jsx(M,{...o})}};exports.BarChart=M;exports.Chart=L;exports.LineChart=R;exports.PieChart=k;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["#ec4899","#8b5cf6","#3b82f6","#10b981","#f59e0b","#ef4444","#06b6d4","#84cc16"];exports.DEFAULT_COLORS=e;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const b = [
|
|
2
|
+
"#ec4899",
|
|
3
|
+
// pink
|
|
4
|
+
"#8b5cf6",
|
|
5
|
+
// purple
|
|
6
|
+
"#3b82f6",
|
|
7
|
+
// blue
|
|
8
|
+
"#10b981",
|
|
9
|
+
// emerald
|
|
10
|
+
"#f59e0b",
|
|
11
|
+
// amber
|
|
12
|
+
"#ef4444",
|
|
13
|
+
// red
|
|
14
|
+
"#06b6d4",
|
|
15
|
+
// cyan
|
|
16
|
+
"#84cc16"
|
|
17
|
+
// lime
|
|
18
|
+
];
|
|
19
|
+
export {
|
|
20
|
+
b as DEFAULT_COLORS
|
|
21
|
+
};
|
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useMemo as
|
|
1
|
+
import { jsx as t, jsxs as f } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as b } from "react";
|
|
3
3
|
import { cn as d } from "../../utils/cn.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
// pink
|
|
7
|
-
"#8b5cf6",
|
|
8
|
-
// purple
|
|
9
|
-
"#3b82f6",
|
|
10
|
-
// blue
|
|
11
|
-
"#10b981",
|
|
12
|
-
// emerald
|
|
13
|
-
"#f59e0b",
|
|
14
|
-
// amber
|
|
15
|
-
"#ef4444",
|
|
16
|
-
// red
|
|
17
|
-
"#06b6d4",
|
|
18
|
-
// cyan
|
|
19
|
-
"#84cc16"
|
|
20
|
-
// lime
|
|
21
|
-
], k = (l, o) => o || L[l % L.length], R = ({
|
|
4
|
+
import { getChartColor as k } from "./Chart.utils.js";
|
|
5
|
+
const R = ({
|
|
22
6
|
data: l,
|
|
23
|
-
height:
|
|
7
|
+
height: i = 200,
|
|
24
8
|
showLabels: p = !0,
|
|
25
9
|
showValues: $ = !1,
|
|
26
|
-
animated:
|
|
27
|
-
color:
|
|
10
|
+
animated: m = !0,
|
|
11
|
+
color: h,
|
|
28
12
|
orientation: g = "vertical",
|
|
29
13
|
barRadius: u = 4,
|
|
30
14
|
barGap: v = 0.2,
|
|
@@ -32,15 +16,15 @@ const L = [
|
|
|
32
16
|
...N
|
|
33
17
|
}) => {
|
|
34
18
|
const n = Math.max(...l.map((s) => s.value));
|
|
35
|
-
return /* @__PURE__ */ t("div", { className: d("w-full", y), style: { height:
|
|
36
|
-
const e = s.value / n * 100, a = k(r, s.color ||
|
|
37
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ t("div", { className: d("w-full", y), style: { height: i }, ...N, children: g === "vertical" ? /* @__PURE__ */ t("div", { className: "flex items-end justify-between h-full gap-2", children: l.map((s, r) => {
|
|
20
|
+
const e = s.value / n * 100, a = k(r, s.color || h);
|
|
21
|
+
return /* @__PURE__ */ f("div", { className: "flex-1 flex flex-col items-center gap-1", children: [
|
|
38
22
|
/* @__PURE__ */ t("div", { className: "w-full flex-1 flex items-end", children: /* @__PURE__ */ t(
|
|
39
23
|
"div",
|
|
40
24
|
{
|
|
41
25
|
className: d(
|
|
42
26
|
"w-full transition-all duration-500 ease-out",
|
|
43
|
-
|
|
27
|
+
m && "animate-grow-up"
|
|
44
28
|
),
|
|
45
29
|
style: {
|
|
46
30
|
height: `${e}%`,
|
|
@@ -54,15 +38,15 @@ const L = [
|
|
|
54
38
|
p && /* @__PURE__ */ t("span", { className: "text-xs text-gray-600 dark:text-slate-300 truncate max-w-full", children: s.label })
|
|
55
39
|
] }, r);
|
|
56
40
|
}) }) : /* @__PURE__ */ t("div", { className: "flex flex-col justify-between h-full gap-2", children: l.map((s, r) => {
|
|
57
|
-
const e = s.value / n * 100, a = k(r, s.color ||
|
|
58
|
-
return /* @__PURE__ */
|
|
41
|
+
const e = s.value / n * 100, a = k(r, s.color || h);
|
|
42
|
+
return /* @__PURE__ */ f("div", { className: "flex-1 flex items-center gap-2", children: [
|
|
59
43
|
p && /* @__PURE__ */ t("span", { className: "text-xs text-gray-600 dark:text-slate-300 w-16 truncate", children: s.label }),
|
|
60
44
|
/* @__PURE__ */ t("div", { className: "flex-1 h-full flex items-center", children: /* @__PURE__ */ t(
|
|
61
45
|
"div",
|
|
62
46
|
{
|
|
63
47
|
className: d(
|
|
64
48
|
"h-3/4 transition-all duration-500 ease-out",
|
|
65
|
-
|
|
49
|
+
m && "animate-grow-right"
|
|
66
50
|
),
|
|
67
51
|
style: {
|
|
68
52
|
width: `${e}%`,
|
|
@@ -75,38 +59,38 @@ const L = [
|
|
|
75
59
|
$ && /* @__PURE__ */ t("span", { className: "text-xs text-gray-500 dark:text-slate-400 w-10 text-right", children: s.value })
|
|
76
60
|
] }, r);
|
|
77
61
|
}) }) });
|
|
78
|
-
},
|
|
62
|
+
}, j = ({
|
|
79
63
|
data: l,
|
|
80
|
-
height:
|
|
64
|
+
height: i = 200,
|
|
81
65
|
showLabels: p = !0,
|
|
82
66
|
showDots: $ = !0,
|
|
83
|
-
smooth:
|
|
84
|
-
fill:
|
|
67
|
+
smooth: m = !0,
|
|
68
|
+
fill: h = !1,
|
|
85
69
|
strokeWidth: g = 2,
|
|
86
70
|
color: u = "#ec4899",
|
|
87
71
|
animated: v = !0,
|
|
88
72
|
className: y,
|
|
89
73
|
...N
|
|
90
74
|
}) => {
|
|
91
|
-
const n =
|
|
92
|
-
const e = Math.max(...l.map((c) => c.value)), a = Math.min(...l.map((c) => c.value)),
|
|
75
|
+
const n = b(() => {
|
|
76
|
+
const e = Math.max(...l.map((c) => c.value)), a = Math.min(...l.map((c) => c.value)), o = e - a || 1;
|
|
93
77
|
return l.map((c, x) => ({
|
|
94
78
|
x: x / (l.length - 1 || 1) * 100,
|
|
95
|
-
y: 100 - (c.value - a) /
|
|
79
|
+
y: 100 - (c.value - a) / o * 80 - 10,
|
|
96
80
|
...c
|
|
97
81
|
}));
|
|
98
|
-
}, [l]), s =
|
|
99
|
-
if (
|
|
100
|
-
const x = c[
|
|
101
|
-
return `${e} C ${
|
|
102
|
-
}, "") : n.reduce((e, a,
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */
|
|
82
|
+
}, [l]), s = b(() => n.length === 0 ? "" : m ? n.reduce((e, a, o, c) => {
|
|
83
|
+
if (o === 0) return `M ${a.x},${a.y}`;
|
|
84
|
+
const x = c[o - 1], w = x.x + (a.x - x.x) / 3, C = a.x - (a.x - x.x) / 3;
|
|
85
|
+
return `${e} C ${w},${x.y} ${C},${a.y} ${a.x},${a.y}`;
|
|
86
|
+
}, "") : n.reduce((e, a, o) => `${e} ${o === 0 ? "M" : "L"} ${a.x},${a.y}`, ""), [n, m]), r = b(() => n.length === 0 ? "" : `${s} L 100,100 L 0,100 Z`, [s, n]);
|
|
87
|
+
return /* @__PURE__ */ f("div", { className: d("w-full", y), style: { height: i }, ...N, children: [
|
|
88
|
+
/* @__PURE__ */ f("svg", { viewBox: "0 0 100 100", preserveAspectRatio: "none", className: "w-full h-full", children: [
|
|
89
|
+
/* @__PURE__ */ t("defs", { children: /* @__PURE__ */ f("linearGradient", { id: "line-gradient", x1: "0%", y1: "0%", x2: "0%", y2: "100%", children: [
|
|
106
90
|
/* @__PURE__ */ t("stop", { offset: "0%", stopColor: u, stopOpacity: "0.3" }),
|
|
107
91
|
/* @__PURE__ */ t("stop", { offset: "100%", stopColor: u, stopOpacity: "0" })
|
|
108
92
|
] }) }),
|
|
109
|
-
|
|
93
|
+
h && /* @__PURE__ */ t(
|
|
110
94
|
"path",
|
|
111
95
|
{
|
|
112
96
|
d: r,
|
|
@@ -141,40 +125,40 @@ const L = [
|
|
|
141
125
|
] }),
|
|
142
126
|
p && /* @__PURE__ */ t("div", { className: "flex justify-between mt-2", children: l.map((e, a) => /* @__PURE__ */ t("span", { className: "text-xs text-gray-600 dark:text-slate-300", children: e.label }, a)) })
|
|
143
127
|
] });
|
|
144
|
-
},
|
|
128
|
+
}, L = ({
|
|
145
129
|
data: l,
|
|
146
|
-
height:
|
|
130
|
+
height: i = 200,
|
|
147
131
|
showLabels: p = !0,
|
|
148
132
|
innerRadius: $ = 0,
|
|
149
|
-
startAngle:
|
|
150
|
-
padAngle:
|
|
133
|
+
startAngle: m = -90,
|
|
134
|
+
padAngle: h = 2,
|
|
151
135
|
animated: g = !0,
|
|
152
136
|
className: u,
|
|
153
137
|
...v
|
|
154
138
|
}) => {
|
|
155
|
-
const y = l.reduce((r, e) => r + e.value, 0), N =
|
|
156
|
-
let r =
|
|
139
|
+
const y = l.reduce((r, e) => r + e.value, 0), N = b(() => {
|
|
140
|
+
let r = m;
|
|
157
141
|
return l.map((e, a) => {
|
|
158
|
-
const
|
|
142
|
+
const o = e.value / y * 360 - h, c = {
|
|
159
143
|
startAngle: r,
|
|
160
|
-
endAngle: r +
|
|
144
|
+
endAngle: r + o,
|
|
161
145
|
color: k(a, e.color),
|
|
162
146
|
...e
|
|
163
147
|
};
|
|
164
|
-
return r +=
|
|
148
|
+
return r += o + h, c;
|
|
165
149
|
});
|
|
166
|
-
}, [l, y,
|
|
150
|
+
}, [l, y, m, h]), n = (r, e) => {
|
|
167
151
|
const a = r * Math.PI / 180;
|
|
168
152
|
return {
|
|
169
153
|
x: 50 + e * Math.cos(a),
|
|
170
154
|
y: 50 + e * Math.sin(a)
|
|
171
155
|
};
|
|
172
156
|
}, s = (r, e) => {
|
|
173
|
-
const
|
|
174
|
-
return $ > 0 ? `M ${c.x},${c.y} A 45,45 0 ${M},1 ${x.x},${x.y} L ${
|
|
157
|
+
const o = $ * 45, c = n(r, 45), x = n(e, 45), w = n(r, o), C = n(e, o), M = e - r > 180 ? 1 : 0;
|
|
158
|
+
return $ > 0 ? `M ${c.x},${c.y} A 45,45 0 ${M},1 ${x.x},${x.y} L ${C.x},${C.y} A ${o},${o} 0 ${M},0 ${w.x},${w.y} Z` : `M 50,50 L ${c.x},${c.y} A 45,45 0 ${M},1 ${x.x},${x.y} Z`;
|
|
175
159
|
};
|
|
176
|
-
return /* @__PURE__ */
|
|
177
|
-
/* @__PURE__ */ t("div", { style: { width:
|
|
160
|
+
return /* @__PURE__ */ f("div", { className: d("flex items-center gap-4", u), ...v, children: [
|
|
161
|
+
/* @__PURE__ */ t("div", { style: { width: i, height: i }, children: /* @__PURE__ */ t("svg", { viewBox: "0 0 100 100", className: "w-full h-full", children: N.map((r, e) => /* @__PURE__ */ t(
|
|
178
162
|
"path",
|
|
179
163
|
{
|
|
180
164
|
d: s(r.startAngle, r.endAngle),
|
|
@@ -187,7 +171,7 @@ const L = [
|
|
|
187
171
|
},
|
|
188
172
|
e
|
|
189
173
|
)) }) }),
|
|
190
|
-
p && /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: l.map((r, e) => /* @__PURE__ */
|
|
174
|
+
p && /* @__PURE__ */ t("div", { className: "flex flex-col gap-2", children: l.map((r, e) => /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
191
175
|
/* @__PURE__ */ t(
|
|
192
176
|
"div",
|
|
193
177
|
{
|
|
@@ -196,30 +180,30 @@ const L = [
|
|
|
196
180
|
}
|
|
197
181
|
),
|
|
198
182
|
/* @__PURE__ */ t("span", { className: "text-sm text-gray-600 dark:text-slate-300", children: r.label }),
|
|
199
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ f("span", { className: "text-sm text-gray-400 dark:text-slate-500", children: [
|
|
200
184
|
Math.round(r.value / y * 100),
|
|
201
185
|
"%"
|
|
202
186
|
] })
|
|
203
187
|
] }, e)) })
|
|
204
188
|
] });
|
|
205
|
-
},
|
|
189
|
+
}, P = ({ type: l, ...i }) => {
|
|
206
190
|
switch (l) {
|
|
207
191
|
case "bar":
|
|
208
|
-
return /* @__PURE__ */ t(R, { ...
|
|
192
|
+
return /* @__PURE__ */ t(R, { ...i });
|
|
209
193
|
case "line":
|
|
210
194
|
case "area":
|
|
211
|
-
return /* @__PURE__ */ t(
|
|
195
|
+
return /* @__PURE__ */ t(j, { ...i, fill: l === "area" });
|
|
212
196
|
case "pie":
|
|
213
|
-
return /* @__PURE__ */ t(
|
|
197
|
+
return /* @__PURE__ */ t(L, { ...i });
|
|
214
198
|
case "donut":
|
|
215
|
-
return /* @__PURE__ */ t(
|
|
199
|
+
return /* @__PURE__ */ t(L, { ...i, innerRadius: 0.6 });
|
|
216
200
|
default:
|
|
217
|
-
return /* @__PURE__ */ t(R, { ...
|
|
201
|
+
return /* @__PURE__ */ t(R, { ...i });
|
|
218
202
|
}
|
|
219
203
|
};
|
|
220
204
|
export {
|
|
221
205
|
R as BarChart,
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
206
|
+
P as Chart,
|
|
207
|
+
j as LineChart,
|
|
208
|
+
L as PieChart
|
|
225
209
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./Chart.const.cjs"),o=(e,r)=>r||t.DEFAULT_COLORS[e%t.DEFAULT_COLORS.length];exports.getChartColor=o;
|