@forgedevstack/bear 1.2.3 → 1.2.4
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 +1 -0
- 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.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.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.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.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.const.d.ts +1 -0
- package/dist/components/MentionsInput/MentionsInput.types.d.ts +2 -0
- package/dist/components/Menu/Menu.const.d.ts +1 -0
- package/dist/components/Menu/Menu.types.d.ts +1 -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.js +6 -6
- package/dist/components/Toast/Toast.types.d.ts +1 -0
- 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.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 +15 -2
- package/dist/components/index.js +421 -402
- 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 +516 -479
- package/dist/styles.css +25 -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 +1 -1
- package/dist/components/Toast/Toast.utils.cjs +0 -1
- package/dist/components/Toast/Toast.utils.js +0 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e = "Bear-Timeline relative", t = "Bear-Timeline__item relative pb-8 last:pb-0", E = {
|
|
2
2
|
left: {
|
|
3
3
|
wrapper: "pl-8",
|
|
4
4
|
content: "text-left",
|
|
@@ -17,42 +17,63 @@ const t = "Bear-Timeline relative", e = "Bear-Timeline__item relative pb-8 last:
|
|
|
17
17
|
dot: "",
|
|
18
18
|
line: "left-1/2 -translate-x-1/2"
|
|
19
19
|
}
|
|
20
|
-
},
|
|
20
|
+
}, r = "Bear-Timeline__dot absolute rounded-full border-2 border-white dark:border-zinc-900 z-10 transition-all", _ = {
|
|
21
21
|
sm: "w-3 h-3",
|
|
22
22
|
md: "w-4 h-4",
|
|
23
23
|
lg: "w-5 h-5"
|
|
24
|
-
},
|
|
24
|
+
}, T = {
|
|
25
25
|
sm: "w-6 h-6",
|
|
26
26
|
md: "w-8 h-8",
|
|
27
27
|
lg: "w-10 h-10"
|
|
28
|
-
},
|
|
28
|
+
}, I = {
|
|
29
29
|
pink: "bg-primary-500",
|
|
30
30
|
green: "bg-green-500",
|
|
31
31
|
blue: "bg-blue-500",
|
|
32
32
|
amber: "bg-amber-500",
|
|
33
33
|
red: "bg-red-500",
|
|
34
34
|
gray: "bg-gray-400 dark:bg-zinc-600"
|
|
35
|
-
},
|
|
35
|
+
}, a = "Bear-Timeline__line absolute top-0 w-0.5 h-full", n = "bg-gray-200 dark:bg-zinc-700", o = "Bear-Timeline__content", s = {
|
|
36
36
|
sm: "text-sm",
|
|
37
37
|
md: "text-base",
|
|
38
38
|
lg: "text-lg"
|
|
39
|
-
},
|
|
39
|
+
}, N = {
|
|
40
40
|
sm: "text-xs",
|
|
41
41
|
md: "text-sm",
|
|
42
42
|
lg: "text-base"
|
|
43
|
-
},
|
|
43
|
+
}, b = "text-xs text-gray-500 dark:text-gray-400", i = 2, L = 6, c = -4, l = 0, M = "bear-flex bear-items-center bear-justify-center bear-text-white", O = "bear-ring-4 bear-ring-primary-500/30", g = "bear-cursor-pointer", m = "hover:bear-scale-125 bear-transition-transform", A = "bear-scale-125", S = "bear-text-sm bear-space-y-1", x = "bear-font-semibold bear-text-gray-900 dark:bear-text-white", d = "bear-pr-8 bear-text-right bear-w-1/2", D = "bear-pl-8 bear-text-left bear-w-1/2 bear-ml-auto", C = "bear-text-right", p = "bear-text-left", R = "Bear-Timeline__title bear-font-medium bear-text-gray-900 dark:bear-text-white", h = "bear-text-primary-600 dark:bear-text-primary-400", w = "Bear-Timeline__description bear-text-gray-600 dark:bear-text-gray-400 bear-mt-1", y = "Bear-Timeline__extra bear-mt-3", B = "bear-mb-1", f = "Loading...";
|
|
44
44
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
r as
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
C as TIMELINE_ALTERNATE_EVEN_CONTENT,
|
|
46
|
+
d as TIMELINE_ALTERNATE_EVEN_WRAPPER,
|
|
47
|
+
p as TIMELINE_ALTERNATE_ODD_CONTENT,
|
|
48
|
+
D as TIMELINE_ALTERNATE_ODD_WRAPPER,
|
|
49
|
+
e as TIMELINE_BASE_CLASSES,
|
|
50
|
+
o as TIMELINE_CONTENT_BASE,
|
|
51
|
+
w as TIMELINE_DESC_BASE,
|
|
52
|
+
N as TIMELINE_DESC_SIZES,
|
|
53
|
+
O as TIMELINE_DOT_ACTIVE_RING,
|
|
54
|
+
A as TIMELINE_DOT_ACTIVE_SCALE,
|
|
55
|
+
r as TIMELINE_DOT_BASE,
|
|
56
|
+
I as TIMELINE_DOT_COLORS,
|
|
57
|
+
m as TIMELINE_DOT_HOVER_SCALE,
|
|
58
|
+
M as TIMELINE_DOT_ICON_EXTRA,
|
|
59
|
+
T as TIMELINE_DOT_ICON_SIZES,
|
|
60
|
+
g as TIMELINE_DOT_INTERACTIVE,
|
|
61
|
+
l as TIMELINE_DOT_OFFSET_DEFAULT_PX,
|
|
62
|
+
c as TIMELINE_DOT_OFFSET_WITH_ICON_PX,
|
|
63
|
+
_ as TIMELINE_DOT_SIZES,
|
|
64
|
+
L as TIMELINE_DOT_TOP_DEFAULT_PX,
|
|
65
|
+
i as TIMELINE_DOT_TOP_WITH_ICON_PX,
|
|
66
|
+
y as TIMELINE_EXTRA_CLASSES,
|
|
67
|
+
S as TIMELINE_HOVER_CARD_CONTENT,
|
|
68
|
+
x as TIMELINE_HOVER_CARD_DATE,
|
|
69
|
+
t as TIMELINE_ITEM_BASE,
|
|
70
|
+
a as TIMELINE_LINE_BASE,
|
|
71
|
+
n as TIMELINE_LINE_COLOR,
|
|
72
|
+
f as TIMELINE_PENDING_TITLE,
|
|
73
|
+
E as TIMELINE_POSITIONS,
|
|
74
|
+
b as TIMELINE_TIME_CLASSES,
|
|
75
|
+
B as TIMELINE_TIME_MARGIN,
|
|
76
|
+
h as TIMELINE_TITLE_ACTIVE,
|
|
77
|
+
R as TIMELINE_TITLE_BASE,
|
|
78
|
+
s as TIMELINE_TITLE_SIZES
|
|
58
79
|
};
|
|
@@ -1,17 +1,2 @@
|
|
|
1
1
|
import { TimelineProps } from './Timeline.types';
|
|
2
|
-
/**
|
|
3
|
-
* Timeline - Vertical timeline for events
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* ```tsx
|
|
7
|
-
* <Timeline
|
|
8
|
-
* items={[
|
|
9
|
-
* { title: 'Step 1', description: 'Description', time: '2024-01-01' },
|
|
10
|
-
* { title: 'Step 2', description: 'Description', time: '2024-01-02', active: true },
|
|
11
|
-
* { title: 'Step 3', description: 'Description', time: '2024-01-03' },
|
|
12
|
-
* ]}
|
|
13
|
-
* />
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
2
|
export declare const Timeline: import('react').ForwardRefExoticComponent<TimelineProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
17
|
-
export default Timeline;
|
|
@@ -1,139 +1,140 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { cn as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{
|
|
48
|
-
className: r(
|
|
49
|
-
m,
|
|
50
|
-
x,
|
|
51
|
-
_[a],
|
|
52
|
-
c && "ring-4 ring-primary-500/30 scale-125"
|
|
53
|
-
),
|
|
54
|
-
style: {
|
|
55
|
-
top: "6px",
|
|
56
|
-
...e === "left" ? { left: "0" } : {},
|
|
57
|
-
...e === "right" ? { right: "0" } : {},
|
|
58
|
-
...e === "alternate" ? { left: "50%", transform: "translateX(-50%)" } : {}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
}, v = (t) => {
|
|
63
|
-
if (e !== "alternate") return {};
|
|
64
|
-
const a = t % 2 === 0;
|
|
65
|
-
return {
|
|
66
|
-
wrapper: a ? "pr-8 text-right w-1/2" : "pl-8 text-left w-1/2 ml-auto",
|
|
67
|
-
content: a ? "text-right" : "text-left"
|
|
68
|
-
};
|
|
69
|
-
};
|
|
70
|
-
return /* @__PURE__ */ o(
|
|
1
|
+
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as X, useMemo as b } from "react";
|
|
3
|
+
import { cn as e } from "../../utils/cn.js";
|
|
4
|
+
import { HoverCard as k } from "../HoverCard/HoverCard.js";
|
|
5
|
+
import { TIMELINE_PENDING_TITLE as w, TIMELINE_LINE_COLOR as x, TIMELINE_POSITIONS as F, TIMELINE_LINE_BASE as H, TIMELINE_TIME_MARGIN as z, TIMELINE_TIME_CLASSES as W, TIMELINE_TITLE_ACTIVE as Z, TIMELINE_TITLE_SIZES as G, TIMELINE_TITLE_BASE as $, TIMELINE_DESC_SIZES as j, TIMELINE_DESC_BASE as U, TIMELINE_EXTRA_CLASSES as K, TIMELINE_CONTENT_BASE as q, TIMELINE_ITEM_BASE as J, TIMELINE_BASE_CLASSES as Q, TIMELINE_DOT_INTERACTIVE as A, TIMELINE_DOT_ACTIVE_RING as C, TIMELINE_DOT_ICON_EXTRA as Y, TIMELINE_DOT_COLORS as D, TIMELINE_DOT_ICON_SIZES as EE, TIMELINE_DOT_BASE as p, TIMELINE_DOT_HOVER_SCALE as eE, TIMELINE_DOT_ACTIVE_SCALE as tE, TIMELINE_DOT_SIZES as IE, TIMELINE_HOVER_CARD_CONTENT as oE, TIMELINE_HOVER_CARD_DATE as TE, TIMELINE_ALTERNATE_EVEN_CONTENT as rE, TIMELINE_ALTERNATE_ODD_CONTENT as nE, TIMELINE_ALTERNATE_EVEN_WRAPPER as _E, TIMELINE_ALTERNATE_ODD_WRAPPER as sE, TIMELINE_DOT_TOP_WITH_ICON_PX as NE, TIMELINE_DOT_TOP_DEFAULT_PX as iE, TIMELINE_DOT_OFFSET_WITH_ICON_PX as cE, TIMELINE_DOT_OFFSET_DEFAULT_PX as aE } from "./Timeline.const.js";
|
|
6
|
+
const lE = (N, i) => {
|
|
7
|
+
const r = i ? NE : iE, I = i ? cE : aE;
|
|
8
|
+
return N === "alternate" ? { top: r, left: "50%", transform: "translateX(-50%)" } : N === "right" ? { top: r, right: I } : { top: r, left: I };
|
|
9
|
+
}, dE = X((N, i) => {
|
|
10
|
+
const {
|
|
11
|
+
items: r,
|
|
12
|
+
position: I = "left",
|
|
13
|
+
size: c = "md",
|
|
14
|
+
showLine: v = !0,
|
|
15
|
+
pending: n,
|
|
16
|
+
reverse: d = !1,
|
|
17
|
+
lineColor: l,
|
|
18
|
+
testId: f,
|
|
19
|
+
className: R,
|
|
20
|
+
...h
|
|
21
|
+
} = N, L = F[I], u = IE[c], m = EE[c], P = G[c], y = j[c], g = b(() => {
|
|
22
|
+
let E = [...r];
|
|
23
|
+
return d && (E = E.reverse()), n && E.push({
|
|
24
|
+
title: typeof n == "string" ? n : w,
|
|
25
|
+
description: typeof n == "boolean" ? void 0 : n,
|
|
26
|
+
color: "gray"
|
|
27
|
+
}), E;
|
|
28
|
+
}, [r, d, n]), V = (E, o) => {
|
|
29
|
+
const _ = E.color || "pink", s = E.active, S = !!E.icon, T = !!(E.detail || E.date), M = lE(I, S), O = S ? /* @__PURE__ */ t(
|
|
30
|
+
"div",
|
|
31
|
+
{
|
|
32
|
+
className: e(
|
|
33
|
+
p,
|
|
34
|
+
m,
|
|
35
|
+
D[_],
|
|
36
|
+
Y,
|
|
37
|
+
s && C,
|
|
38
|
+
T && A
|
|
39
|
+
),
|
|
40
|
+
style: M,
|
|
41
|
+
onClick: E.onDotClick,
|
|
42
|
+
role: T ? "button" : void 0,
|
|
43
|
+
tabIndex: T ? 0 : void 0,
|
|
44
|
+
children: E.icon
|
|
45
|
+
}
|
|
46
|
+
) : /* @__PURE__ */ t(
|
|
71
47
|
"div",
|
|
72
48
|
{
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
49
|
+
className: e(
|
|
50
|
+
p,
|
|
51
|
+
u,
|
|
52
|
+
D[_],
|
|
53
|
+
s && e(C, tE),
|
|
54
|
+
T && e(A, eE)
|
|
55
|
+
),
|
|
56
|
+
style: M,
|
|
57
|
+
onClick: E.onDotClick,
|
|
58
|
+
role: T ? "button" : void 0,
|
|
59
|
+
tabIndex: T ? 0 : void 0
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
return T ? /* @__PURE__ */ t(
|
|
63
|
+
k,
|
|
64
|
+
{
|
|
65
|
+
cardContent: /* @__PURE__ */ a("div", { className: oE, children: [
|
|
66
|
+
E.date && /* @__PURE__ */ t("div", { className: TE, children: E.date }),
|
|
67
|
+
E.detail ?? E.description
|
|
68
|
+
] }),
|
|
69
|
+
children: O
|
|
70
|
+
},
|
|
71
|
+
o
|
|
72
|
+
) : O;
|
|
73
|
+
}, B = (E) => {
|
|
74
|
+
if (I !== "alternate") return { wrapper: "", content: "" };
|
|
75
|
+
const o = E % 2 === 0;
|
|
76
|
+
return {
|
|
77
|
+
wrapper: o ? _E : sE,
|
|
78
|
+
content: o ? rE : nE
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
return /* @__PURE__ */ a(
|
|
82
|
+
"div",
|
|
83
|
+
{
|
|
84
|
+
ref: i,
|
|
85
|
+
className: e(Q, R),
|
|
86
|
+
"data-testid": f,
|
|
87
|
+
...h,
|
|
88
|
+
children: [
|
|
89
|
+
v && /* @__PURE__ */ t(
|
|
90
|
+
"div",
|
|
91
|
+
{
|
|
92
|
+
className: e(
|
|
93
|
+
H,
|
|
94
|
+
L.line,
|
|
95
|
+
l ? "" : x
|
|
96
|
+
),
|
|
97
|
+
style: l ? { backgroundColor: l } : void 0
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
g.map((E, o) => {
|
|
101
|
+
const _ = B(o), s = `${E.title}-${E.time ?? o}`;
|
|
102
|
+
return /* @__PURE__ */ a(
|
|
79
103
|
"div",
|
|
80
104
|
{
|
|
81
|
-
className:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
105
|
+
className: e(
|
|
106
|
+
J,
|
|
107
|
+
I !== "alternate" && L.wrapper,
|
|
108
|
+
_.wrapper
|
|
85
109
|
),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
/* @__PURE__ */
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
t.description && /* @__PURE__ */ l(
|
|
115
|
-
"div",
|
|
116
|
-
{
|
|
117
|
-
className: r(
|
|
118
|
-
"Bear-Timeline__description text-gray-600 dark:text-gray-400 mt-1",
|
|
119
|
-
y
|
|
120
|
-
),
|
|
121
|
-
children: t.description
|
|
122
|
-
}
|
|
123
|
-
),
|
|
124
|
-
t.extra && /* @__PURE__ */ l("div", { className: "Bear-Timeline__extra mt-3", children: t.extra })
|
|
125
|
-
] })
|
|
126
|
-
]
|
|
127
|
-
},
|
|
128
|
-
a
|
|
129
|
-
);
|
|
130
|
-
})
|
|
131
|
-
]
|
|
132
|
-
}
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
);
|
|
136
|
-
z.displayName = "Timeline";
|
|
110
|
+
children: [
|
|
111
|
+
V(E, `dot-${s}`),
|
|
112
|
+
/* @__PURE__ */ a("div", { className: e(q, _.content), children: [
|
|
113
|
+
E.time && /* @__PURE__ */ t("div", { className: e(W, z), children: E.time }),
|
|
114
|
+
/* @__PURE__ */ t(
|
|
115
|
+
"h4",
|
|
116
|
+
{
|
|
117
|
+
className: e(
|
|
118
|
+
$,
|
|
119
|
+
P,
|
|
120
|
+
E.active && Z
|
|
121
|
+
),
|
|
122
|
+
children: E.title
|
|
123
|
+
}
|
|
124
|
+
),
|
|
125
|
+
E.description && /* @__PURE__ */ t("div", { className: e(U, y), children: E.description }),
|
|
126
|
+
E.extra && /* @__PURE__ */ t("div", { className: K, children: E.extra })
|
|
127
|
+
] })
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
s
|
|
131
|
+
);
|
|
132
|
+
})
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
});
|
|
137
|
+
dE.displayName = "Timeline";
|
|
137
138
|
export {
|
|
138
|
-
|
|
139
|
+
dE as Timeline
|
|
139
140
|
};
|
|
@@ -16,8 +16,15 @@ export interface TimelineItem {
|
|
|
16
16
|
active?: boolean;
|
|
17
17
|
/** Extra content below description */
|
|
18
18
|
extra?: ReactNode;
|
|
19
|
+
/** Full date string shown on dot hover/click */
|
|
20
|
+
date?: string;
|
|
21
|
+
/** Detail panel content for dot interaction */
|
|
22
|
+
detail?: ReactNode;
|
|
23
|
+
/** Dot click handler */
|
|
24
|
+
onDotClick?: () => void;
|
|
19
25
|
}
|
|
20
26
|
export interface TimelineProps extends HTMLAttributes<HTMLDivElement> {
|
|
27
|
+
id?: string;
|
|
21
28
|
/** Array of timeline items */
|
|
22
29
|
items: TimelineItem[];
|
|
23
30
|
/** Position of content relative to line */
|
|
@@ -8,6 +8,7 @@ export interface TimelineChartItem {
|
|
|
8
8
|
icon?: ReactNode;
|
|
9
9
|
}
|
|
10
10
|
export interface TimelineChartProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
11
|
+
id?: string;
|
|
11
12
|
/** Items to display on the timeline */
|
|
12
13
|
items: TimelineChartItem[];
|
|
13
14
|
/** Minimum value of the axis */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),y=require("../../utils/cn.cjs"),T=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),y=require("../../utils/cn.cjs"),T=require("../../utils/generateBearId.utils.cjs"),p={success:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),e.jsx("polyline",{points:"22 4 12 14.01 9 11.01"})]}),info:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),warning:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),error:e.jsxs("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),e.jsx("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]})},k=()=>e.jsxs("svg",{width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),C={success:"bear-bg-green-500 bear-text-white",info:"bear-bg-blue-500 bear-text-white",warning:"bear-bg-amber-500 bear-text-white",error:"bear-bg-red-500 bear-text-white"},I={"top-left":"bear-top-4 bear-left-4","top-center":"bear-top-4 bear-left-1/2 bear-transform bear--translate-x-1/2","top-right":"bear-top-4 bear-right-4","bottom-left":"bear-bottom-4 bear-left-4","bottom-center":"bear-bottom-4 bear-left-1/2 bear-transform bear--translate-x-1/2","bottom-right":"bear-bottom-4 bear-right-4"},v=r.createContext(null),E=()=>{const i=r.useContext(v);if(!i)throw new Error("useToast must be used within a ToastProvider");return i},N=({message:i,title:c,severity:b="info",duration:o=5e3,closable:l=!0,icon:s,action:x,onClose:n,onRemove:u,className:g,autoScroll:f=!1})=>{const[j,m]=r.useState(!1),d=r.useRef(null);r.useEffect(()=>{f&&d.current&&d.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[f]),r.useEffect(()=>{if(o>0){const h=setTimeout(()=>{m(!0),setTimeout(()=>{u(),n==null||n()},200)},o);return()=>clearTimeout(h)}},[o,u,n]);const t=()=>{m(!0),setTimeout(()=>{u(),n==null||n()},200)},a=()=>s===!1?null:s||p[b];return e.jsxs("div",{ref:d,role:"alert",className:y.cn("bear-flex bear-items-start bear-gap-3 bear-p-4 bear-rounded-lg bear-shadow-lg bear-min-w-[300px] bear-max-w-[400px]","bear-transition-all bear-duration-200",j?"bear-opacity-0 bear-translate-x-2":"bear-opacity-100 bear-translate-x-0",C[b],g),children:[a()&&e.jsx("span",{className:"bear-flex-shrink-0 bear-mt-0.5",children:a()}),e.jsxs("div",{className:"bear-flex-1 bear-min-w-0",children:[c&&e.jsx("div",{className:"bear-font-semibold bear-mb-0.5",children:c}),e.jsx("div",{className:"bear-text-sm bear-opacity-90",children:i})]}),x&&e.jsx("div",{className:"bear-flex-shrink-0",children:x}),l&&e.jsx("button",{type:"button",onClick:t,className:"bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-white/20 bear-transition-colors bear-bg-transparent bear-border-none bear-cursor-pointer","aria-label":"Close",children:e.jsx(k,{})})]})},w=({position:i="top-right",maxToasts:c=5,className:b})=>{const o=r.useContext(v);if(!o)return null;const{_toasts:l,_removeToast:s}=o,x=l.slice(0,c);return e.jsx("div",{className:y.cn("bear-fixed bear-z-[11000] bear-flex bear-flex-col bear-gap-2",I[i],b),children:x.map(n=>e.jsx(N,{...n,onRemove:()=>s(n.id)},n.id))})},S=({children:i,position:c="top-right"})=>{const[b,o]=r.useState([]),l=r.useCallback(t=>{o(a=>a.filter(h=>h.id!==t))},[]),s=r.useCallback(t=>{const a=t.id||T.generateBearId("Toast");return o(h=>[...h,{...t,id:a}]),a},[]),x=r.useCallback(t=>s(t),[s]),n=r.useCallback((t,a)=>s({message:t,severity:"success",...a}),[s]),u=r.useCallback((t,a)=>s({message:t,severity:"info",...a}),[s]),g=r.useCallback((t,a)=>s({message:t,severity:"warning",...a}),[s]),f=r.useCallback((t,a)=>s({message:t,severity:"error",...a}),[s]),j=r.useCallback(t=>l(t),[l]),m=r.useCallback(()=>o([]),[]),d={toast:x,success:n,info:u,warning:g,error:f,dismiss:j,dismissAll:m,_toasts:b,_removeToast:l};return e.jsxs(v.Provider,{value:d,children:[i,e.jsx(w,{position:c})]})};exports.ToastContainer=w;exports.ToastProvider=S;exports.useToast=E;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const T_O_A_S_T_ROOT_CLASS = "Bear-Toast";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
2
|
import { createContext as N, useContext as T, useState as k, useCallback as n, useRef as E, useEffect as y } from "react";
|
|
3
3
|
import { cn as I } from "../../utils/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
4
|
+
import { generateBearId as B } from "../../utils/generateBearId.utils.js";
|
|
5
|
+
const S = {
|
|
6
6
|
success: /* @__PURE__ */ l("svg", { width: 20, height: 20, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
7
7
|
/* @__PURE__ */ e("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }),
|
|
8
8
|
/* @__PURE__ */ e("polyline", { points: "22 4 12 14.01 9 11.01" })
|
|
@@ -22,7 +22,7 @@ const _ = {
|
|
|
22
22
|
/* @__PURE__ */ e("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
|
|
23
23
|
/* @__PURE__ */ e("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
|
|
24
24
|
] })
|
|
25
|
-
},
|
|
25
|
+
}, _ = () => /* @__PURE__ */ l("svg", { width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, children: [
|
|
26
26
|
/* @__PURE__ */ e("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
27
27
|
/* @__PURE__ */ e("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
28
28
|
] }), W = {
|
|
@@ -72,7 +72,7 @@ const _ = {
|
|
|
72
72
|
g(!0), setTimeout(() => {
|
|
73
73
|
x(), s == null || s();
|
|
74
74
|
}, 200);
|
|
75
|
-
}, a = () => t === !1 ? null : t ||
|
|
75
|
+
}, a = () => t === !1 ? null : t || S[h];
|
|
76
76
|
return /* @__PURE__ */ l(
|
|
77
77
|
"div",
|
|
78
78
|
{
|
|
@@ -99,7 +99,7 @@ const _ = {
|
|
|
99
99
|
onClick: r,
|
|
100
100
|
className: "bear-flex-shrink-0 bear-p-1 bear-rounded hover:bear-bg-white/20 bear-transition-colors bear-bg-transparent bear-border-none bear-cursor-pointer",
|
|
101
101
|
"aria-label": "Close",
|
|
102
|
-
children: /* @__PURE__ */ e(
|
|
102
|
+
children: /* @__PURE__ */ e(_, {})
|
|
103
103
|
}
|
|
104
104
|
)
|
|
105
105
|
]
|
|
@@ -138,7 +138,7 @@ const _ = {
|
|
|
138
138
|
const [h, o] = k([]), c = n((r) => {
|
|
139
139
|
o((a) => a.filter((f) => f.id !== r));
|
|
140
140
|
}, []), t = n((r) => {
|
|
141
|
-
const a = r.id ||
|
|
141
|
+
const a = r.id || B("Toast");
|
|
142
142
|
return o((f) => [...f, { ...r, id: a }]), a;
|
|
143
143
|
}, []), d = n((r) => t(r), [t]), s = n((r, a) => t({ message: r, severity: "success", ...a }), [t]), x = n((r, a) => t({ message: r, severity: "info", ...a }), [t]), p = n((r, a) => t({ message: r, severity: "warning", ...a }), [t]), m = n((r, a) => t({ message: r, severity: "error", ...a }), [t]), v = n((r) => c(r), [c]), g = n(() => o([]), []), u = {
|
|
144
144
|
toast: d,
|
|
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
3
3
|
export type ToastSeverity = 'success' | 'info' | 'warning' | 'error';
|
|
4
4
|
export interface ToastProps {
|
|
5
|
+
testId?: string;
|
|
5
6
|
/** Unique identifier for the toast */
|
|
6
7
|
id?: string;
|
|
7
8
|
/** Toast message content */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("react/jsx-runtime"),o=require("react"),I=require("../../utils/cn.cjs"),A=require("../../utils/generateBearId.utils.cjs"),m=require("../../utils/useBearId.cjs"),n=require("./ToggleButton.const.cjs"),N=o.createContext(null),y=()=>o.useContext(N),q=({value:t,selected:T,size:l,fullWidth:d=!1,disabled:g=!1,className:i,children:c,id:B,testId:S,onClick:a,..._})=>{const O=m.useBearId("ToggleButton"),E=A.resolveBearId(B,O),e=y(),G=l??(e==null?void 0:e.size)??"md",r=g||(e==null?void 0:e.disabled)||!1,f=T??(e==null?void 0:e.selectedValues.includes(t))??!1,p=s=>{r||e==null||e.toggleValue(t),a==null||a(s)};return L.jsx("button",{type:"button",id:E,"data-testid":S,"aria-pressed":f,disabled:r,onClick:p,className:I.cn(n.TOGGLE_BUTTON_ROOT_CLASS,n.TOGGLE_BUTTON_BASE_CLASSES,n.TOGGLE_BUTTON_SIZE_CLASSES[G],f&&n.TOGGLE_BUTTON_SELECTED_CLASSES,d&&"bear-flex-1",r&&"bear-opacity-50 bear-cursor-not-allowed",i),..._,children:c})},b=t=>t?Array.isArray(t)?t:[t]:[],C=({value:t,defaultValue:T,onChange:l,exclusive:d=!0,size:g="md",fullWidth:i=!1,disabled:c=!1,className:B,children:S,id:a,testId:_})=>{const O=m.useBearId("ToggleButtonGroup"),E=A.resolveBearId(a,O),[e,G]=o.useState(()=>b(T)),r=t!==void 0?b(t):e,p={selectedValues:r,toggleValue:s=>{let u;d?u=[s]:u=r.includes(s)?r.filter(U=>U!==s):[...r,s],t===void 0&&G(u),l==null||l(d?u[0]??"":u)},size:g,disabled:c};return L.jsx(N.Provider,{value:p,children:L.jsx("div",{id:E,"data-testid":_,role:"group",className:I.cn(n.TOGGLE_BUTTON_GROUP_ROOT_CLASS,n.TOGGLE_BUTTON_GROUP_BASE_CLASSES,i&&"bear-w-full",c&&"bear-opacity-50 bear-pointer-events-none",B),children:o.Children.map(S,s=>o.isValidElement(s)?o.cloneElement(s,{fullWidth:s.props.fullWidth??i}):s)})})};exports.ToggleButton=q;exports.ToggleButtonGroup=C;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="Bear-ToggleButton",e="Bear-ToggleButtonGroup",a={xs:"bear-h-7 bear-px-2 bear-text-xs",sm:"bear-h-8 bear-px-3 bear-text-sm",md:"bear-h-10 bear-px-4 bear-text-base",lg:"bear-h-12 bear-px-5 bear-text-lg",xl:"bear-h-14 bear-px-6 bear-text-lg"},b="bear-bg-[var(--bear-primary-500)] bear-text-[var(--bear-text-inverted,#fff)] bear-border-[var(--bear-primary-500)] bear-shadow-sm",t="bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-md bear-border bear-transition-all bear-duration-200 bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-text-[var(--bear-text-primary)] hover:bear-bg-[var(--bear-bg-tertiary)]",T="bear-inline-flex bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)] bear-overflow-hidden";exports.TOGGLE_BUTTON_BASE_CLASSES=t;exports.TOGGLE_BUTTON_GROUP_BASE_CLASSES=T;exports.TOGGLE_BUTTON_GROUP_ROOT_CLASS=e;exports.TOGGLE_BUTTON_ROOT_CLASS=r;exports.TOGGLE_BUTTON_SELECTED_CLASSES=b;exports.TOGGLE_BUTTON_SIZE_CLASSES=a;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const TOGGLE_BUTTON_ROOT_CLASS = "Bear-ToggleButton";
|
|
2
|
+
export declare const TOGGLE_BUTTON_GROUP_ROOT_CLASS = "Bear-ToggleButtonGroup";
|
|
3
|
+
export declare const TOGGLE_BUTTON_SIZE_CLASSES: Record<'sm' | 'md' | 'lg' | 'xs' | 'xl', string>;
|
|
4
|
+
export declare const TOGGLE_BUTTON_SELECTED_CLASSES = "bear-bg-[var(--bear-primary-500)] bear-text-[var(--bear-text-inverted,#fff)] bear-border-[var(--bear-primary-500)] bear-shadow-sm";
|
|
5
|
+
export declare const TOGGLE_BUTTON_BASE_CLASSES = "bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-md bear-border bear-transition-all bear-duration-200 bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-text-[var(--bear-text-primary)] hover:bear-bg-[var(--bear-bg-tertiary)]";
|
|
6
|
+
export declare const TOGGLE_BUTTON_GROUP_BASE_CLASSES = "bear-inline-flex bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)] bear-overflow-hidden";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const r = "Bear-ToggleButton", e = "Bear-ToggleButtonGroup", a = {
|
|
2
|
+
xs: "bear-h-7 bear-px-2 bear-text-xs",
|
|
3
|
+
sm: "bear-h-8 bear-px-3 bear-text-sm",
|
|
4
|
+
md: "bear-h-10 bear-px-4 bear-text-base",
|
|
5
|
+
lg: "bear-h-12 bear-px-5 bear-text-lg",
|
|
6
|
+
xl: "bear-h-14 bear-px-6 bear-text-lg"
|
|
7
|
+
}, b = "bear-bg-[var(--bear-primary-500)] bear-text-[var(--bear-text-inverted,#fff)] bear-border-[var(--bear-primary-500)] bear-shadow-sm", t = "bear-inline-flex bear-items-center bear-justify-center bear-font-medium bear-rounded-md bear-border bear-transition-all bear-duration-200 bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-primary)] bear-text-[var(--bear-text-primary)] hover:bear-bg-[var(--bear-bg-tertiary)]", o = "bear-inline-flex bear-rounded-lg bear-border bear-border-[var(--bear-border-default)] bear-bg-[var(--bear-bg-secondary)] bear-overflow-hidden";
|
|
8
|
+
export {
|
|
9
|
+
t as TOGGLE_BUTTON_BASE_CLASSES,
|
|
10
|
+
o as TOGGLE_BUTTON_GROUP_BASE_CLASSES,
|
|
11
|
+
e as TOGGLE_BUTTON_GROUP_ROOT_CLASS,
|
|
12
|
+
r as TOGGLE_BUTTON_ROOT_CLASS,
|
|
13
|
+
b as TOGGLE_BUTTON_SELECTED_CLASSES,
|
|
14
|
+
a as TOGGLE_BUTTON_SIZE_CLASSES
|
|
15
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ToggleButtonProps, ToggleButtonGroupProps } from './ToggleButton.types';
|
|
2
|
+
export declare const ToggleButton: ({ value, selected: selectedProp, size: sizeProp, fullWidth, disabled: disabledProp, className, children, id, testId, onClick, ...props }: ToggleButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const ToggleButtonGroup: ({ value: controlledValue, defaultValue, onChange, exclusive, size, fullWidth, disabled, className, children, id, testId, }: ToggleButtonGroupProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as O } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as N, useState as U, Children as C, isValidElement as y, cloneElement as V, useContext as z } from "react";
|
|
3
|
+
import { cn as G } from "../../utils/cn.js";
|
|
4
|
+
import { resolveBearId as L } from "../../utils/generateBearId.utils.js";
|
|
5
|
+
import { useBearId as b } from "../../utils/useBearId.js";
|
|
6
|
+
import { TOGGLE_BUTTON_SELECTED_CLASSES as R, TOGGLE_BUTTON_SIZE_CLASSES as v, TOGGLE_BUTTON_BASE_CLASSES as x, TOGGLE_BUTTON_ROOT_CLASS as P, TOGGLE_BUTTON_GROUP_BASE_CLASSES as w, TOGGLE_BUTTON_GROUP_ROOT_CLASS as j } from "./ToggleButton.const.js";
|
|
7
|
+
const A = N(null), D = () => z(A), K = ({
|
|
8
|
+
value: t,
|
|
9
|
+
selected: u,
|
|
10
|
+
size: o,
|
|
11
|
+
fullWidth: a = !1,
|
|
12
|
+
disabled: T = !1,
|
|
13
|
+
className: d,
|
|
14
|
+
children: i,
|
|
15
|
+
id: c,
|
|
16
|
+
testId: f,
|
|
17
|
+
onClick: n,
|
|
18
|
+
...S
|
|
19
|
+
}) => {
|
|
20
|
+
const _ = b("ToggleButton"), m = L(c, _), e = D(), p = o ?? (e == null ? void 0 : e.size) ?? "md", s = T || (e == null ? void 0 : e.disabled) || !1, E = u ?? (e == null ? void 0 : e.selectedValues.includes(t)) ?? !1;
|
|
21
|
+
return /* @__PURE__ */ O(
|
|
22
|
+
"button",
|
|
23
|
+
{
|
|
24
|
+
type: "button",
|
|
25
|
+
id: m,
|
|
26
|
+
"data-testid": f,
|
|
27
|
+
"aria-pressed": E,
|
|
28
|
+
disabled: s,
|
|
29
|
+
onClick: (r) => {
|
|
30
|
+
s || e == null || e.toggleValue(t), n == null || n(r);
|
|
31
|
+
},
|
|
32
|
+
className: G(
|
|
33
|
+
P,
|
|
34
|
+
x,
|
|
35
|
+
v[p],
|
|
36
|
+
E && R,
|
|
37
|
+
a && "bear-flex-1",
|
|
38
|
+
s && "bear-opacity-50 bear-cursor-not-allowed",
|
|
39
|
+
d
|
|
40
|
+
),
|
|
41
|
+
...S,
|
|
42
|
+
children: i
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}, B = (t) => t ? Array.isArray(t) ? t : [t] : [], M = ({
|
|
46
|
+
value: t,
|
|
47
|
+
defaultValue: u,
|
|
48
|
+
onChange: o,
|
|
49
|
+
exclusive: a = !0,
|
|
50
|
+
size: T = "md",
|
|
51
|
+
fullWidth: d = !1,
|
|
52
|
+
disabled: i = !1,
|
|
53
|
+
className: c,
|
|
54
|
+
children: f,
|
|
55
|
+
id: n,
|
|
56
|
+
testId: S
|
|
57
|
+
}) => {
|
|
58
|
+
const _ = b("ToggleButtonGroup"), m = L(n, _), [e, p] = U(() => B(u)), s = t !== void 0 ? B(t) : e, g = {
|
|
59
|
+
selectedValues: s,
|
|
60
|
+
toggleValue: (r) => {
|
|
61
|
+
let l;
|
|
62
|
+
a ? l = [r] : l = s.includes(r) ? s.filter((I) => I !== r) : [...s, r], t === void 0 && p(l), o == null || o(a ? l[0] ?? "" : l);
|
|
63
|
+
},
|
|
64
|
+
size: T,
|
|
65
|
+
disabled: i
|
|
66
|
+
};
|
|
67
|
+
return /* @__PURE__ */ O(A.Provider, { value: g, children: /* @__PURE__ */ O(
|
|
68
|
+
"div",
|
|
69
|
+
{
|
|
70
|
+
id: m,
|
|
71
|
+
"data-testid": S,
|
|
72
|
+
role: "group",
|
|
73
|
+
className: G(
|
|
74
|
+
j,
|
|
75
|
+
w,
|
|
76
|
+
d && "bear-w-full",
|
|
77
|
+
i && "bear-opacity-50 bear-pointer-events-none",
|
|
78
|
+
c
|
|
79
|
+
),
|
|
80
|
+
children: C.map(f, (r) => y(r) ? V(r, {
|
|
81
|
+
fullWidth: r.props.fullWidth ?? d
|
|
82
|
+
}) : r)
|
|
83
|
+
}
|
|
84
|
+
) });
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
K as ToggleButton,
|
|
88
|
+
M as ToggleButtonGroup
|
|
89
|
+
};
|