@dilicorp/ui 1.3.1 → 1.3.2
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.
|
@@ -7,12 +7,10 @@ export declare type AlertProps = {
|
|
|
7
7
|
color?: 'default' | 'success' | 'info' | 'warning' | 'error';
|
|
8
8
|
showButton?: boolean;
|
|
9
9
|
buttonText?: string;
|
|
10
|
-
onClose?: () => void;
|
|
11
10
|
} & React.HTMLAttributes<HTMLDivElement>;
|
|
12
11
|
export declare const Alert: React.ForwardRefExoticComponent<{
|
|
13
12
|
color?: "success" | "info" | "warning" | "default" | "error" | undefined;
|
|
14
13
|
showButton?: boolean | undefined;
|
|
15
14
|
buttonText?: string | undefined;
|
|
16
|
-
onClose?: (() => void) | undefined;
|
|
17
15
|
} & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<AlertRef>>;
|
|
18
16
|
//# sourceMappingURL=alert.d.ts.map
|
package/dist/molecules/alert.js
CHANGED
|
@@ -3,13 +3,10 @@ import ReactDOM from 'react-dom';
|
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Button } from '../atoms/button';
|
|
5
5
|
export const Alert = forwardRef((props, ref) => {
|
|
6
|
-
const { children, className, showButton, buttonText = 'Ok', color
|
|
6
|
+
const { children, className, showButton, buttonText = 'Ok', color } = props;
|
|
7
7
|
const [display, setDisplay] = useState(false);
|
|
8
8
|
const open = () => setDisplay(true);
|
|
9
|
-
const close = () =>
|
|
10
|
-
setDisplay(false);
|
|
11
|
-
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
12
|
-
};
|
|
9
|
+
const close = () => setDisplay(false);
|
|
13
10
|
useImperativeHandle(ref, () => ({
|
|
14
11
|
open: () => open(),
|
|
15
12
|
close: () => close()
|
|
@@ -5,7 +5,7 @@ import classNames from 'classnames';
|
|
|
5
5
|
export const Modal = forwardRef((props, ref) => {
|
|
6
6
|
const { children, title, closeFn, className, innerRef } = props;
|
|
7
7
|
const classes = classNames(className !== null && className !== void 0 ? className : 'alert-small');
|
|
8
|
-
return (React.createElement(Alert, { ref: ref !== null && ref !== void 0 ? ref : innerRef, className: classes
|
|
8
|
+
return (React.createElement(Alert, { ref: ref !== null && ref !== void 0 ? ref : innerRef, className: classes },
|
|
9
9
|
React.createElement("div", { className: "modal modal-sm" },
|
|
10
10
|
React.createElement("div", { className: "modal-header" },
|
|
11
11
|
React.createElement("div", { className: "title" }, title),
|