@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,65 @@
|
|
|
1
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as y, useCallback as F, useEffect as C } from "react";
|
|
3
|
+
import { cn as l } from "../../utils/cn.js";
|
|
4
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
5
|
+
import { DEFAULT_CONFIRM_TEXT as P, DEFAULT_CANCEL_TEXT as x, ICON_AREA_CLASSES as I, ICON_WRAPPER_CLASSES as g, CONTENT_CLASSES as w, BUTTONS_WRAPPER_CLASSES as B, CANCEL_BTN_CLASSES as U, CONFIRM_BTN_DANGER_CLASSES as D, CONFIRM_BTN_DEFAULT_CLASSES as M, PLACEMENT_OFFSETS as j, POPUP_CLASSES as W, ROOT_CLASS as z } from "./Popconfirm.const.js";
|
|
6
|
+
const X = /* @__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: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z" }) }), Q = (N) => {
|
|
7
|
+
const {
|
|
8
|
+
title: u,
|
|
9
|
+
description: d,
|
|
10
|
+
onConfirm: o,
|
|
11
|
+
onCancel: s,
|
|
12
|
+
confirmText: h = P,
|
|
13
|
+
cancelText: L = x,
|
|
14
|
+
icon: f = X,
|
|
15
|
+
placement: p = "bottom",
|
|
16
|
+
disabled: m = !1,
|
|
17
|
+
children: _,
|
|
18
|
+
variant: T = "default",
|
|
19
|
+
testId: v
|
|
20
|
+
} = N, [n, E] = R(!1), c = y(null), t = F(() => E(!1), []);
|
|
21
|
+
C(() => {
|
|
22
|
+
const r = (i) => {
|
|
23
|
+
c.current && !c.current.contains(i.target) && t();
|
|
24
|
+
};
|
|
25
|
+
return n && document.addEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
|
|
26
|
+
}, [n, t]), C(() => {
|
|
27
|
+
const r = (i) => {
|
|
28
|
+
i.key === "Escape" && t();
|
|
29
|
+
};
|
|
30
|
+
return n && document.addEventListener("keydown", r), () => document.removeEventListener("keydown", r);
|
|
31
|
+
}, [n, t]);
|
|
32
|
+
const A = () => {
|
|
33
|
+
m || E(!n);
|
|
34
|
+
}, b = () => {
|
|
35
|
+
o == null || o(), t();
|
|
36
|
+
}, k = () => {
|
|
37
|
+
s == null || s(), t();
|
|
38
|
+
}, O = T === "danger" ? D : M;
|
|
39
|
+
return /* @__PURE__ */ a("div", { ref: c, className: l(z, "bear-relative bear-inline-block"), "data-testid": v, children: [
|
|
40
|
+
/* @__PURE__ */ e(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
onClick: A,
|
|
44
|
+
className: l("bear-cursor-pointer", m && "bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none"),
|
|
45
|
+
children: _
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
n && /* @__PURE__ */ a("div", { className: l(W, j[p]), children: [
|
|
49
|
+
/* @__PURE__ */ a("div", { className: I, children: [
|
|
50
|
+
/* @__PURE__ */ e("div", { className: g, children: f }),
|
|
51
|
+
/* @__PURE__ */ a("div", { className: w, children: [
|
|
52
|
+
/* @__PURE__ */ e(S, { variant: "body2", className: "bear-text-gray-900 dark:bear-text-zinc-100", children: u }),
|
|
53
|
+
d && /* @__PURE__ */ e(S, { variant: "caption", color: "secondary", className: "bear-mt-0.5", children: d })
|
|
54
|
+
] })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ a("div", { className: B, children: [
|
|
57
|
+
/* @__PURE__ */ e("button", { type: "button", className: U, onClick: k, children: L }),
|
|
58
|
+
/* @__PURE__ */ e("button", { type: "button", className: O, onClick: b, children: h })
|
|
59
|
+
] })
|
|
60
|
+
] })
|
|
61
|
+
] });
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
Q as Popconfirm
|
|
65
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type PopconfirmPlacement = 'top' | 'bottom' | 'left' | 'right';
|
|
3
|
+
export interface PopconfirmProps {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
onConfirm?: () => void;
|
|
7
|
+
onCancel?: () => void;
|
|
8
|
+
confirmText?: string;
|
|
9
|
+
cancelText?: string;
|
|
10
|
+
icon?: ReactNode;
|
|
11
|
+
placement?: PopconfirmPlacement;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
variant?: 'default' | 'danger';
|
|
15
|
+
testId?: string;
|
|
16
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../utils/cn.cjs");require("react");const m={sm:"bear-h-1.5",md:"bear-h-2.5",lg:"bear-h-4"},f={default:"bear-bg-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("../../utils/cn.cjs");require("react");const m={sm:"bear-h-1.5",md:"bear-h-2.5",lg:"bear-h-4"},f={default:"bear-bg-bear-500",success:"bear-bg-green-500",warning:"bear-bg-amber-500",danger:"bear-bg-red-500",info:"bear-bg-blue-500"},x=({value:b,max:n=100,size:l="md",color:o="default",showLabel:i=!1,labelPosition:d="outside",striped:r=!1,animated:c=!1,indeterminate:a=!1,className:g,testId:u})=>{const s=Math.min(100,Math.max(0,b/n*100));return e.jsxs("div",{className:t.cn("bear-w-full",g),"data-testid":u,children:[i&&d==="outside"&&e.jsxs("div",{className:"bear-flex bear-justify-between bear-mb-1",children:[e.jsx("span",{className:"bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200",children:"Progress"}),e.jsxs("span",{className:"bear-text-sm bear-font-medium bear-text-gray-700 dark:bear-text-gray-200",children:[Math.round(s),"%"]})]}),e.jsx("div",{className:t.cn("bear-w-full bear-bg-gray-200 dark:bear-bg-gray-700 bear-rounded-full bear-overflow-hidden",m[l]),children:e.jsx("div",{className:t.cn("bear-h-full bear-rounded-full bear-transition-all bear-duration-300 bear-ease-out","bear-flex bear-items-center bear-justify-center",f[o],r&&"bear-bg-stripes",c&&"bear-animate-stripes",a&&"bear-animate-indeterminate"),style:{width:a?"50%":`${s}%`,backgroundSize:r?"1rem 1rem":void 0,backgroundImage:r?"linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent)":void 0},role:"progressbar","aria-valuenow":a?void 0:b,"aria-valuemin":0,"aria-valuemax":n,children:i&&d==="inside"&&l==="lg"&&!a&&e.jsxs("span",{className:"bear-text-xs bear-font-medium bear-text-white",children:[Math.round(s),"%"]})})})]})};exports.Progress=x;
|
|
@@ -6,20 +6,20 @@ const f = {
|
|
|
6
6
|
md: "bear-h-2.5",
|
|
7
7
|
lg: "bear-h-4"
|
|
8
8
|
}, h = {
|
|
9
|
-
default: "bear-bg-
|
|
9
|
+
default: "bear-bg-bear-500",
|
|
10
10
|
success: "bear-bg-green-500",
|
|
11
|
-
warning: "bear-bg-
|
|
11
|
+
warning: "bear-bg-amber-500",
|
|
12
12
|
danger: "bear-bg-red-500",
|
|
13
13
|
info: "bear-bg-blue-500"
|
|
14
14
|
}, y = ({
|
|
15
15
|
value: n,
|
|
16
16
|
max: l = 100,
|
|
17
17
|
size: d = "md",
|
|
18
|
-
color:
|
|
18
|
+
color: m = "default",
|
|
19
19
|
showLabel: i = !1,
|
|
20
20
|
labelPosition: o = "outside",
|
|
21
21
|
striped: r = !1,
|
|
22
|
-
animated:
|
|
22
|
+
animated: g = !1,
|
|
23
23
|
indeterminate: e = !1,
|
|
24
24
|
className: c,
|
|
25
25
|
testId: u
|
|
@@ -46,9 +46,9 @@ const f = {
|
|
|
46
46
|
className: b(
|
|
47
47
|
"bear-h-full bear-rounded-full bear-transition-all bear-duration-300 bear-ease-out",
|
|
48
48
|
"bear-flex bear-items-center bear-justify-center",
|
|
49
|
-
h[
|
|
49
|
+
h[m],
|
|
50
50
|
r && "bear-bg-stripes",
|
|
51
|
-
|
|
51
|
+
g && "bear-animate-stripes",
|
|
52
52
|
e && "bear-animate-indeterminate"
|
|
53
53
|
),
|
|
54
54
|
style: {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("react"),n=require("../../utils/cn.cjs"),j=require("../Icon/Icon.cjs"),l=require("./PropsPlayground.const.cjs"),_=require("./PropsPlayground.utils.cjs"),$=({size:b})=>e.jsx(j.Icon,{size:b,children:e.jsx("polyline",{points:"6 9 12 15 18 9"})}),q=({size:b})=>e.jsx(j.Icon,{size:b,children:e.jsx("polyline",{points:"9 18 15 12 9 6"})}),I=({size:b})=>e.jsxs(j.Icon,{size:b,children:[e.jsx("line",{x1:"4",y1:"21",x2:"4",y2:"14"}),e.jsx("line",{x1:"4",y1:"10",x2:"4",y2:"3"}),e.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"3"}),e.jsx("line",{x1:"20",y1:"21",x2:"20",y2:"16"}),e.jsx("line",{x1:"20",y1:"12",x2:"20",y2:"3"}),e.jsx("line",{x1:"1",y1:"14",x2:"7",y2:"14"}),e.jsx("line",{x1:"9",y1:"8",x2:"15",y2:"8"}),e.jsx("line",{x1:"17",y1:"16",x2:"23",y2:"16"})]}),O=({config:b,render:z,title:y="Props",size:S="md",defaultCollapsed:C=!1,showReset:w=!0,columns:P=3,className:L,testId:k})=>{const u=c.useMemo(()=>_.getDefaults(b),[b]),[g,f]=c.useState(u),[p,E]=c.useState(C),o=c.useCallback((r,s)=>{f(i=>({...i,[r]:s}))},[]),A=c.useCallback(()=>{f(u)},[u]),t=l.SIZE_CLASSES[S],N=Object.keys(b).length,m=n.cn("bear-w-full bear-rounded-md bear-border bear-border-zinc-700","bear-bg-zinc-800 bear-text-zinc-100","placeholder:bear-text-zinc-500","focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-pink-500/30 focus:bear-border-pink-500","bear-transition-colors",t.input);return e.jsxs("div",{"data-testid":k,className:n.cn(l.ROOT_CLASS,"bear-rounded-lg bear-border bear-border-zinc-700 bear-overflow-hidden",L),children:[e.jsxs("button",{type:"button",onClick:()=>E(r=>!r),className:n.cn("bear-w-full bear-flex bear-items-center bear-gap-2 bear-text-left bear-font-medium bear-transition-colors","bear-bg-zinc-800/60 hover:bear-bg-zinc-800","bear-text-zinc-200 bear-border-b bear-border-zinc-700","bear-px-4 bear-py-3",t.text),children:[e.jsx("span",{className:"bear-text-pink-500",children:p?e.jsx(q,{size:12}):e.jsx($,{size:12})}),e.jsx("span",{className:"bear-text-pink-500",children:e.jsx(I,{size:14})}),e.jsx("span",{className:"bear-font-semibold",children:y}),e.jsxs("span",{className:"bear-ml-auto bear-flex bear-items-center bear-gap-2",children:[e.jsxs("span",{className:"bear-text-[10px] bear-font-medium bear-text-zinc-500",children:[N," ",N===1?"control":"controls"]}),w&&!p&&e.jsx("button",{type:"button",onClick:r=>{r.stopPropagation(),A()},className:"bear-text-[10px] bear-font-semibold bear-text-pink-500 hover:bear-text-pink-400 hover:bear-underline",children:"Reset"})]})]}),!p&&e.jsx("div",{className:n.cn("bear-bg-zinc-900/50",t.padding),children:e.jsx("div",{className:n.cn("bear-grid",t.gap,l.COLUMN_CLASSES[P]),children:Object.entries(b).map(([r,s])=>{const i=g[r],d=r.replace(/([A-Z])/g," $1").replace(/^./,a=>a.toUpperCase()).trim();if(s.type==="boolean"){const a=i===!0;return e.jsxs("div",{className:"bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",children:[e.jsx("span",{className:n.cn("bear-block bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500 bear-mb-2",t.label),children:l.TYPE_LABELS.boolean}),e.jsxs("label",{className:"bear-flex bear-items-center bear-gap-2.5 bear-cursor-pointer",children:[e.jsx("button",{type:"button",role:"switch","aria-checked":a,onClick:()=>o(r,!a),className:n.cn("bear-relative bear-inline-flex bear-h-5 bear-w-9 bear-flex-shrink-0 bear-rounded-full bear-border-2 bear-border-transparent bear-transition-colors",a?"bear-bg-pink-500":"bear-bg-zinc-600"),children:e.jsx("span",{className:n.cn("bear-pointer-events-none bear-inline-block bear-h-4 bear-w-4 bear-transform bear-rounded-full bear-bg-white bear-shadow bear-transition",a?"bear-translate-x-4":"bear-translate-x-0")})}),e.jsx("span",{className:n.cn("bear-font-medium bear-text-zinc-200 bear-truncate",t.text),children:d})]})]},r)}if(s.type==="select"&&s.options)return e.jsxs("div",{className:"bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",children:[e.jsxs("div",{className:"bear-flex bear-items-center bear-justify-between bear-mb-1.5",children:[e.jsx("label",{htmlFor:`pp-${r}`,className:n.cn("bear-font-medium bear-text-zinc-300 bear-truncate",t.label),children:d}),e.jsx("span",{className:n.cn("bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500",t.label),children:l.TYPE_LABELS.select})]}),e.jsx("select",{id:`pp-${r}`,value:String(i),onChange:a=>{const x=s.options.find(h=>String(h.value)===a.target.value);o(r,x?x.value:a.target.value)},className:n.cn(m,"bear-cursor-pointer bear-appearance-none"),children:s.options.map(a=>e.jsx("option",{value:String(a.value),children:a.label},String(a.value)))})]},r);if(s.type==="number"){const a=Number(i),x=Number.isNaN(a)?s.default:a;return e.jsxs("div",{className:"bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",children:[e.jsxs("div",{className:"bear-flex bear-items-center bear-justify-between bear-mb-1.5",children:[e.jsx("label",{htmlFor:`pp-${r}`,className:n.cn("bear-font-medium bear-text-zinc-300 bear-truncate",t.label),children:d}),e.jsx("span",{className:n.cn("bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500",t.label),children:l.TYPE_LABELS.number})]}),e.jsx("input",{id:`pp-${r}`,type:"number",value:x,min:s.min,max:s.max,step:s.step,onChange:h=>{const v=h.target.valueAsNumber;o(r,Number.isNaN(v)?s.default:v)},className:m})]},r)}return e.jsxs("div",{className:"bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",children:[e.jsxs("div",{className:"bear-flex bear-items-center bear-justify-between bear-mb-1.5",children:[e.jsx("label",{htmlFor:`pp-${r}`,className:n.cn("bear-font-medium bear-text-zinc-300 bear-truncate",t.label),children:d}),e.jsx("span",{className:n.cn("bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500",t.label),children:l.TYPE_LABELS.string})]}),e.jsx("input",{id:`pp-${r}`,type:"text",value:String(i??""),onChange:a=>o(r,a.target.value),placeholder:s.placeholder,className:m})]},r)})})}),e.jsx("div",{className:"bear-border-t bear-border-zinc-700 bear-p-6 bear-bg-zinc-900 bear-flex bear-items-center bear-justify-center bear-min-h-[180px]",children:e.jsx("div",{className:"bear-w-full",children:z(g)})})]})};exports.PropsPlayground=O;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="Bear-PropsPlayground",a={xs:{padding:"bear-p-2",text:"bear-text-[10px]",gap:"bear-gap-2",label:"bear-text-[9px]",input:"bear-px-1.5 bear-py-0.5 bear-text-[10px]"},sm:{padding:"bear-p-3",text:"bear-text-xs",gap:"bear-gap-2",label:"bear-text-[10px]",input:"bear-px-2 bear-py-1 bear-text-xs"},md:{padding:"bear-p-4",text:"bear-text-sm",gap:"bear-gap-3",label:"bear-text-[11px]",input:"bear-px-2.5 bear-py-1.5 bear-text-xs"},lg:{padding:"bear-p-5",text:"bear-text-sm",gap:"bear-gap-3",label:"bear-text-xs",input:"bear-px-3 bear-py-2 bear-text-sm"},xl:{padding:"bear-p-6",text:"bear-text-base",gap:"bear-gap-4",label:"bear-text-sm",input:"bear-px-3.5 bear-py-2.5 bear-text-base"}},t={1:"bear-grid-cols-1",2:"bear-grid-cols-2",3:"bear-grid-cols-3",4:"bear-grid-cols-4"},r={boolean:"bool",select:"select",number:"num",string:"str"};exports.COLUMN_CLASSES=t;exports.ROOT_CLASS=e;exports.SIZE_CLASSES=a;exports.TYPE_LABELS=r;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BearSize } from '../../types';
|
|
2
|
+
export declare const ROOT_CLASS = "Bear-PropsPlayground";
|
|
3
|
+
export declare const SIZE_CLASSES: Record<BearSize, {
|
|
4
|
+
padding: string;
|
|
5
|
+
text: string;
|
|
6
|
+
gap: string;
|
|
7
|
+
label: string;
|
|
8
|
+
input: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare const COLUMN_CLASSES: Record<number, string>;
|
|
11
|
+
export declare const TYPE_LABELS: Record<string, string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const e = "Bear-PropsPlayground", a = {
|
|
2
|
+
xs: { padding: "bear-p-2", text: "bear-text-[10px]", gap: "bear-gap-2", label: "bear-text-[9px]", input: "bear-px-1.5 bear-py-0.5 bear-text-[10px]" },
|
|
3
|
+
sm: { padding: "bear-p-3", text: "bear-text-xs", gap: "bear-gap-2", label: "bear-text-[10px]", input: "bear-px-2 bear-py-1 bear-text-xs" },
|
|
4
|
+
md: { padding: "bear-p-4", text: "bear-text-sm", gap: "bear-gap-3", label: "bear-text-[11px]", input: "bear-px-2.5 bear-py-1.5 bear-text-xs" },
|
|
5
|
+
lg: { padding: "bear-p-5", text: "bear-text-sm", gap: "bear-gap-3", label: "bear-text-xs", input: "bear-px-3 bear-py-2 bear-text-sm" },
|
|
6
|
+
xl: { padding: "bear-p-6", text: "bear-text-base", gap: "bear-gap-4", label: "bear-text-sm", input: "bear-px-3.5 bear-py-2.5 bear-text-base" }
|
|
7
|
+
}, t = {
|
|
8
|
+
1: "bear-grid-cols-1",
|
|
9
|
+
2: "bear-grid-cols-2",
|
|
10
|
+
3: "bear-grid-cols-3",
|
|
11
|
+
4: "bear-grid-cols-4"
|
|
12
|
+
}, r = {
|
|
13
|
+
boolean: "bool",
|
|
14
|
+
select: "select",
|
|
15
|
+
number: "num",
|
|
16
|
+
string: "str"
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
t as COLUMN_CLASSES,
|
|
20
|
+
e as ROOT_CLASS,
|
|
21
|
+
a as SIZE_CLASSES,
|
|
22
|
+
r as TYPE_LABELS
|
|
23
|
+
};
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as R, useState as y, useCallback as C } from "react";
|
|
3
|
+
import { cn as n } from "../../utils/cn.js";
|
|
4
|
+
import { Icon as f } from "../Icon/Icon.js";
|
|
5
|
+
import { SIZE_CLASSES as _, TYPE_LABELS as m, COLUMN_CLASSES as F, ROOT_CLASS as I } from "./PropsPlayground.const.js";
|
|
6
|
+
import { getDefaults as V } from "./PropsPlayground.utils.js";
|
|
7
|
+
const D = ({ size: i }) => /* @__PURE__ */ e(f, { size: i, children: /* @__PURE__ */ e("polyline", { points: "6 9 12 15 18 9" }) }), M = ({ size: i }) => /* @__PURE__ */ e(f, { size: i, children: /* @__PURE__ */ e("polyline", { points: "9 18 15 12 9 6" }) }), T = ({ size: i }) => /* @__PURE__ */ b(f, { size: i, children: [
|
|
8
|
+
/* @__PURE__ */ e("line", { x1: "4", y1: "21", x2: "4", y2: "14" }),
|
|
9
|
+
/* @__PURE__ */ e("line", { x1: "4", y1: "10", x2: "4", y2: "3" }),
|
|
10
|
+
/* @__PURE__ */ e("line", { x1: "12", y1: "21", x2: "12", y2: "12" }),
|
|
11
|
+
/* @__PURE__ */ e("line", { x1: "12", y1: "8", x2: "12", y2: "3" }),
|
|
12
|
+
/* @__PURE__ */ e("line", { x1: "20", y1: "21", x2: "20", y2: "16" }),
|
|
13
|
+
/* @__PURE__ */ e("line", { x1: "20", y1: "12", x2: "20", y2: "3" }),
|
|
14
|
+
/* @__PURE__ */ e("line", { x1: "1", y1: "14", x2: "7", y2: "14" }),
|
|
15
|
+
/* @__PURE__ */ e("line", { x1: "9", y1: "8", x2: "15", y2: "8" }),
|
|
16
|
+
/* @__PURE__ */ e("line", { x1: "17", y1: "16", x2: "23", y2: "16" })
|
|
17
|
+
] }), H = ({
|
|
18
|
+
config: i,
|
|
19
|
+
render: w,
|
|
20
|
+
title: S = "Props",
|
|
21
|
+
size: k = "md",
|
|
22
|
+
defaultCollapsed: j = !1,
|
|
23
|
+
showReset: $ = !0,
|
|
24
|
+
columns: A = 3,
|
|
25
|
+
className: L,
|
|
26
|
+
testId: E
|
|
27
|
+
}) => {
|
|
28
|
+
const p = R(() => V(i), [i]), [g, N] = y(p), [u, O] = y(j), o = C(
|
|
29
|
+
(r, t) => {
|
|
30
|
+
N((s) => ({ ...s, [r]: t }));
|
|
31
|
+
},
|
|
32
|
+
[]
|
|
33
|
+
), P = C(() => {
|
|
34
|
+
N(p);
|
|
35
|
+
}, [p]), l = _[k], v = Object.keys(i).length, h = n(
|
|
36
|
+
"bear-w-full bear-rounded-md bear-border bear-border-zinc-700",
|
|
37
|
+
"bear-bg-zinc-800 bear-text-zinc-100",
|
|
38
|
+
"placeholder:bear-text-zinc-500",
|
|
39
|
+
"focus:bear-outline-none focus:bear-ring-2 focus:bear-ring-pink-500/30 focus:bear-border-pink-500",
|
|
40
|
+
"bear-transition-colors",
|
|
41
|
+
l.input
|
|
42
|
+
);
|
|
43
|
+
return /* @__PURE__ */ b(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
"data-testid": E,
|
|
47
|
+
className: n(
|
|
48
|
+
I,
|
|
49
|
+
"bear-rounded-lg bear-border bear-border-zinc-700 bear-overflow-hidden",
|
|
50
|
+
L
|
|
51
|
+
),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ b(
|
|
54
|
+
"button",
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
onClick: () => O((r) => !r),
|
|
58
|
+
className: n(
|
|
59
|
+
"bear-w-full bear-flex bear-items-center bear-gap-2 bear-text-left bear-font-medium bear-transition-colors",
|
|
60
|
+
"bear-bg-zinc-800/60 hover:bear-bg-zinc-800",
|
|
61
|
+
"bear-text-zinc-200 bear-border-b bear-border-zinc-700",
|
|
62
|
+
"bear-px-4 bear-py-3",
|
|
63
|
+
l.text
|
|
64
|
+
),
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ e("span", { className: "bear-text-pink-500", children: u ? /* @__PURE__ */ e(M, { size: 12 }) : /* @__PURE__ */ e(D, { size: 12 }) }),
|
|
67
|
+
/* @__PURE__ */ e("span", { className: "bear-text-pink-500", children: /* @__PURE__ */ e(T, { size: 14 }) }),
|
|
68
|
+
/* @__PURE__ */ e("span", { className: "bear-font-semibold", children: S }),
|
|
69
|
+
/* @__PURE__ */ b("span", { className: "bear-ml-auto bear-flex bear-items-center bear-gap-2", children: [
|
|
70
|
+
/* @__PURE__ */ b("span", { className: "bear-text-[10px] bear-font-medium bear-text-zinc-500", children: [
|
|
71
|
+
v,
|
|
72
|
+
" ",
|
|
73
|
+
v === 1 ? "control" : "controls"
|
|
74
|
+
] }),
|
|
75
|
+
$ && !u && /* @__PURE__ */ e(
|
|
76
|
+
"button",
|
|
77
|
+
{
|
|
78
|
+
type: "button",
|
|
79
|
+
onClick: (r) => {
|
|
80
|
+
r.stopPropagation(), P();
|
|
81
|
+
},
|
|
82
|
+
className: "bear-text-[10px] bear-font-semibold bear-text-pink-500 hover:bear-text-pink-400 hover:bear-underline",
|
|
83
|
+
children: "Reset"
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
!u && /* @__PURE__ */ e("div", { className: n("bear-bg-zinc-900/50", l.padding), children: /* @__PURE__ */ e("div", { className: n("bear-grid", l.gap, F[A]), children: Object.entries(i).map(([r, t]) => {
|
|
91
|
+
const s = g[r], c = r.replace(/([A-Z])/g, " $1").replace(/^./, (a) => a.toUpperCase()).trim();
|
|
92
|
+
if (t.type === "boolean") {
|
|
93
|
+
const a = s === !0;
|
|
94
|
+
return /* @__PURE__ */ b(
|
|
95
|
+
"div",
|
|
96
|
+
{
|
|
97
|
+
className: "bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ e("span", { className: n("bear-block bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500 bear-mb-2", l.label), children: m.boolean }),
|
|
100
|
+
/* @__PURE__ */ b("label", { className: "bear-flex bear-items-center bear-gap-2.5 bear-cursor-pointer", children: [
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
"button",
|
|
103
|
+
{
|
|
104
|
+
type: "button",
|
|
105
|
+
role: "switch",
|
|
106
|
+
"aria-checked": a,
|
|
107
|
+
onClick: () => o(r, !a),
|
|
108
|
+
className: n(
|
|
109
|
+
"bear-relative bear-inline-flex bear-h-5 bear-w-9 bear-flex-shrink-0 bear-rounded-full bear-border-2 bear-border-transparent bear-transition-colors",
|
|
110
|
+
a ? "bear-bg-pink-500" : "bear-bg-zinc-600"
|
|
111
|
+
),
|
|
112
|
+
children: /* @__PURE__ */ e(
|
|
113
|
+
"span",
|
|
114
|
+
{
|
|
115
|
+
className: n(
|
|
116
|
+
"bear-pointer-events-none bear-inline-block bear-h-4 bear-w-4 bear-transform bear-rounded-full bear-bg-white bear-shadow bear-transition",
|
|
117
|
+
a ? "bear-translate-x-4" : "bear-translate-x-0"
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ e("span", { className: n("bear-font-medium bear-text-zinc-200 bear-truncate", l.text), children: c })
|
|
124
|
+
] })
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
r
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
if (t.type === "select" && t.options)
|
|
131
|
+
return /* @__PURE__ */ b(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
className: "bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",
|
|
135
|
+
children: [
|
|
136
|
+
/* @__PURE__ */ b("div", { className: "bear-flex bear-items-center bear-justify-between bear-mb-1.5", children: [
|
|
137
|
+
/* @__PURE__ */ e("label", { htmlFor: `pp-${r}`, className: n("bear-font-medium bear-text-zinc-300 bear-truncate", l.label), children: c }),
|
|
138
|
+
/* @__PURE__ */ e("span", { className: n("bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500", l.label), children: m.select })
|
|
139
|
+
] }),
|
|
140
|
+
/* @__PURE__ */ e(
|
|
141
|
+
"select",
|
|
142
|
+
{
|
|
143
|
+
id: `pp-${r}`,
|
|
144
|
+
value: String(s),
|
|
145
|
+
onChange: (a) => {
|
|
146
|
+
const d = t.options.find((x) => String(x.value) === a.target.value);
|
|
147
|
+
o(r, d ? d.value : a.target.value);
|
|
148
|
+
},
|
|
149
|
+
className: n(h, "bear-cursor-pointer bear-appearance-none"),
|
|
150
|
+
children: t.options.map((a) => /* @__PURE__ */ e("option", { value: String(a.value), children: a.label }, String(a.value)))
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
]
|
|
154
|
+
},
|
|
155
|
+
r
|
|
156
|
+
);
|
|
157
|
+
if (t.type === "number") {
|
|
158
|
+
const a = Number(s), d = Number.isNaN(a) ? t.default : a;
|
|
159
|
+
return /* @__PURE__ */ b(
|
|
160
|
+
"div",
|
|
161
|
+
{
|
|
162
|
+
className: "bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",
|
|
163
|
+
children: [
|
|
164
|
+
/* @__PURE__ */ b("div", { className: "bear-flex bear-items-center bear-justify-between bear-mb-1.5", children: [
|
|
165
|
+
/* @__PURE__ */ e("label", { htmlFor: `pp-${r}`, className: n("bear-font-medium bear-text-zinc-300 bear-truncate", l.label), children: c }),
|
|
166
|
+
/* @__PURE__ */ e("span", { className: n("bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500", l.label), children: m.number })
|
|
167
|
+
] }),
|
|
168
|
+
/* @__PURE__ */ e(
|
|
169
|
+
"input",
|
|
170
|
+
{
|
|
171
|
+
id: `pp-${r}`,
|
|
172
|
+
type: "number",
|
|
173
|
+
value: d,
|
|
174
|
+
min: t.min,
|
|
175
|
+
max: t.max,
|
|
176
|
+
step: t.step,
|
|
177
|
+
onChange: (x) => {
|
|
178
|
+
const z = x.target.valueAsNumber;
|
|
179
|
+
o(r, Number.isNaN(z) ? t.default : z);
|
|
180
|
+
},
|
|
181
|
+
className: h
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
]
|
|
185
|
+
},
|
|
186
|
+
r
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
return /* @__PURE__ */ b(
|
|
190
|
+
"div",
|
|
191
|
+
{
|
|
192
|
+
className: "bear-rounded-lg bear-border bear-border-zinc-700/60 bear-bg-zinc-800/30 bear-p-3",
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ b("div", { className: "bear-flex bear-items-center bear-justify-between bear-mb-1.5", children: [
|
|
195
|
+
/* @__PURE__ */ e("label", { htmlFor: `pp-${r}`, className: n("bear-font-medium bear-text-zinc-300 bear-truncate", l.label), children: c }),
|
|
196
|
+
/* @__PURE__ */ e("span", { className: n("bear-font-semibold bear-uppercase bear-tracking-wider bear-text-pink-500", l.label), children: m.string })
|
|
197
|
+
] }),
|
|
198
|
+
/* @__PURE__ */ e(
|
|
199
|
+
"input",
|
|
200
|
+
{
|
|
201
|
+
id: `pp-${r}`,
|
|
202
|
+
type: "text",
|
|
203
|
+
value: String(s ?? ""),
|
|
204
|
+
onChange: (a) => o(r, a.target.value),
|
|
205
|
+
placeholder: t.placeholder,
|
|
206
|
+
className: h
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
]
|
|
210
|
+
},
|
|
211
|
+
r
|
|
212
|
+
);
|
|
213
|
+
}) }) }),
|
|
214
|
+
/* @__PURE__ */ e("div", { className: "bear-border-t bear-border-zinc-700 bear-p-6 bear-bg-zinc-900 bear-flex bear-items-center bear-justify-center bear-min-h-[180px]", children: /* @__PURE__ */ e("div", { className: "bear-w-full", children: w(g) }) })
|
|
215
|
+
]
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
};
|
|
219
|
+
export {
|
|
220
|
+
H as PropsPlayground
|
|
221
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BearSize } from '../../types';
|
|
3
|
+
export type PropControlType = 'boolean' | 'string' | 'number' | 'select';
|
|
4
|
+
export interface PropControlOption {
|
|
5
|
+
label: string;
|
|
6
|
+
value: string | number | boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PropControlConfig {
|
|
9
|
+
type: PropControlType;
|
|
10
|
+
default: string | number | boolean;
|
|
11
|
+
options?: PropControlOption[];
|
|
12
|
+
min?: number;
|
|
13
|
+
max?: number;
|
|
14
|
+
step?: number;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
}
|
|
17
|
+
export type PropsConfig = Record<string, PropControlConfig>;
|
|
18
|
+
export type PropValues = Record<string, string | number | boolean>;
|
|
19
|
+
export interface PropsPlaygroundProps {
|
|
20
|
+
config: PropsConfig;
|
|
21
|
+
render: (values: PropValues) => ReactNode;
|
|
22
|
+
title?: string;
|
|
23
|
+
size?: BearSize;
|
|
24
|
+
defaultCollapsed?: boolean;
|
|
25
|
+
showReset?: boolean;
|
|
26
|
+
columns?: 1 | 2 | 3 | 4;
|
|
27
|
+
className?: string;
|
|
28
|
+
testId?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function n(t){const e={};for(const[o,u]of Object.entries(t))e[o]=u.default;return e}exports.getDefaults=n;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("react"),A=require("../../utils/cn.cjs"),j=require("../Typography/Typography.cjs"),s=require("./RadioCard.const.cjs"),x=c.createContext(null),h=({value:d,checked:t,onChange:i,label:f,description:n,icon:u,disabled:l=!1,variant:v="default",size:y="md",testId:R,className:k,onClick:r,...S})=>{const e=c.useContext(x),o=!!e,m=o?(e==null?void 0:e.value)===d:!!t,N=c.useCallback(b=>{l||((e==null?void 0:e.disabled)??!1)||(r==null||r(b),o&&e?e.onChange(d):i==null||i(d))},[l,e,o,d,i,r]),p=l||((e==null?void 0:e.disabled)??!1);return a.jsxs("div",{role:"radio","aria-checked":m,"aria-disabled":p,tabIndex:p?void 0:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),N(b))},className:A.cn(s.ROOT_CLASS,s.SIZE_PADDING_MAP[y],s.VARIANT_CLASSES[v],m&&s.CHECKED_CLASSES,p&&"bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none",!p&&"hover:bear-border-gray-300 dark:hover:bear-border-gray-600",k),onClick:N,"data-testid":R,...S,children:[a.jsx("div",{className:A.cn("bear-absolute bear-top-3 bear-right-3 bear-flex bear-items-center bear-justify-center bear-rounded-full bear-border-2",m?"bear-border-pink-500 dark:bear-border-pink-400":"bear-border-gray-300 dark:bear-border-gray-600",s.RADIO_INDICATOR_SIZE_MAP[y]),children:m&&a.jsx("div",{className:"bear-w-2 bear-h-2 bear-rounded-full bear-bg-pink-500 dark:bear-bg-pink-400"})}),u&&a.jsx("div",{className:"bear-mb-3 bear-flex bear-items-center bear-justify-center bear-text-gray-500 dark:bear-text-gray-400",children:u}),a.jsx(j.Typography,{variant:"body2",weight:"medium",className:"bear-block",children:f}),n&&a.jsx(j.Typography,{variant:"caption",color:"secondary",className:"bear-mt-1 bear-block",children:n})]})};h.displayName="RadioCard";const _=({value:d,onChange:t,children:i,columns:f=s.DEFAULT_COLUMNS,gap:n=s.DEFAULT_GAP,name:u,testId:l,className:v,...y})=>{const[R,k]=c.useState(""),r=d!==void 0,S=r?d:R,e=c.useCallback(o=>{r||k(o),t==null||t(o)},[r,t]);return a.jsx(x.Provider,{value:{value:S,onChange:e,name:u},children:a.jsx("div",{role:"radiogroup",className:A.cn("Bear-RadioCardGroup bear-grid",v),style:{gridTemplateColumns:`repeat(${f}, minmax(0, 1fr))`,gap:`${n*.25}rem`},"data-testid":l,...y,children:i})})};_.displayName="RadioCardGroup";exports.RadioCard=h;exports.RadioCardGroup=_;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r={sm:"bear-p-3",md:"bear-p-4",lg:"bear-p-5"},e={default:"bear-border bear-border-gray-200 dark:bear-border-gray-700",outline:"bear-border bear-border-dashed bear-border-gray-300 dark:bear-border-gray-600",filled:"bear-bg-gray-50 dark:bear-bg-gray-800/50"},a="bear-border-pink-500 dark:bear-border-pink-400 bear-ring-2 bear-ring-pink-500/30 dark:bear-ring-pink-400/30 bear-bg-pink-50 dark:bear-bg-pink-950/30",b="Bear-RadioCard bear-relative bear-rounded-lg bear-transition-all bear-duration-200 bear-cursor-pointer bear-text-left",d={sm:"bear-w-4 bear-h-4",md:"bear-w-5 bear-h-5",lg:"bear-w-6 bear-h-6"},o=1,A=4;exports.CHECKED_CLASSES=a;exports.DEFAULT_COLUMNS=o;exports.DEFAULT_GAP=A;exports.RADIO_INDICATOR_SIZE_MAP=d;exports.ROOT_CLASS=b;exports.SIZE_PADDING_MAP=r;exports.VARIANT_CLASSES=e;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const SIZE_PADDING_MAP: Record<'sm' | 'md' | 'lg', string>;
|
|
2
|
+
export declare const VARIANT_CLASSES: Record<'default' | 'outline' | 'filled', string>;
|
|
3
|
+
export declare const CHECKED_CLASSES = "bear-border-pink-500 dark:bear-border-pink-400 bear-ring-2 bear-ring-pink-500/30 dark:bear-ring-pink-400/30 bear-bg-pink-50 dark:bear-bg-pink-950/30";
|
|
4
|
+
export declare const ROOT_CLASS = "Bear-RadioCard bear-relative bear-rounded-lg bear-transition-all bear-duration-200 bear-cursor-pointer bear-text-left";
|
|
5
|
+
export declare const RADIO_INDICATOR_SIZE_MAP: Record<'sm' | 'md' | 'lg', string>;
|
|
6
|
+
export declare const DEFAULT_COLUMNS = 1;
|
|
7
|
+
export declare const DEFAULT_GAP = 4;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
sm: "bear-p-3",
|
|
3
|
+
md: "bear-p-4",
|
|
4
|
+
lg: "bear-p-5"
|
|
5
|
+
}, a = {
|
|
6
|
+
default: "bear-border bear-border-gray-200 dark:bear-border-gray-700",
|
|
7
|
+
outline: "bear-border bear-border-dashed bear-border-gray-300 dark:bear-border-gray-600",
|
|
8
|
+
filled: "bear-bg-gray-50 dark:bear-bg-gray-800/50"
|
|
9
|
+
}, e = "bear-border-pink-500 dark:bear-border-pink-400 bear-ring-2 bear-ring-pink-500/30 dark:bear-ring-pink-400/30 bear-bg-pink-50 dark:bear-bg-pink-950/30", b = "Bear-RadioCard bear-relative bear-rounded-lg bear-transition-all bear-duration-200 bear-cursor-pointer bear-text-left", d = {
|
|
10
|
+
sm: "bear-w-4 bear-h-4",
|
|
11
|
+
md: "bear-w-5 bear-h-5",
|
|
12
|
+
lg: "bear-w-6 bear-h-6"
|
|
13
|
+
}, o = 1, n = 4;
|
|
14
|
+
export {
|
|
15
|
+
e as CHECKED_CLASSES,
|
|
16
|
+
o as DEFAULT_COLUMNS,
|
|
17
|
+
n as DEFAULT_GAP,
|
|
18
|
+
d as RADIO_INDICATOR_SIZE_MAP,
|
|
19
|
+
b as ROOT_CLASS,
|
|
20
|
+
r as SIZE_PADDING_MAP,
|
|
21
|
+
a as VARIANT_CLASSES
|
|
22
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsxs as R, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as _, useContext as h, useCallback as D, useState as E } from "react";
|
|
3
|
+
import { cn as A } from "../../utils/cn.js";
|
|
4
|
+
import { Typography as S } from "../Typography/Typography.js";
|
|
5
|
+
import { RADIO_INDICATOR_SIZE_MAP as G, CHECKED_CLASSES as T, VARIANT_CLASSES as x, SIZE_PADDING_MAP as L, ROOT_CLASS as C, DEFAULT_COLUMNS as O, DEFAULT_GAP as P } from "./RadioCard.const.js";
|
|
6
|
+
const I = _(null), j = ({
|
|
7
|
+
value: a,
|
|
8
|
+
checked: t,
|
|
9
|
+
onChange: i,
|
|
10
|
+
label: p,
|
|
11
|
+
description: l,
|
|
12
|
+
icon: c,
|
|
13
|
+
disabled: b = !1,
|
|
14
|
+
variant: u = "default",
|
|
15
|
+
size: n = "md",
|
|
16
|
+
testId: y,
|
|
17
|
+
className: v,
|
|
18
|
+
onClick: e,
|
|
19
|
+
...k
|
|
20
|
+
}) => {
|
|
21
|
+
const r = h(I), s = !!r, m = s ? (r == null ? void 0 : r.value) === a : !!t, N = D(
|
|
22
|
+
(o) => {
|
|
23
|
+
b || ((r == null ? void 0 : r.disabled) ?? !1) || (e == null || e(o), s && r ? r.onChange(a) : i == null || i(a));
|
|
24
|
+
},
|
|
25
|
+
[b, r, s, a, i, e]
|
|
26
|
+
), f = b || ((r == null ? void 0 : r.disabled) ?? !1);
|
|
27
|
+
return /* @__PURE__ */ R(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
role: "radio",
|
|
31
|
+
"aria-checked": m,
|
|
32
|
+
"aria-disabled": f,
|
|
33
|
+
tabIndex: f ? void 0 : 0,
|
|
34
|
+
onKeyDown: (o) => {
|
|
35
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), N(o));
|
|
36
|
+
},
|
|
37
|
+
className: A(
|
|
38
|
+
C,
|
|
39
|
+
L[n],
|
|
40
|
+
x[u],
|
|
41
|
+
m && T,
|
|
42
|
+
f && "bear-opacity-50 bear-cursor-not-allowed bear-pointer-events-none",
|
|
43
|
+
!f && "hover:bear-border-gray-300 dark:hover:bear-border-gray-600",
|
|
44
|
+
v
|
|
45
|
+
),
|
|
46
|
+
onClick: N,
|
|
47
|
+
"data-testid": y,
|
|
48
|
+
...k,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ d(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
className: A(
|
|
54
|
+
"bear-absolute bear-top-3 bear-right-3 bear-flex bear-items-center bear-justify-center bear-rounded-full bear-border-2",
|
|
55
|
+
m ? "bear-border-pink-500 dark:bear-border-pink-400" : "bear-border-gray-300 dark:bear-border-gray-600",
|
|
56
|
+
G[n]
|
|
57
|
+
),
|
|
58
|
+
children: m && /* @__PURE__ */ d("div", { className: "bear-w-2 bear-h-2 bear-rounded-full bear-bg-pink-500 dark:bear-bg-pink-400" })
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
c && /* @__PURE__ */ d("div", { className: "bear-mb-3 bear-flex bear-items-center bear-justify-center bear-text-gray-500 dark:bear-text-gray-400", children: c }),
|
|
62
|
+
/* @__PURE__ */ d(S, { variant: "body2", weight: "medium", className: "bear-block", children: p }),
|
|
63
|
+
l && /* @__PURE__ */ d(S, { variant: "caption", color: "secondary", className: "bear-mt-1 bear-block", children: l })
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
j.displayName = "RadioCard";
|
|
69
|
+
const w = ({
|
|
70
|
+
value: a,
|
|
71
|
+
onChange: t,
|
|
72
|
+
children: i,
|
|
73
|
+
columns: p = O,
|
|
74
|
+
gap: l = P,
|
|
75
|
+
name: c,
|
|
76
|
+
testId: b,
|
|
77
|
+
className: u,
|
|
78
|
+
...n
|
|
79
|
+
}) => {
|
|
80
|
+
const [y, v] = E(""), e = a !== void 0, k = e ? a : y, r = D(
|
|
81
|
+
(s) => {
|
|
82
|
+
e || v(s), t == null || t(s);
|
|
83
|
+
},
|
|
84
|
+
[e, t]
|
|
85
|
+
);
|
|
86
|
+
return /* @__PURE__ */ d(
|
|
87
|
+
I.Provider,
|
|
88
|
+
{
|
|
89
|
+
value: { value: k, onChange: r, name: c },
|
|
90
|
+
children: /* @__PURE__ */ d(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
role: "radiogroup",
|
|
94
|
+
className: A("Bear-RadioCardGroup bear-grid", u),
|
|
95
|
+
style: {
|
|
96
|
+
gridTemplateColumns: `repeat(${p}, minmax(0, 1fr))`,
|
|
97
|
+
gap: `${l * 0.25}rem`
|
|
98
|
+
},
|
|
99
|
+
"data-testid": b,
|
|
100
|
+
...n,
|
|
101
|
+
children: i
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
w.displayName = "RadioCardGroup";
|
|
108
|
+
export {
|
|
109
|
+
j as RadioCard,
|
|
110
|
+
w as RadioCardGroup
|
|
111
|
+
};
|