@forgedevstack/bear 1.2.3 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.cjs +1 -1
- package/dist/components/Accordion/Accordion.js +45 -47
- package/dist/components/ActionIcon/ActionIcon.types.d.ts +1 -0
- package/dist/components/ActiveBar/ActiveBar.const.d.ts +1 -0
- package/dist/components/ActiveBar/ActiveBar.types.d.ts +2 -0
- package/dist/components/ActivityItem/ActivityItem.const.d.ts +1 -0
- package/dist/components/ActivityItem/ActivityItem.types.d.ts +2 -0
- package/dist/components/Affix/Affix.types.d.ts +1 -0
- package/dist/components/Alert/Alert.cjs +1 -1
- package/dist/components/Alert/Alert.js +16 -18
- package/dist/components/AlertDialog/AlertDialog.types.d.ts +1 -0
- package/dist/components/Anchor/Anchor.types.d.ts +1 -0
- package/dist/components/AnimatedCounter/AnimatedCounter.types.d.ts +1 -0
- package/dist/components/AppBar/AppBar.const.d.ts +1 -0
- package/dist/components/AppBar/AppBar.types.d.ts +2 -0
- package/dist/components/AspectRatio/AspectRatio.cjs +1 -1
- package/dist/components/AspectRatio/AspectRatio.const.d.ts +1 -0
- package/dist/components/AspectRatio/AspectRatio.js +9 -1
- package/dist/components/AspectRatio/AspectRatio.types.d.ts +2 -0
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +1 -0
- package/dist/components/Avatar/Avatar.types.d.ts +1 -0
- package/dist/components/BackTop/BackTop.types.d.ts +1 -0
- package/dist/components/Badge/Badge.types.d.ts +1 -0
- package/dist/components/BearLoader/BearLoader.const.d.ts +1 -0
- package/dist/components/BearLoader/BearLoader.types.d.ts +1 -0
- package/dist/components/BearLogo/BearLogo.const.d.ts +1 -0
- package/dist/components/BearLogo/BearLogo.types.d.ts +2 -0
- package/dist/components/Biometric/Biometric.const.d.ts +1 -0
- package/dist/components/Biometric/Biometric.types.d.ts +1 -0
- package/dist/components/Blockquote/Blockquote.types.d.ts +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.const.d.ts +1 -0
- package/dist/components/BottomNavigation/BottomNavigation.types.d.ts +2 -0
- package/dist/components/BottomSheet/BottomSheet.const.d.ts +1 -0
- package/dist/components/BottomSheet/BottomSheet.types.d.ts +2 -0
- package/dist/components/Box/Box.const.d.ts +1 -0
- package/dist/components/Box/Box.types.d.ts +3 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.cjs +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +21 -23
- package/dist/components/Button/Button.cjs +1 -1
- package/dist/components/Button/Button.js +112 -100
- package/dist/components/Button/Button.types.d.ts +5 -1
- package/dist/components/ButtonGroup/ButtonGroup.const.d.ts +1 -0
- package/dist/components/ButtonGroup/ButtonGroup.types.d.ts +1 -0
- package/dist/components/Calendar/Calendar.cjs +1 -1
- package/dist/components/Calendar/Calendar.js +3 -2
- package/dist/components/Calendar/Calendar.types.d.ts +1 -0
- package/dist/components/Card/Card.cjs +1 -1
- package/dist/components/Card/Card.js +15 -17
- package/dist/components/Card/Card.types.d.ts +2 -2
- package/dist/components/CardSkeleton/CardSkeleton.const.d.ts +1 -0
- package/dist/components/CardSkeleton/index.d.ts +2 -0
- package/dist/components/Carousel/Carousel.types.d.ts +1 -0
- package/dist/components/Cascader/Cascader.cjs +1 -1
- package/dist/components/Cascader/Cascader.d.ts +1 -2
- package/dist/components/Cascader/Cascader.js +3 -3
- package/dist/components/Cascader/Cascader.types.d.ts +1 -0
- package/dist/components/Chart/Chart.cjs +1 -1
- package/dist/components/Chart/Chart.js +6 -2
- package/dist/components/Chart/Chart.types.d.ts +1 -0
- package/dist/components/Chat/Chat.const.cjs +1 -1
- package/dist/components/Chat/Chat.const.d.ts +1 -1
- package/dist/components/Chat/Chat.const.js +1 -1
- package/dist/components/Chat/Chat.types.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.cjs +1 -1
- package/dist/components/Checkbox/Checkbox.const.cjs +1 -0
- package/dist/components/Checkbox/Checkbox.const.d.ts +30 -0
- package/dist/components/Checkbox/Checkbox.const.js +58 -0
- package/dist/components/Checkbox/Checkbox.d.ts +0 -11
- package/dist/components/Checkbox/Checkbox.js +67 -110
- package/dist/components/Checkbox/Checkbox.types.d.ts +3 -12
- package/dist/components/Checkbox/helpers/CheckboxIndicatorIcon.cjs +1 -0
- package/dist/components/Checkbox/helpers/CheckboxIndicatorIcon.d.ts +2 -0
- package/dist/components/Checkbox/helpers/CheckboxIndicatorIcon.js +18 -0
- package/dist/components/Checkbox/helpers/CheckboxIndicatorIcon.types.d.ts +6 -0
- package/dist/components/Checkbox/helpers/index.d.ts +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -2
- package/dist/components/CheckboxCard/CheckboxCard.types.d.ts +1 -0
- package/dist/components/Chip/Chip.const.d.ts +1 -0
- package/dist/components/Chip/Chip.types.d.ts +2 -0
- package/dist/components/CloseButton/CloseButton.const.d.ts +1 -0
- package/dist/components/CloseButton/CloseButton.types.d.ts +1 -0
- package/dist/components/CodeBlock/CodeBlock.cjs +2 -2
- package/dist/components/CodeBlock/CodeBlock.const.d.ts +1 -0
- package/dist/components/CodeBlock/CodeBlock.js +22 -24
- package/dist/components/CodeEditor/CodeEditor.types.d.ts +1 -0
- package/dist/components/Collapsible/Collapsible.const.d.ts +1 -0
- package/dist/components/Collapsible/Collapsible.types.d.ts +2 -0
- package/dist/components/ColorPicker/ColorPicker.types.d.ts +2 -0
- package/dist/components/ColorSwatch/ColorSwatch.cjs +1 -1
- package/dist/components/ColorSwatch/ColorSwatch.js +8 -8
- package/dist/components/ColorSwatch/ColorSwatch.types.d.ts +1 -0
- package/dist/components/Columns/Columns.const.d.ts +1 -0
- package/dist/components/Columns/Columns.types.d.ts +2 -0
- package/dist/components/CommandPalette/CommandPalette.cjs +1 -1
- package/dist/components/CommandPalette/CommandPalette.js +71 -71
- package/dist/components/CommandPalette/CommandPalette.types.d.ts +1 -0
- package/dist/components/Confetti/Confetti.types.d.ts +1 -0
- package/dist/components/Container/Container.const.d.ts +1 -0
- package/dist/components/Container/Container.types.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenu.cjs +1 -1
- package/dist/components/ContextMenu/ContextMenu.const.cjs +1 -1
- package/dist/components/ContextMenu/ContextMenu.const.d.ts +3 -0
- package/dist/components/ContextMenu/ContextMenu.const.js +13 -10
- package/dist/components/ContextMenu/ContextMenu.d.ts +1 -3
- package/dist/components/ContextMenu/ContextMenu.js +30 -59
- package/dist/components/ContextMenu/ContextMenu.types.d.ts +1 -0
- package/dist/components/ContextMenu/ContextMenu.utils.cjs +1 -1
- package/dist/components/ContextMenu/ContextMenu.utils.d.ts +7 -0
- package/dist/components/ContextMenu/ContextMenu.utils.js +11 -2
- package/dist/components/ContextMenu/components/ContextMenuMenuList/ContextMenuMenuList.cjs +1 -0
- package/dist/components/ContextMenu/components/ContextMenuMenuList/ContextMenuMenuList.d.ts +11 -0
- package/dist/components/ContextMenu/components/ContextMenuMenuList/ContextMenuMenuList.js +69 -0
- package/dist/components/ContextMenu/components/ContextMenuMenuList/index.d.ts +1 -0
- package/dist/components/CopyButton/CopyButton.const.d.ts +1 -0
- package/dist/components/CopyButton/CopyButton.types.d.ts +2 -0
- package/dist/components/CountdownTimer/CountdownTimer.types.d.ts +1 -0
- package/dist/components/CreditInput/CreditInput.types.d.ts +1 -0
- package/dist/components/CssBaseline/CssBaseline.cjs +1 -0
- package/dist/components/CssBaseline/CssBaseline.const.cjs +5 -0
- package/dist/components/CssBaseline/CssBaseline.const.d.ts +2 -0
- package/dist/components/CssBaseline/CssBaseline.const.js +9 -0
- package/dist/components/CssBaseline/CssBaseline.d.ts +2 -0
- package/dist/components/CssBaseline/CssBaseline.js +24 -0
- package/dist/components/CssBaseline/CssBaseline.types.d.ts +4 -0
- package/dist/components/CssBaseline/index.d.ts +2 -0
- package/dist/components/CurrencyInput/CurrencyInput.types.d.ts +1 -0
- package/dist/components/DataTable/DataTable.const.d.ts +1 -0
- package/dist/components/DataTable/DataTable.types.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.cjs +1 -1
- package/dist/components/DatePicker/DatePicker.const.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.js +12 -11
- package/dist/components/DatePicker/DatePicker.types.d.ts +2 -0
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +1 -0
- package/dist/components/Descriptions/Descriptions.types.d.ts +1 -0
- package/dist/components/DiffSquares/DiffSquares.cjs +1 -1
- package/dist/components/DiffSquares/DiffSquares.js +11 -11
- package/dist/components/DiffSquares/DiffSquares.types.d.ts +1 -0
- package/dist/components/DiffViewer/DiffViewer.types.d.ts +1 -0
- package/dist/components/Divider/Divider.const.d.ts +1 -0
- package/dist/components/Divider/Divider.types.d.ts +1 -0
- package/dist/components/Dock/Dock.types.d.ts +1 -0
- package/dist/components/Drawer/Drawer.cjs +1 -1
- package/dist/components/Drawer/Drawer.js +44 -39
- package/dist/components/Drawer/Drawer.types.d.ts +5 -10
- package/dist/components/Dropdown/Dropdown.cjs +1 -1
- package/dist/components/Dropdown/Dropdown.js +3 -2
- package/dist/components/Dropdown/Dropdown.types.d.ts +1 -0
- package/dist/components/Editable/Editable.const.d.ts +1 -0
- package/dist/components/Editable/Editable.types.d.ts +2 -0
- package/dist/components/Em/Em.const.d.ts +1 -0
- package/dist/components/Em/Em.types.d.ts +2 -0
- package/dist/components/EmojiPicker/EmojiPicker.types.d.ts +2 -0
- package/dist/components/EmptyState/EmptyState.const.d.ts +1 -0
- package/dist/components/EmptyState/EmptyState.types.d.ts +2 -0
- package/dist/components/Fab/Fab.const.d.ts +1 -0
- package/dist/components/Fab/Fab.types.d.ts +1 -0
- package/dist/components/Fieldset/Fieldset.types.d.ts +1 -0
- package/dist/components/FileTree/FileTree.const.d.ts +1 -0
- package/dist/components/FileTree/FileTree.types.d.ts +1 -0
- package/dist/components/FileUpload/FileUpload.const.d.ts +1 -0
- package/dist/components/FileUpload/FileUpload.types.d.ts +2 -0
- package/dist/components/Flex/Flex.cjs +1 -1
- package/dist/components/Flex/Flex.const.cjs +1 -0
- package/dist/components/Flex/Flex.const.d.ts +6 -0
- package/dist/components/Flex/Flex.const.js +42 -0
- package/dist/components/Flex/Flex.d.ts +0 -11
- package/dist/components/Flex/Flex.js +28 -67
- package/dist/components/Flex/Flex.types.d.ts +1 -0
- package/dist/components/FloatingChat/FloatingChat.types.d.ts +1 -0
- package/dist/components/Form/Form.types.d.ts +1 -0
- package/dist/components/FormControl/FormControl.cjs +1 -0
- package/dist/components/FormControl/FormControl.const.cjs +1 -0
- package/dist/components/FormControl/FormControl.const.d.ts +5 -0
- package/dist/components/FormControl/FormControl.const.js +8 -0
- package/dist/components/FormControl/FormControl.context.cjs +1 -0
- package/dist/components/FormControl/FormControl.context.d.ts +2 -0
- package/dist/components/FormControl/FormControl.context.js +5 -0
- package/dist/components/FormControl/FormControl.d.ts +2 -0
- package/dist/components/FormControl/FormControl.js +90 -0
- package/dist/components/FormControl/FormControl.types.d.ts +19 -0
- package/dist/components/FormControl/index.d.ts +4 -0
- package/dist/components/FormField/FormField.cjs +1 -1
- package/dist/components/FormField/FormField.js +70 -67
- package/dist/components/FormField/FormField.types.d.ts +2 -0
- package/dist/components/FormSkeleton/FormSkeleton.cjs +1 -0
- package/dist/components/FormSkeleton/FormSkeleton.const.cjs +1 -0
- package/dist/components/FormSkeleton/FormSkeleton.const.d.ts +5 -0
- package/dist/components/FormSkeleton/FormSkeleton.const.js +8 -0
- package/dist/components/FormSkeleton/FormSkeleton.d.ts +2 -0
- package/dist/components/FormSkeleton/FormSkeleton.js +32 -0
- package/dist/components/FormSkeleton/FormSkeleton.types.d.ts +8 -0
- package/dist/components/FormSkeleton/index.d.ts +2 -0
- package/dist/components/Gauge/Gauge.cjs +1 -1
- package/dist/components/Gauge/Gauge.const.cjs +1 -0
- package/dist/components/Gauge/Gauge.const.d.ts +9 -0
- package/dist/components/Gauge/Gauge.const.js +12 -0
- package/dist/components/Gauge/Gauge.js +71 -95
- package/dist/components/Gauge/Gauge.types.d.ts +2 -0
- package/dist/components/Gauge/helpers/GaugeArcSvg.cjs +1 -0
- package/dist/components/Gauge/helpers/GaugeArcSvg.d.ts +14 -0
- package/dist/components/Gauge/helpers/GaugeArcSvg.js +65 -0
- package/dist/components/Gauge/hooks/useGauge.cjs +1 -0
- package/dist/components/Gauge/hooks/useGauge.d.ts +14 -0
- package/dist/components/Gauge/hooks/useGauge.js +42 -0
- package/dist/components/GlowCard/GlowCard.types.d.ts +1 -0
- package/dist/components/GradientText/GradientText.types.d.ts +1 -0
- package/dist/components/Grid/Grid.const.d.ts +1 -0
- package/dist/components/Grid/Grid.types.d.ts +1 -0
- package/dist/components/Heatmap/Heatmap.types.d.ts +1 -0
- package/dist/components/Highlight/Highlight.types.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.const.d.ts +1 -0
- package/dist/components/HoverCard/HoverCard.types.d.ts +2 -0
- package/dist/components/Icon/Icon.const.d.ts +1 -0
- package/dist/components/Icon/Icon.types.d.ts +1 -0
- package/dist/components/Icon/icons/misc.cjs +1 -1
- package/dist/components/Icon/icons/misc.d.ts +3 -0
- package/dist/components/Icon/icons/misc.js +118 -104
- package/dist/components/Icon/index.d.ts +3 -0
- package/dist/components/Image/Image.const.d.ts +1 -0
- package/dist/components/Image/Image.types.d.ts +2 -0
- package/dist/components/ImageAnnotation/ImageAnnotation.types.d.ts +1 -0
- package/dist/components/ImageGallery/ImageGallery.types.d.ts +1 -0
- package/dist/components/Indicator/Indicator.types.d.ts +1 -0
- package/dist/components/InfiniteScroll/InfiniteScroll.types.d.ts +1 -0
- package/dist/components/Input/Input.cjs +1 -1
- package/dist/components/Input/Input.const.cjs +1 -0
- package/dist/components/Input/Input.const.d.ts +13 -0
- package/dist/components/Input/Input.const.js +16 -0
- package/dist/components/Input/Input.js +216 -177
- package/dist/components/Input/Input.types.d.ts +8 -27
- package/dist/components/InputGroup/InputGroup.const.d.ts +1 -0
- package/dist/components/InputGroup/InputGroup.types.d.ts +1 -0
- package/dist/components/JsonViewer/JsonViewer.types.d.ts +1 -0
- package/dist/components/Kanban/Kanban.cjs +1 -1
- package/dist/components/Kanban/Kanban.const.d.ts +1 -0
- package/dist/components/Kanban/Kanban.js +9 -8
- package/dist/components/Kanban/Kanban.types.d.ts +2 -0
- package/dist/components/Kbd/Kbd.const.d.ts +1 -0
- package/dist/components/Kbd/Kbd.types.d.ts +2 -0
- package/dist/components/Link/Link.const.d.ts +1 -0
- package/dist/components/Link/Link.types.d.ts +1 -0
- package/dist/components/List/List.cjs +1 -1
- package/dist/components/List/List.const.cjs +1 -0
- package/dist/components/List/List.const.d.ts +11 -0
- package/dist/components/List/List.const.js +18 -0
- package/dist/components/List/List.js +96 -105
- package/dist/components/List/List.types.d.ts +2 -1
- package/dist/components/LoadingOverlay/LoadingOverlay.types.d.ts +1 -0
- package/dist/components/Map/Map.types.d.ts +1 -0
- package/dist/components/Mark/Mark.const.d.ts +1 -0
- package/dist/components/Mark/Mark.types.d.ts +2 -0
- package/dist/components/Marquee/Marquee.types.d.ts +1 -0
- package/dist/components/Masonry/Masonry.types.d.ts +1 -0
- package/dist/components/MediaPlayer/MediaPlayer.types.d.ts +1 -0
- package/dist/components/MentionsInput/MentionsInput.cjs +1 -1
- package/dist/components/MentionsInput/MentionsInput.const.d.ts +1 -0
- package/dist/components/MentionsInput/MentionsInput.js +114 -92
- package/dist/components/MentionsInput/MentionsInput.types.d.ts +6 -0
- package/dist/components/Menu/Menu.const.d.ts +1 -0
- package/dist/components/Menu/Menu.types.d.ts +1 -0
- package/dist/components/MessageList/MessageList.cjs +1 -0
- package/dist/components/MessageList/MessageList.const.cjs +1 -0
- package/dist/components/MessageList/MessageList.const.d.ts +23 -0
- package/dist/components/MessageList/MessageList.const.js +30 -0
- package/dist/components/MessageList/MessageList.d.ts +19 -0
- package/dist/components/MessageList/MessageList.js +182 -0
- package/dist/components/MessageList/MessageList.types.d.ts +72 -0
- package/dist/components/MessageList/MessageList.utils.cjs +1 -0
- package/dist/components/MessageList/MessageList.utils.d.ts +6 -0
- package/dist/components/MessageList/MessageList.utils.js +35 -0
- package/dist/components/MessageList/index.d.ts +2 -0
- package/dist/components/Modal/Modal.cjs +1 -1
- package/dist/components/Modal/Modal.js +46 -43
- package/dist/components/Modal/Modal.types.d.ts +3 -1
- package/dist/components/MultiSelect/MultiSelect.const.d.ts +1 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +1 -0
- package/dist/components/NavigableSelect/NavigableSelect.types.d.ts +1 -0
- package/dist/components/NotificationCenter/NotificationCenter.types.d.ts +1 -0
- package/dist/components/NumberFormatter/NumberFormatter.types.d.ts +1 -0
- package/dist/components/NumberInput/NumberInput.const.d.ts +1 -0
- package/dist/components/NumberInput/NumberInput.types.d.ts +2 -0
- package/dist/components/OTPInput/OTPInput.types.d.ts +2 -0
- package/dist/components/Overlay/Overlay.const.d.ts +1 -0
- package/dist/components/Overlay/Overlay.types.d.ts +1 -0
- package/dist/components/PageNav/PageNav.types.d.ts +1 -0
- package/dist/components/Pagination/Pagination.const.d.ts +1 -0
- package/dist/components/Pagination/Pagination.types.d.ts +1 -0
- package/dist/components/Paper/Paper.const.d.ts +1 -0
- package/dist/components/Paper/Paper.types.d.ts +1 -0
- package/dist/components/PasswordInput/PasswordInput.const.d.ts +1 -0
- package/dist/components/PasswordInput/PasswordInput.types.d.ts +2 -0
- package/dist/components/PhoneInput/PhoneInput.types.d.ts +1 -0
- package/dist/components/Popconfirm/Popconfirm.types.d.ts +1 -0
- package/dist/components/Popover/Popover.const.d.ts +1 -0
- package/dist/components/Popover/Popover.types.d.ts +2 -0
- package/dist/components/Portal/Portal.const.d.ts +1 -0
- package/dist/components/Progress/Progress.const.d.ts +1 -0
- package/dist/components/Progress/Progress.types.d.ts +1 -0
- package/dist/components/PropsPlayground/PropsPlayground.types.d.ts +1 -0
- package/dist/components/QRCode/QRCode.types.d.ts +1 -0
- package/dist/components/Radio/Radio.cjs +1 -1
- package/dist/components/Radio/Radio.const.d.ts +1 -0
- package/dist/components/Radio/Radio.js +99 -96
- package/dist/components/Radio/Radio.types.d.ts +1 -0
- package/dist/components/RadioCard/RadioCard.types.d.ts +1 -0
- package/dist/components/Rating/Rating.types.d.ts +1 -0
- package/dist/components/ResizablePanel/ResizablePanel.types.d.ts +1 -0
- package/dist/components/ResizableTextarea/ResizableTextarea.types.d.ts +1 -0
- package/dist/components/Result/Result.types.d.ts +1 -0
- package/dist/components/RichEditor/RichEditor.cjs +1 -1
- package/dist/components/RichEditor/RichEditor.js +69 -71
- package/dist/components/RingProgress/RingProgress.types.d.ts +1 -0
- package/dist/components/ScrollArea/ScrollArea.const.d.ts +1 -0
- package/dist/components/ScrollArea/ScrollArea.types.d.ts +2 -0
- package/dist/components/SegmentedControl/SegmentedControl.const.d.ts +1 -0
- package/dist/components/SegmentedControl/SegmentedControl.types.d.ts +2 -0
- package/dist/components/Select/Select.cjs +1 -1
- package/dist/components/Select/Select.const.d.ts +1 -0
- package/dist/components/Select/Select.js +3 -2
- package/dist/components/Select/Select.types.d.ts +6 -1
- package/dist/components/Sidebar/Sidebar.cjs +1 -1
- package/dist/components/Sidebar/Sidebar.js +15 -17
- package/dist/components/SignPad/SignPad.cjs +1 -1
- package/dist/components/SignPad/SignPad.js +24 -26
- package/dist/components/Skeleton/Skeleton.types.d.ts +1 -0
- package/dist/components/Slider/Slider.const.d.ts +1 -0
- package/dist/components/Slider/Slider.types.d.ts +1 -0
- package/dist/components/SliderRange/SliderRange.const.d.ts +1 -0
- package/dist/components/SliderRange/SliderRange.types.d.ts +2 -0
- package/dist/components/Snackbar/Snackbar.cjs +1 -0
- package/dist/components/Snackbar/Snackbar.const.cjs +1 -0
- package/dist/components/Snackbar/Snackbar.const.d.ts +13 -0
- package/dist/components/Snackbar/Snackbar.const.js +18 -0
- package/dist/components/Snackbar/Snackbar.d.ts +2 -0
- package/dist/components/Snackbar/Snackbar.js +114 -0
- package/dist/components/Snackbar/Snackbar.types.d.ts +44 -0
- package/dist/components/Snackbar/hooks/index.d.ts +1 -0
- package/dist/components/Snackbar/hooks/useSnackbar.cjs +1 -0
- package/dist/components/Snackbar/hooks/useSnackbar.d.ts +2 -0
- package/dist/components/Snackbar/hooks/useSnackbar.js +42 -0
- package/dist/components/Snackbar/index.d.ts +3 -0
- package/dist/components/Sparkline/Sparkline.types.d.ts +2 -0
- package/dist/components/SpeedDial/SpeedDial.types.d.ts +1 -0
- package/dist/components/Spinner/Spinner.const.d.ts +1 -0
- package/dist/components/Spinner/Spinner.types.d.ts +2 -0
- package/dist/components/SplitButton/SplitButton.types.d.ts +1 -0
- package/dist/components/Spoiler/Spoiler.types.d.ts +1 -0
- package/dist/components/Spotlight/Spotlight.types.d.ts +1 -0
- package/dist/components/StatCard/StatCard.const.d.ts +1 -0
- package/dist/components/StatCard/StatCard.types.d.ts +2 -0
- package/dist/components/Statistic/Statistic.const.d.ts +1 -0
- package/dist/components/Statistic/Statistic.types.d.ts +2 -0
- package/dist/components/Stepper/Stepper.types.d.ts +1 -0
- package/dist/components/Switch/Switch.cjs +1 -1
- package/dist/components/Switch/Switch.const.cjs +1 -0
- package/dist/components/Switch/Switch.const.d.ts +54 -0
- package/dist/components/Switch/Switch.const.js +37 -0
- package/dist/components/Switch/Switch.d.ts +1 -2
- package/dist/components/Switch/Switch.js +51 -80
- package/dist/components/Switch/Switch.types.d.ts +18 -10
- package/dist/components/Switch/SwitchGroup.cjs +1 -0
- package/dist/components/Switch/SwitchGroup.d.ts +2 -0
- package/dist/components/Switch/SwitchGroup.js +50 -0
- package/dist/components/Switch/index.d.ts +2 -1
- package/dist/components/TableSkeleton/TableSkeleton.cjs +1 -0
- package/dist/components/TableSkeleton/TableSkeleton.const.cjs +1 -0
- package/dist/components/TableSkeleton/TableSkeleton.const.d.ts +6 -0
- package/dist/components/TableSkeleton/TableSkeleton.const.js +9 -0
- package/dist/components/TableSkeleton/TableSkeleton.d.ts +2 -0
- package/dist/components/TableSkeleton/TableSkeleton.js +51 -0
- package/dist/components/TableSkeleton/TableSkeleton.types.d.ts +9 -0
- package/dist/components/TableSkeleton/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.const.d.ts +1 -0
- package/dist/components/Tabs/Tabs.types.d.ts +1 -0
- package/dist/components/TagCloud/TagCloud.types.d.ts +1 -0
- package/dist/components/TagsInput/TagsInput.const.d.ts +1 -0
- package/dist/components/TagsInput/TagsInput.types.d.ts +2 -0
- package/dist/components/Terminal/Terminal.types.d.ts +1 -0
- package/dist/components/ThemeIcon/ThemeIcon.const.d.ts +1 -0
- package/dist/components/ThemeIcon/ThemeIcon.types.d.ts +1 -0
- package/dist/components/TimePicker/TimePicker.types.d.ts +2 -0
- package/dist/components/Timeline/Timeline.cjs +1 -1
- package/dist/components/Timeline/Timeline.const.cjs +1 -1
- package/dist/components/Timeline/Timeline.const.d.ts +21 -0
- package/dist/components/Timeline/Timeline.const.js +41 -20
- package/dist/components/Timeline/Timeline.d.ts +0 -15
- package/dist/components/Timeline/Timeline.js +133 -132
- package/dist/components/Timeline/Timeline.types.d.ts +7 -0
- package/dist/components/TimelineChart/TimelineChart.types.d.ts +1 -0
- package/dist/components/Toast/Toast.cjs +1 -1
- package/dist/components/Toast/Toast.const.d.ts +1 -0
- package/dist/components/Toast/Toast.d.ts +3 -6
- package/dist/components/Toast/Toast.js +82 -76
- package/dist/components/Toast/Toast.types.d.ts +10 -0
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButton.cjs +1 -0
- package/dist/components/ToggleButton/ToggleButton.const.cjs +1 -0
- package/dist/components/ToggleButton/ToggleButton.const.d.ts +6 -0
- package/dist/components/ToggleButton/ToggleButton.const.js +15 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +3 -0
- package/dist/components/ToggleButton/ToggleButton.js +89 -0
- package/dist/components/ToggleButton/ToggleButton.types.d.ts +30 -0
- package/dist/components/ToggleButton/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.const.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +2 -0
- package/dist/components/Tour/Tour.types.d.ts +1 -0
- package/dist/components/TransferList/TransferList.const.d.ts +1 -0
- package/dist/components/TransferList/TransferList.types.d.ts +1 -0
- package/dist/components/Transition/Transition.types.d.ts +1 -0
- package/dist/components/TreeSelect/TreeSelect.cjs +1 -1
- package/dist/components/TreeSelect/TreeSelect.js +22 -22
- package/dist/components/TreeSelect/TreeSelect.types.d.ts +1 -0
- package/dist/components/TreeView/TreeView.const.d.ts +1 -0
- package/dist/components/TreeView/TreeView.types.d.ts +2 -0
- package/dist/components/Typewriter/Typewriter.types.d.ts +1 -0
- package/dist/components/Typography/Typography.types.d.ts +1 -0
- package/dist/components/VirtualList/VirtualList.cjs +1 -1
- package/dist/components/VirtualList/VirtualList.const.cjs +1 -0
- package/dist/components/VirtualList/VirtualList.const.d.ts +2 -0
- package/dist/components/VirtualList/VirtualList.const.js +4 -0
- package/dist/components/VirtualList/VirtualList.js +18 -39
- package/dist/components/VirtualList/VirtualList.types.d.ts +2 -0
- package/dist/components/VisuallyHidden/VisuallyHidden.const.d.ts +1 -0
- package/dist/components/Watermark/Watermark.types.d.ts +1 -0
- package/dist/components/index.cjs +1 -1
- package/dist/components/index.d.ts +18 -3
- package/dist/components/index.js +419 -398
- package/dist/context/BearProvider.cjs +1 -1
- package/dist/context/BearProvider.d.ts +21 -43
- package/dist/context/BearProvider.js +208 -163
- package/dist/context/bearProvider.const.cjs +1 -0
- package/dist/context/bearProvider.const.d.ts +7 -0
- package/dist/context/bearProvider.const.js +8 -0
- package/dist/context/bearProvider.types.d.ts +6 -0
- package/dist/context/index.cjs +1 -1
- package/dist/context/index.d.ts +2 -1
- package/dist/context/index.js +8 -6
- package/dist/hooks/index.cjs +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +31 -27
- package/dist/hooks/useBearComponent/useBearComponent.cjs +1 -1
- package/dist/hooks/useBearComponent/useBearComponent.js +45 -44
- package/dist/hooks/useBearDefaultProps.cjs +1 -0
- package/dist/hooks/useBearDefaultProps.d.ts +2 -0
- package/dist/hooks/useBearDefaultProps.js +8 -0
- package/dist/hooks/useFormControl/index.d.ts +1 -0
- package/dist/hooks/useFormControl/useFormControl.cjs +1 -0
- package/dist/hooks/useFormControl/useFormControl.d.ts +2 -0
- package/dist/hooks/useFormControl/useFormControl.js +6 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +519 -480
- package/dist/styles/_message-list.css +42 -0
- package/dist/styles/main.css +1 -0
- package/dist/styles.css +72 -21
- package/dist/types/base.types.d.ts +5 -0
- package/dist/types/component.types.d.ts +5 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/generateBearId.const.cjs +1 -0
- package/dist/utils/generateBearId.const.d.ts +5 -0
- package/dist/utils/generateBearId.const.js +8 -0
- package/dist/utils/generateBearId.types.d.ts +4 -0
- package/dist/utils/generateBearId.utils.cjs +1 -0
- package/dist/utils/generateBearId.utils.d.ts +4 -0
- package/dist/utils/generateBearId.utils.js +29 -0
- package/dist/utils/getResponsiveClass.utils.cjs +1 -0
- package/dist/utils/getResponsiveClass.utils.d.ts +2 -0
- package/dist/utils/getResponsiveClass.utils.js +12 -0
- package/dist/utils/index.cjs +1 -1
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.js +19 -5
- package/dist/utils/useBearId.cjs +1 -0
- package/dist/utils/useBearId.d.ts +1 -0
- package/dist/utils/useBearId.js +15 -0
- package/package.json +15 -2
- package/dist/components/Toast/Toast.utils.cjs +0 -1
- package/dist/components/Toast/Toast.utils.js +0 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsxs as S, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
2
|
+
import { useRef as Ee, useState as C, useEffect as x, useCallback as d } from "react";
|
|
3
3
|
import { cn as p } from "../../utils/cn.js";
|
|
4
|
-
import { getActiveFormats as
|
|
5
|
-
import { RICH_EDITOR_MIN_HEIGHT as
|
|
6
|
-
import { useMediaQuery as
|
|
4
|
+
import { getActiveFormats as ye, queryCommandValue as Le, execCommand as u, insertLink as xe, setTextColor as B, setHighlightColor as D, fileToDataUrl as N, insertImage as F } from "./helpers/formatHelpers.js";
|
|
5
|
+
import { RICH_EDITOR_MIN_HEIGHT as He, RICH_EDITOR_DEFAULT_TOOLBAR as Oe, RICH_EDITOR_CONTENT_STYLES as ke, RICH_EDITOR_BUTTON_CONFIG as M, RICH_EDITOR_MOBILE_TOOLBAR as ze, RICH_EDITOR_TOOLBAR_CLASSES as ve, RICH_EDITOR_CONTENT_CLASSES as Ae, RICH_EDITOR_ROOT_CLASSES as Se, RICH_EDITOR_DIVIDER_CLASSES as Be, RICH_EDITOR_HEADING_OPTIONS as De, RICH_EDITOR_MOBILE_MORE_ITEMS as Ne, RICH_EDITOR_MOBILE_BREAKPOINT as Fe } from "./RichEditor.const.js";
|
|
6
|
+
import { useMediaQuery as Me } from "../../hooks/useMediaQuery.js";
|
|
7
7
|
import { ToolbarButton as f } from "./components/ToolbarButton/ToolbarButton.js";
|
|
8
|
-
import { ToolbarDropdown as
|
|
8
|
+
import { ToolbarDropdown as we } from "./components/ToolbarDropdown/ToolbarDropdown.js";
|
|
9
9
|
import { ToolbarColorPicker as w } from "./components/ToolbarColorPicker/ToolbarColorPicker.js";
|
|
10
|
-
import { ToolbarMore as
|
|
11
|
-
import { TextIcon as
|
|
12
|
-
const
|
|
10
|
+
import { ToolbarMore as Ue } from "./components/ToolbarMore/ToolbarMore.js";
|
|
11
|
+
import { TextIcon as Ve, InsertLinkIcon as U, InsertPhotoIcon as V, AlignLeftIcon as P, AlignCenterIcon as j, AlignRightIcon as J, AlignJustifyIcon as $, IndentIncreaseIcon as q, IndentDecreaseIcon as G, FormatClearIcon as K, TableIcon as Pe, CodeIcon as je, QuoteIcon as Je, ListNumberedIcon as $e, ListBulletIcon as qe, Heading3Icon as Ge, Heading2Icon as Ke, Heading1Icon as Qe, StrikethroughIcon as Ye, UnderlineIcon as We, ItalicIcon as Xe, BoldIcon as Ze } from "../Icon/icons/editor.js";
|
|
12
|
+
const et = 6, ft = (Q) => {
|
|
13
13
|
const {
|
|
14
14
|
value: I,
|
|
15
15
|
defaultValue: H = "",
|
|
@@ -17,22 +17,21 @@ const tt = 6, gt = (Q) => {
|
|
|
17
17
|
placeholder: Y = "Start typing...",
|
|
18
18
|
disabled: r = !1,
|
|
19
19
|
readOnly: o = !1,
|
|
20
|
-
minHeight: T =
|
|
20
|
+
minHeight: T = He,
|
|
21
21
|
maxHeight: m,
|
|
22
|
-
toolbar: W =
|
|
22
|
+
toolbar: W = Oe,
|
|
23
23
|
className: X = "",
|
|
24
24
|
testId: Z,
|
|
25
|
-
id: ee,
|
|
26
25
|
allowImagePaste: O = !0,
|
|
27
26
|
showCharCount: _ = !1,
|
|
28
27
|
charCountMax: E,
|
|
29
|
-
...
|
|
30
|
-
} = Q, l =
|
|
28
|
+
...ee
|
|
29
|
+
} = Q, l = Ee(null), y = Me(`(max-width: ${Fe}px)`), k = y ? ze : W, [te, ne] = C(/* @__PURE__ */ new Set()), [re, z] = C("p"), [v, oe] = C(0), [ie, ae] = C("#000000"), [le, se] = C("#fef08a"), [ce, de] = C([]), [ue, fe] = C([]);
|
|
31
30
|
x(() => {
|
|
32
31
|
const e = "bear-rich-editor-styles";
|
|
33
32
|
if (!document.getElementById(e)) {
|
|
34
33
|
const n = document.createElement("style");
|
|
35
|
-
n.id = e, n.textContent =
|
|
34
|
+
n.id = e, n.textContent = ke, document.head.appendChild(n);
|
|
36
35
|
}
|
|
37
36
|
}, []), x(() => {
|
|
38
37
|
l.current && I !== void 0 && l.current.innerHTML !== I && (l.current.innerHTML = I);
|
|
@@ -40,13 +39,13 @@ const tt = 6, gt = (Q) => {
|
|
|
40
39
|
l.current && H && !I && (l.current.innerHTML = H);
|
|
41
40
|
}, []);
|
|
42
41
|
const h = d(() => {
|
|
43
|
-
|
|
44
|
-
const e =
|
|
42
|
+
ne(ye());
|
|
43
|
+
const e = Le("formatBlock");
|
|
45
44
|
e && z(e.toLowerCase().replace(/[<>]/g, ""));
|
|
46
45
|
}, []), a = d(() => {
|
|
47
46
|
var e;
|
|
48
|
-
l.current && (R && R(l.current.innerHTML), _ &&
|
|
49
|
-
}, [R, h, _]),
|
|
47
|
+
l.current && (R && R(l.current.innerHTML), _ && oe(((e = l.current.textContent) == null ? void 0 : e.length) ?? 0)), h();
|
|
48
|
+
}, [R, h, _]), ge = d((e) => {
|
|
50
49
|
var s;
|
|
51
50
|
if (r || o) return;
|
|
52
51
|
(s = l.current) == null || s.focus();
|
|
@@ -54,33 +53,33 @@ const tt = 6, gt = (Q) => {
|
|
|
54
53
|
if (!n) return;
|
|
55
54
|
const c = "value" in n ? n.value : void 0;
|
|
56
55
|
c ? u(n.command, c) : u(n.command), h(), a();
|
|
57
|
-
}, [r, o, h, a]),
|
|
56
|
+
}, [r, o, h, a]), he = d((e) => {
|
|
58
57
|
var n;
|
|
59
58
|
r || o || ((n = l.current) == null || n.focus(), u("formatBlock", e), z(e), a());
|
|
60
|
-
}, [r, o, a]),
|
|
59
|
+
}, [r, o, a]), Ce = d(() => {
|
|
61
60
|
var s;
|
|
62
61
|
if (r || o) return;
|
|
63
62
|
const e = window.getSelection(), n = e && e.toString().length > 0, c = prompt("Enter URL:", n ? "" : "https://");
|
|
64
|
-
c && ((s = l.current) == null || s.focus(),
|
|
63
|
+
c && ((s = l.current) == null || s.focus(), xe(c), a());
|
|
65
64
|
}, [r, o, a]), b = d((e, n) => {
|
|
66
65
|
if (!e) return;
|
|
67
|
-
(n === "text" ?
|
|
66
|
+
(n === "text" ? de : fe)((s) => {
|
|
68
67
|
const i = s.filter((g) => g !== e);
|
|
69
|
-
return [e, ...i].slice(0,
|
|
68
|
+
return [e, ...i].slice(0, et);
|
|
70
69
|
});
|
|
71
|
-
}, []),
|
|
70
|
+
}, []), Ie = d((e) => {
|
|
72
71
|
var n;
|
|
73
|
-
r || o || ((n = l.current) == null || n.focus(), B(e),
|
|
74
|
-
}, [r, o, a, b]),
|
|
72
|
+
r || o || ((n = l.current) == null || n.focus(), B(e), ae(e), b(e, "text"), a());
|
|
73
|
+
}, [r, o, a, b]), me = d((e) => {
|
|
75
74
|
var n;
|
|
76
|
-
r || o || ((n = l.current) == null || n.focus(), D(e),
|
|
77
|
-
}, [r, o, a, b]),
|
|
75
|
+
r || o || ((n = l.current) == null || n.focus(), D(e), se(e), b(e, "highlight"), a());
|
|
76
|
+
}, [r, o, a, b]), pe = d((e) => {
|
|
78
77
|
var n;
|
|
79
78
|
r || o || ((n = l.current) == null || n.focus(), B(e), a());
|
|
80
|
-
}, [r, o, a]),
|
|
79
|
+
}, [r, o, a]), be = d((e) => {
|
|
81
80
|
var n;
|
|
82
81
|
r || o || ((n = l.current) == null || n.focus(), D(e), a());
|
|
83
|
-
}, [r, o, a]),
|
|
82
|
+
}, [r, o, a]), Re = d(async (e) => {
|
|
84
83
|
var c;
|
|
85
84
|
if (!O) return;
|
|
86
85
|
const n = (c = e.clipboardData) == null ? void 0 : c.items;
|
|
@@ -97,7 +96,7 @@ const tt = 6, gt = (Q) => {
|
|
|
97
96
|
return;
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
|
-
}, [O, a]),
|
|
99
|
+
}, [O, a]), Te = d(() => {
|
|
101
100
|
if (r || o) return;
|
|
102
101
|
const e = document.createElement("input");
|
|
103
102
|
e.type = "file", e.accept = "image/*", e.onchange = async (n) => {
|
|
@@ -108,18 +107,18 @@ const tt = 6, gt = (Q) => {
|
|
|
108
107
|
(i = l.current) == null || i.focus(), F(g), a();
|
|
109
108
|
}
|
|
110
109
|
}, e.click();
|
|
111
|
-
}, [r, o, a]),
|
|
112
|
-
bold: /* @__PURE__ */ t(
|
|
113
|
-
italic: /* @__PURE__ */ t(
|
|
114
|
-
underline: /* @__PURE__ */ t(
|
|
115
|
-
strikethrough: /* @__PURE__ */ t(
|
|
116
|
-
heading1: /* @__PURE__ */ t(
|
|
117
|
-
heading2: /* @__PURE__ */ t(
|
|
118
|
-
heading3: /* @__PURE__ */ t(
|
|
119
|
-
bulletList: /* @__PURE__ */ t(
|
|
120
|
-
orderedList: /* @__PURE__ */ t(
|
|
121
|
-
blockquote: /* @__PURE__ */ t(
|
|
122
|
-
code: /* @__PURE__ */ t(
|
|
110
|
+
}, [r, o, a]), _e = {
|
|
111
|
+
bold: /* @__PURE__ */ t(Ze, { size: 16 }),
|
|
112
|
+
italic: /* @__PURE__ */ t(Xe, { size: 16 }),
|
|
113
|
+
underline: /* @__PURE__ */ t(We, { size: 16 }),
|
|
114
|
+
strikethrough: /* @__PURE__ */ t(Ye, { size: 16 }),
|
|
115
|
+
heading1: /* @__PURE__ */ t(Qe, { size: 16 }),
|
|
116
|
+
heading2: /* @__PURE__ */ t(Ke, { size: 16 }),
|
|
117
|
+
heading3: /* @__PURE__ */ t(Ge, { size: 16 }),
|
|
118
|
+
bulletList: /* @__PURE__ */ t(qe, { size: 16 }),
|
|
119
|
+
orderedList: /* @__PURE__ */ t($e, { size: 16 }),
|
|
120
|
+
blockquote: /* @__PURE__ */ t(Je, { size: 16 }),
|
|
121
|
+
code: /* @__PURE__ */ t(je, { size: 16 }),
|
|
123
122
|
link: /* @__PURE__ */ t(U, { size: 16 }),
|
|
124
123
|
alignLeft: /* @__PURE__ */ t(P, { size: 16 }),
|
|
125
124
|
alignCenter: /* @__PURE__ */ t(j, { size: 16 }),
|
|
@@ -129,20 +128,20 @@ const tt = 6, gt = (Q) => {
|
|
|
129
128
|
indent: /* @__PURE__ */ t(q, { size: 16 }),
|
|
130
129
|
outdent: /* @__PURE__ */ t(G, { size: 16 }),
|
|
131
130
|
clearFormat: /* @__PURE__ */ t(K, { size: 16 }),
|
|
132
|
-
table: /* @__PURE__ */ t(
|
|
131
|
+
table: /* @__PURE__ */ t(Pe, { size: 16 })
|
|
133
132
|
}, A = (e, n) => {
|
|
134
133
|
if (e === "divider")
|
|
135
|
-
return /* @__PURE__ */ t("div", { className: p("Bear-RichEditor__divider",
|
|
134
|
+
return /* @__PURE__ */ t("div", { className: p("Bear-RichEditor__divider", Be) }, `divider-${n}`);
|
|
136
135
|
if (e === "headingDropdown")
|
|
137
136
|
return /* @__PURE__ */ t(
|
|
138
|
-
|
|
137
|
+
we,
|
|
139
138
|
{
|
|
140
|
-
options:
|
|
141
|
-
value:
|
|
142
|
-
onChange:
|
|
139
|
+
options: De,
|
|
140
|
+
value: re,
|
|
141
|
+
onChange: he,
|
|
143
142
|
title: "Text Style",
|
|
144
143
|
disabled: r || o,
|
|
145
|
-
icon: /* @__PURE__ */ t(
|
|
144
|
+
icon: /* @__PURE__ */ t(Ve, { size: 16 })
|
|
146
145
|
},
|
|
147
146
|
"heading-dropdown"
|
|
148
147
|
);
|
|
@@ -150,13 +149,13 @@ const tt = 6, gt = (Q) => {
|
|
|
150
149
|
return /* @__PURE__ */ t(
|
|
151
150
|
w,
|
|
152
151
|
{
|
|
153
|
-
value:
|
|
154
|
-
onChange:
|
|
152
|
+
value: ie,
|
|
153
|
+
onChange: Ie,
|
|
155
154
|
title: "Text Color",
|
|
156
155
|
disabled: r || o,
|
|
157
156
|
type: "text",
|
|
158
|
-
recentColors:
|
|
159
|
-
onApplyLast:
|
|
157
|
+
recentColors: ce,
|
|
158
|
+
onApplyLast: pe
|
|
160
159
|
},
|
|
161
160
|
"text-color"
|
|
162
161
|
);
|
|
@@ -164,13 +163,13 @@ const tt = 6, gt = (Q) => {
|
|
|
164
163
|
return /* @__PURE__ */ t(
|
|
165
164
|
w,
|
|
166
165
|
{
|
|
167
|
-
value:
|
|
168
|
-
onChange:
|
|
166
|
+
value: le,
|
|
167
|
+
onChange: me,
|
|
169
168
|
title: "Highlight Color",
|
|
170
169
|
disabled: r || o,
|
|
171
170
|
type: "highlight",
|
|
172
|
-
recentColors:
|
|
173
|
-
onApplyLast:
|
|
171
|
+
recentColors: ue,
|
|
172
|
+
onApplyLast: be
|
|
174
173
|
},
|
|
175
174
|
"highlight-color"
|
|
176
175
|
);
|
|
@@ -180,7 +179,7 @@ const tt = 6, gt = (Q) => {
|
|
|
180
179
|
{
|
|
181
180
|
icon: /* @__PURE__ */ t(U, { size: 16 }),
|
|
182
181
|
title: "Insert Link",
|
|
183
|
-
onClick:
|
|
182
|
+
onClick: Ce,
|
|
184
183
|
disabled: r || o
|
|
185
184
|
},
|
|
186
185
|
"link"
|
|
@@ -191,7 +190,7 @@ const tt = 6, gt = (Q) => {
|
|
|
191
190
|
{
|
|
192
191
|
icon: /* @__PURE__ */ t(V, { size: 16 }),
|
|
193
192
|
title: "Insert Image",
|
|
194
|
-
onClick:
|
|
193
|
+
onClick: Te,
|
|
195
194
|
disabled: r || o
|
|
196
195
|
},
|
|
197
196
|
"image"
|
|
@@ -295,7 +294,7 @@ const tt = 6, gt = (Q) => {
|
|
|
295
294
|
"clearFormat"
|
|
296
295
|
);
|
|
297
296
|
if (e === "more")
|
|
298
|
-
return /* @__PURE__ */ t(
|
|
297
|
+
return /* @__PURE__ */ t(Ue, { disabled: r || o, isMobile: y, children: (y ? Ne : [
|
|
299
298
|
"alignLeft",
|
|
300
299
|
"alignCenter",
|
|
301
300
|
"alignRight",
|
|
@@ -306,14 +305,14 @@ const tt = 6, gt = (Q) => {
|
|
|
306
305
|
"code",
|
|
307
306
|
"clearFormat"
|
|
308
307
|
]).map((g, L) => A(g, L + 1e3)) }, "more");
|
|
309
|
-
const c = M[e], s =
|
|
308
|
+
const c = M[e], s = _e[e];
|
|
310
309
|
return !c || !s ? null : /* @__PURE__ */ t(
|
|
311
310
|
f,
|
|
312
311
|
{
|
|
313
312
|
icon: s,
|
|
314
313
|
title: c.title,
|
|
315
|
-
active:
|
|
316
|
-
onClick: () =>
|
|
314
|
+
active: te.has(e),
|
|
315
|
+
onClick: () => ge(e),
|
|
317
316
|
disabled: r || o
|
|
318
317
|
},
|
|
319
318
|
e
|
|
@@ -322,18 +321,17 @@ const tt = 6, gt = (Q) => {
|
|
|
322
321
|
return /* @__PURE__ */ S(
|
|
323
322
|
"div",
|
|
324
323
|
{
|
|
325
|
-
id: ee,
|
|
326
324
|
"data-testid": Z,
|
|
327
325
|
className: p(
|
|
328
326
|
"Bear-RichEditor",
|
|
329
|
-
|
|
327
|
+
Se,
|
|
330
328
|
r && "Bear-RichEditor--disabled",
|
|
331
329
|
o && "Bear-RichEditor--readonly",
|
|
332
330
|
X
|
|
333
331
|
),
|
|
334
|
-
...
|
|
332
|
+
...ee,
|
|
335
333
|
children: [
|
|
336
|
-
k.length > 0 && /* @__PURE__ */ t("div", { className: p("Bear-RichEditor__toolbar",
|
|
334
|
+
k.length > 0 && /* @__PURE__ */ t("div", { className: p("Bear-RichEditor__toolbar", ve), children: k.map((e, n) => A(e, n)) }),
|
|
337
335
|
/* @__PURE__ */ t(
|
|
338
336
|
"div",
|
|
339
337
|
{
|
|
@@ -343,11 +341,11 @@ const tt = 6, gt = (Q) => {
|
|
|
343
341
|
onSelect: h,
|
|
344
342
|
onKeyUp: h,
|
|
345
343
|
onMouseUp: h,
|
|
346
|
-
onPaste:
|
|
344
|
+
onPaste: Re,
|
|
347
345
|
"data-placeholder": Y,
|
|
348
346
|
className: p(
|
|
349
347
|
"Bear-RichEditor__content",
|
|
350
|
-
|
|
348
|
+
Ae,
|
|
351
349
|
"[&:empty]:before:bear-content-[attr(data-placeholder)] [&:empty]:before:bear-text-gray-400 [&:empty]:before:bear-pointer-events-none",
|
|
352
350
|
r && "Bear-RichEditor__content--disabled bear-opacity-50 bear-cursor-not-allowed"
|
|
353
351
|
),
|
|
@@ -377,5 +375,5 @@ const tt = 6, gt = (Q) => {
|
|
|
377
375
|
);
|
|
378
376
|
};
|
|
379
377
|
export {
|
|
380
|
-
|
|
378
|
+
ft as RichEditor
|
|
381
379
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const S_C_R_O_L_L_A_R_E_A_ROOT_CLASS = "Bear-ScrollArea";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const S_E_G_M_E_N_T_E_D_C_O_N_T_R_O_L_ROOT_CLASS = "Bear-SegmentedControl";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),o=require("../../utils/cn.cjs"),S=require("../../hooks/useClickOutside.cjs");require("../../context/BearProvider.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");const g=require("../Icon/index.cjs"),R=require("../Portal/Portal.cjs"),E={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},P=({options:x,value:s,onChange:n,placeholder:y="Select an option",label:m,error:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),t=require("react"),o=require("../../utils/cn.cjs"),S=require("../../hooks/useClickOutside.cjs");require("../../context/BearProvider.cjs");require("../../hooks/useBearComponent/useBearComponent.cjs");require("../FormControl/FormControl.context.cjs");const g=require("../Icon/index.cjs"),R=require("../Portal/Portal.cjs"),E={sm:"bear-h-8 bear-text-sm bear-px-3",md:"bear-h-10 bear-text-base bear-px-4",lg:"bear-h-12 bear-text-lg bear-px-5"},P=({options:x,value:s,onChange:n,placeholder:y="Select an option",label:m,error:i,disabled:d=!1,size:j="md",fullWidth:k=!1,className:p})=>{const[a,c]=t.useState(!1),[u,q]=t.useState({top:0,left:0,width:0}),f=t.useRef(null),v=t.useRef(null),w=!!i,l=x.find(e=>e.value===s),C=t.useCallback(()=>c(!1),[]);S.useClickOutsideMultiple([f,v],C,{enabled:a});const N=e=>{n==null||n(e),c(!1)};return t.useEffect(()=>{if(!a)return;const e=()=>{var h;const b=(h=f.current)==null?void 0:h.getBoundingClientRect();b&&q({top:b.bottom+4,left:Math.max(8,Math.min(b.left,window.innerWidth-b.width-8)),width:b.width})};return e(),window.addEventListener("resize",e),window.addEventListener("scroll",e,!0),()=>{window.removeEventListener("resize",e),window.removeEventListener("scroll",e,!0)}},[a]),r.jsxs("div",{ref:f,className:o.cn("bear-relative bear-flex bear-flex-col bear-gap-1.5",k&&"bear-w-full"),children:[m&&r.jsx("label",{className:"bear-text-sm bear-font-medium",style:{color:"var(--bear-text-secondary)"},children:m}),r.jsxs("button",{type:"button",disabled:d,onClick:()=>!d&&c(!a),className:o.cn("bear-flex bear-items-center bear-justify-between bear-w-full","bear-rounded-lg bear-border bear-text-left bear-outline-none bear-transition-all bear-duration-200","focus:bear-ring-2 focus:bear-ring-offset-2 focus:bear-ring-offset-[var(--bear-bg-primary)]",w?"bear-border-red-500 focus:bear-ring-red-500":"focus:bear-border-bear-500 focus:bear-ring-bear-500 dark:focus:bear-border-bear-500 dark:focus:bear-ring-bear-500",d&&"bear-opacity-50 bear-cursor-not-allowed",E[j],p),style:{backgroundColor:"var(--bear-bg-primary)",borderColor:w?void 0:"var(--bear-border-default)",color:l?"var(--bear-text-primary)":"var(--bear-text-muted)"},children:[r.jsx("span",{children:(l==null?void 0:l.label)||y}),r.jsx(g.ChevronDownIcon,{className:o.cn("bear-w-4 bear-h-4 bear-shrink-0 bear-transition-transform",a&&"bear-rotate-180"),style:{color:"var(--bear-text-muted)"}})]}),a&&r.jsx(R.Portal,{children:r.jsx("div",{ref:v,className:"bear-fixed bear-rounded-lg bear-border bear-shadow-lg bear-overflow-hidden",style:{backgroundColor:"var(--bear-bg-primary)",borderColor:"var(--bear-border-default)",top:u.top,left:u.left,width:u.width,zIndex:1e4},children:r.jsx("div",{className:"bear-max-h-60 bear-overflow-y-auto",children:x.map(e=>r.jsxs("button",{type:"button",disabled:e.disabled,onClick:()=>!e.disabled&&N(e.value),className:o.cn("bear-flex bear-items-center bear-justify-between bear-w-full bear-px-4 bear-py-2","bear-text-left bear-transition-colors",e.disabled&&"bear-cursor-not-allowed",e.value===s&&"bear-bg-bear-100 bear-text-bear-700 dark:bear-bg-bear-600/20 dark:bear-text-bear-300",!e.disabled&&e.value!==s&&"hover:bear-bg-[var(--bear-bg-tertiary)]"),style:e.disabled?{color:"var(--bear-text-muted)"}:e.value===s?void 0:{color:"var(--bear-text-secondary)"},children:[e.label,e.value===s&&r.jsx(g.CheckIcon,{className:"bear-w-4 bear-h-4 bear-shrink-0 bear-text-bear-600 dark:bear-text-bear-400"})]},e.value))})})}),i&&r.jsx("p",{className:"bear-text-sm bear-text-red-500",children:i})]})};exports.Select=P;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const S_E_L_E_C_T_ROOT_CLASS = "Bear-Select";
|
|
@@ -4,13 +4,14 @@ import { cn as o } from "../../utils/cn.js";
|
|
|
4
4
|
import { useClickOutsideMultiple as M } from "../../hooks/useClickOutside.js";
|
|
5
5
|
import "../../context/BearProvider.js";
|
|
6
6
|
import "../../hooks/useBearComponent/useBearComponent.js";
|
|
7
|
+
import "../FormControl/FormControl.context.js";
|
|
7
8
|
import { ChevronDownIcon as P, CheckIcon as R } from "../Icon/index.js";
|
|
8
9
|
import { Portal as S } from "../Portal/Portal.js";
|
|
9
10
|
const B = {
|
|
10
11
|
sm: "bear-h-8 bear-text-sm bear-px-3",
|
|
11
12
|
md: "bear-h-10 bear-text-base bear-px-4",
|
|
12
13
|
lg: "bear-h-12 bear-text-lg bear-px-5"
|
|
13
|
-
},
|
|
14
|
+
}, K = ({
|
|
14
15
|
options: m,
|
|
15
16
|
value: t,
|
|
16
17
|
onChange: s,
|
|
@@ -122,5 +123,5 @@ const B = {
|
|
|
122
123
|
);
|
|
123
124
|
};
|
|
124
125
|
export {
|
|
125
|
-
|
|
126
|
+
K as Select
|
|
126
127
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export interface SelectOption {
|
|
2
3
|
value: string;
|
|
3
4
|
label: string;
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export interface SelectProps {
|
|
8
|
+
testId?: string;
|
|
9
|
+
id?: string;
|
|
7
10
|
/** Select options */
|
|
8
11
|
options: SelectOption[];
|
|
9
12
|
/** Current value */
|
|
@@ -22,6 +25,8 @@ export interface SelectProps {
|
|
|
22
25
|
size?: 'sm' | 'md' | 'lg';
|
|
23
26
|
/** Whether select is full width */
|
|
24
27
|
fullWidth?: boolean;
|
|
25
|
-
|
|
28
|
+
displayEmpty?: boolean;
|
|
29
|
+
renderValue?: (value: string) => ReactNode;
|
|
30
|
+
native?: boolean;
|
|
26
31
|
className?: string;
|
|
27
32
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs");require("react");const t=require("../Icon/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),i=require("../../utils/cn.cjs");require("react");const t=require("../Icon/index.cjs"),D=require("./components/SidebarItem/SidebarItem.cjs"),a=require("./Sidebar.const.cjs"),p=S=>{const{items:b,collapsed:r=!1,onCollapsedChange:o,width:_=a.SIDEBAR_WIDTH,collapsedWidth:I=a.SIDEBAR_COLLAPSED_WIDTH,header:d,footer:c,showHeader:E=!0,activeItemId:h,onItemClick:u,activeVariant:f="fill",fullHeight:A=!1,variant:s="default",position:l="left",className:C,style:x,testId:B}=S,R=r?I:_,m=l==="left"?"bear-border-r":"bear-border-l",v=E&&d;return e.jsxs("aside",{"data-testid":B,className:i.cn("Bear-Sidebar",`Bear-Sidebar--${s}`,r&&"Bear-Sidebar--collapsed","bear-flex bear-flex-col bear-h-full bear-transition-all bear-duration-300",A&&"bear-min-h-full",s==="default"&&m,a.SIDEBAR_VARIANT_STYLES[s],C),style:{width:R,...x},children:[v&&e.jsxs("div",{className:i.cn("Bear-Sidebar__header",a.SIDEBAR_HEADER_CLASSES),children:[!r&&d,o&&e.jsx("button",{type:"button",onClick:()=>o(!r),className:i.cn("Bear-Sidebar__toggle",a.SIDEBAR_TOGGLE_CLASSES),"aria-label":r?"Expand sidebar":"Collapse sidebar",children:r?l==="left"?e.jsx(t.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(t.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):l==="left"?e.jsx(t.ChevronLeftIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE}):e.jsx(t.ChevronRightIcon,{size:a.SIDEBAR_TOGGLE_ICON_SIZE})})]}),e.jsx("nav",{className:"Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0",children:b.map(n=>e.jsx(D.SidebarItem,{item:n,isActive:n.id===h,collapsed:r,onClick:u,activeVariant:f},n.id))}),c&&e.jsx("div",{className:i.cn("Bear-Sidebar__footer",a.SIDEBAR_FOOTER_CLASSES),children:r?null:c})]})};exports.Sidebar=p;
|
|
@@ -2,15 +2,15 @@ import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn as r } from "../../utils/cn.js";
|
|
3
3
|
import "react";
|
|
4
4
|
import { ChevronRightIcon as c, ChevronLeftIcon as S } from "../Icon/index.js";
|
|
5
|
-
import { SidebarItem as
|
|
6
|
-
import { SIDEBAR_WIDTH as
|
|
7
|
-
const
|
|
5
|
+
import { SidebarItem as x } from "./components/SidebarItem/SidebarItem.js";
|
|
6
|
+
import { SIDEBAR_WIDTH as N, SIDEBAR_COLLAPSED_WIDTH as T, SIDEBAR_TOGGLE_ICON_SIZE as i, SIDEBAR_TOGGLE_CLASSES as y, SIDEBAR_HEADER_CLASSES as H, SIDEBAR_FOOTER_CLASSES as O, SIDEBAR_VARIANT_STYLES as g } from "./Sidebar.const.js";
|
|
7
|
+
const V = (f) => {
|
|
8
8
|
const {
|
|
9
9
|
items: m,
|
|
10
10
|
collapsed: e = !1,
|
|
11
11
|
onCollapsedChange: d,
|
|
12
|
-
width: _ =
|
|
13
|
-
collapsedWidth: h =
|
|
12
|
+
width: _ = N,
|
|
13
|
+
collapsedWidth: h = T,
|
|
14
14
|
header: s,
|
|
15
15
|
footer: n,
|
|
16
16
|
showHeader: p = !0,
|
|
@@ -22,13 +22,11 @@ const F = (f) => {
|
|
|
22
22
|
position: t = "left",
|
|
23
23
|
className: u,
|
|
24
24
|
style: C,
|
|
25
|
-
testId: v
|
|
26
|
-
|
|
27
|
-
} = f, R = e ? h : _, L = t === "left" ? "bear-border-r" : "bear-border-l", x = p && s;
|
|
25
|
+
testId: v
|
|
26
|
+
} = f, D = e ? h : _, R = t === "left" ? "bear-border-r" : "bear-border-l", L = p && s;
|
|
28
27
|
return /* @__PURE__ */ b(
|
|
29
28
|
"aside",
|
|
30
29
|
{
|
|
31
|
-
id: D,
|
|
32
30
|
"data-testid": v,
|
|
33
31
|
className: r(
|
|
34
32
|
"Bear-Sidebar",
|
|
@@ -36,27 +34,27 @@ const F = (f) => {
|
|
|
36
34
|
e && "Bear-Sidebar--collapsed",
|
|
37
35
|
"bear-flex bear-flex-col bear-h-full bear-transition-all bear-duration-300",
|
|
38
36
|
B && "bear-min-h-full",
|
|
39
|
-
l === "default" &&
|
|
40
|
-
|
|
37
|
+
l === "default" && R,
|
|
38
|
+
g[l],
|
|
41
39
|
u
|
|
42
40
|
),
|
|
43
|
-
style: { width:
|
|
41
|
+
style: { width: D, ...C },
|
|
44
42
|
children: [
|
|
45
|
-
|
|
43
|
+
L && /* @__PURE__ */ b("div", { className: r("Bear-Sidebar__header", H), children: [
|
|
46
44
|
!e && s,
|
|
47
45
|
d && /* @__PURE__ */ a(
|
|
48
46
|
"button",
|
|
49
47
|
{
|
|
50
48
|
type: "button",
|
|
51
49
|
onClick: () => d(!e),
|
|
52
|
-
className: r("Bear-Sidebar__toggle",
|
|
50
|
+
className: r("Bear-Sidebar__toggle", y),
|
|
53
51
|
"aria-label": e ? "Expand sidebar" : "Collapse sidebar",
|
|
54
52
|
children: e ? t === "left" ? /* @__PURE__ */ a(c, { size: i }) : /* @__PURE__ */ a(S, { size: i }) : t === "left" ? /* @__PURE__ */ a(S, { size: i }) : /* @__PURE__ */ a(c, { size: i })
|
|
55
53
|
}
|
|
56
54
|
)
|
|
57
55
|
] }),
|
|
58
56
|
/* @__PURE__ */ a("nav", { className: "Bear-Sidebar__nav bear-flex-1 bear-overflow-y-auto bear-px-2 bear-py-3 bear-space-y-1 bear-min-h-0", children: m.map((o) => /* @__PURE__ */ a(
|
|
59
|
-
|
|
57
|
+
x,
|
|
60
58
|
{
|
|
61
59
|
item: o,
|
|
62
60
|
isActive: o.id === E,
|
|
@@ -66,11 +64,11 @@ const F = (f) => {
|
|
|
66
64
|
},
|
|
67
65
|
o.id
|
|
68
66
|
)) }),
|
|
69
|
-
n && /* @__PURE__ */ a("div", { className: r("Bear-Sidebar__footer",
|
|
67
|
+
n && /* @__PURE__ */ a("div", { className: r("Bear-Sidebar__footer", O), children: e ? null : n })
|
|
70
68
|
]
|
|
71
69
|
}
|
|
72
70
|
);
|
|
73
71
|
};
|
|
74
72
|
export {
|
|
75
|
-
|
|
73
|
+
V as Sidebar
|
|
76
74
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),r=require("react"),S=require("../../utils/cn.cjs"),y=require("../Button/Button.cjs"),s=require("./SignPad.const.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),r=require("react"),S=require("../../utils/cn.cjs"),y=require("../Button/Button.cjs"),s=require("./SignPad.const.cjs"),Y=B=>{const{onChange:o,width:p,height:D=s.SIGN_PAD_DEFAULT_HEIGHT,strokeColor:O,strokeWidth:T=s.SIGN_PAD_DEFAULT_STROKE_WIDTH,backgroundColor:M,placeholder:U=s.SIGN_PAD_DEFAULT_PLACEHOLDER,disabled:a=!1,readOnly:c=!1,showClear:N=!0,showSave:m=!1,clearText:j="Clear",saveText:F="Save",outputFormat:P=s.SIGN_PAD_DEFAULT_OUTPUT_FORMAT,outputQuality:v=s.SIGN_PAD_DEFAULT_OUTPUT_QUALITY,className:H,testId:K,...q}=B,i=r.useRef(null),w=r.useRef(null),A=r.useRef(null),g=r.useRef(!1),[h,L]=r.useState(!1),[E,W]=r.useState(!1);r.useEffect(()=>{const e=()=>{W(document.documentElement.classList.contains("dark"))};e();const t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]);const k=O||(E?s.SIGN_PAD_STROKE_DARK:s.SIGN_PAD_STROKE_LIGHT),C=M||(E?s.SIGN_PAD_BG_DARK:s.SIGN_PAD_BG_LIGHT),_=r.useCallback(()=>{const e=i.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.fillStyle=C==="transparent"?"rgba(0,0,0,0)":C,t.fillRect(0,0,e.width,e.height))},[C]);r.useEffect(()=>{const e=i.current,t=w.current;if(!e||!t)return;const n=()=>{const d=t.getBoundingClientRect(),f=p??Math.round(d.width),G=D;(e.width!==f||e.height!==G)&&(e.width=f,e.height=G,_())};n();const l=new ResizeObserver(n);return l.observe(t),()=>l.disconnect()},[p,D,_]),r.useEffect(()=>{_()},[_,E]),r.useEffect(()=>{const e=i.current;if(!e||a||c)return;const t=n=>n.preventDefault();return e.addEventListener("touchstart",t,{passive:!1}),e.addEventListener("touchmove",t,{passive:!1}),()=>{e.removeEventListener("touchstart",t),e.removeEventListener("touchmove",t)}},[a,c]);const b=r.useCallback(e=>{const t=i.current;if(!t)return{x:0,y:0};const n=t.getBoundingClientRect(),l=t.width/n.width,d=t.height/n.height;if("touches"in e){const f=e.touches[0];return{x:(f.clientX-n.left)*l,y:(f.clientY-n.top)*d}}return{x:(e.clientX-n.left)*l,y:(e.clientY-n.top)*d}},[]),I=r.useCallback(e=>{if(a||c)return;const t=b(e);g.current=!0,A.current=t},[a,c,b]),x=r.useCallback(e=>{if(!g.current||a||c)return;const t=i.current,n=t==null?void 0:t.getContext("2d"),l=A.current;if(!t||!n||!l)return;const d=b(e);n.beginPath(),n.moveTo(l.x,l.y),n.lineTo(d.x,d.y),n.strokeStyle=k,n.lineWidth=T,n.lineCap="round",n.lineJoin="round",n.stroke(),A.current=d,L(!0)},[a,c,k,T,b]),R=r.useCallback(()=>{if(g.current){const e=i.current;if(e&&o){const t=e.toDataURL(P,v);o(t)}}g.current=!1,A.current=null},[o,P,v]),z=r.useCallback(()=>{const e=i.current,t=e==null?void 0:e.getContext("2d");!e||!t||(t.clearRect(0,0,e.width,e.height),_(),L(!1),o==null||o(null))},[_,o]),X=r.useCallback(()=>{const e=i.current;if(!e||!h)return;const t=e.toDataURL(P,v);o==null||o(t)},[h,o,P,v]);return u.jsxs("div",{"data-testid":K,className:S.cn("Bear-SignPad bear-w-full",s.SIGN_PAD_ROOT_CLASSES,a&&"Bear-SignPad--disabled bear-opacity-50",c&&"Bear-SignPad--readonly",H),...q,children:[u.jsxs("div",{ref:w,className:S.cn("Bear-SignPad__canvas-wrapper bear-w-full bear-overflow-hidden","bear-touch-none",s.SIGN_PAD_CANVAS_WRAPPER_CLASSES,!a&&!c&&s.SIGN_PAD_CANVAS_WRAPPER_HOVER,a&&"bear-cursor-not-allowed",!a&&!c&&"bear-cursor-crosshair"),children:[u.jsx("canvas",{ref:i,className:"Bear-SignPad__canvas bear-block bear-rounded-lg bear-w-full bear-touch-none",style:{height:D},onMouseDown:I,onMouseMove:x,onMouseUp:R,onMouseLeave:R,onTouchStart:I,onTouchMove:x,onTouchEnd:R}),!h&&u.jsx("div",{className:S.cn("Bear-SignPad__placeholder",s.SIGN_PAD_PLACEHOLDER_CLASSES),children:U}),u.jsx("div",{className:S.cn("Bear-SignPad__line",s.SIGN_PAD_LINE_CLASSES)}),u.jsx("span",{className:S.cn("Bear-SignPad__x-mark",s.SIGN_PAD_X_MARK_CLASSES),children:"×"})]}),(N||m)&&u.jsxs("div",{className:S.cn("Bear-SignPad__actions",s.SIGN_PAD_ACTIONS_CLASSES),children:[N&&u.jsx(y.Button,{size:"sm",variant:"ghost",onClick:z,disabled:a||!h,children:j}),m&&u.jsx(y.Button,{size:"sm",variant:"primary",onClick:X,disabled:a||!h,children:F})]})]})};exports.SignPad=Y;
|