{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport classNames from 'classnames';\nimport React from 'react';\nimport { useUncontrolled } from 'uncontrollable';\nimport useEventCallback from '@restart/hooks/useEventCallback';\nimport createWithBsPrefix from './createWithBsPrefix';\nimport divWithClassName from './divWithClassName';\nimport { useBootstrapPrefix } from './ThemeProvider';\nimport Fade from './Fade';\nimport CloseButton from './CloseButton';\nimport SafeAnchor from './SafeAnchor';\nvar defaultProps = {\n show: true,\n transition: Fade,\n closeLabel: 'Close alert'\n};\nvar controllables = {\n show: 'onClose'\n};\nvar Alert = React.forwardRef(function (uncontrolledProps, ref) {\n var _useUncontrolled = useUncontrolled(uncontrolledProps, controllables),\n bsPrefix = _useUncontrolled.bsPrefix,\n show = _useUncontrolled.show,\n closeLabel = _useUncontrolled.closeLabel,\n className = _useUncontrolled.className,\n children = _useUncontrolled.children,\n variant = _useUncontrolled.variant,\n onClose = _useUncontrolled.onClose,\n dismissible = _useUncontrolled.dismissible,\n Transition = _useUncontrolled.transition,\n props = _objectWithoutPropertiesLoose(_useUncontrolled, [\"bsPrefix\", \"show\", \"closeLabel\", \"className\", \"children\", \"variant\", \"onClose\", \"dismissible\", \"transition\"]);\n\n var prefix = useBootstrapPrefix(bsPrefix, 'alert');\n var handleClose = useEventCallback(function (e) {\n onClose(false, e);\n });\n var alert = React.createElement(\"div\", _extends({\n role: \"alert\"\n }, Transition ? props : undefined, {\n className: classNames(className, prefix, variant && prefix + \"-\" + variant, dismissible && prefix + \"-dismissible\")\n }), dismissible && React.createElement(CloseButton, {\n onClick: handleClose,\n label: closeLabel\n }), children);\n if (!Transition) return show ? alert : null;\n return React.createElement(Transition, _extends({\n unmountOnExit: true,\n ref: ref\n }, props, {\n in: show\n }), alert);\n});\nvar DivStyledAsH4 = divWithClassName('h4');\nDivStyledAsH4.displayName = 'DivStyledAsH4';\nAlert.displayName = 'Alert';\nAlert.defaultProps = defaultProps;\nAlert.Link = createWithBsPrefix('alert-link', {\n Component: SafeAnchor\n});\nAlert.Heading = createWithBsPrefix('alert-heading', {\n Component: DivStyledAsH4\n});\nexport default Alert;","map":null,"metadata":{},"sourceType":"module"}