ar-design 0.3.18 → 0.3.20

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.
@@ -5,6 +5,7 @@ import Button from "../../form/button";
5
5
  import ReactDOM from "react-dom";
6
6
  import { NotificationContext } from "../../../libs/core/application/contexts/Notification";
7
7
  import { ARIcon } from "../../icons";
8
+ import Box from "../../data-display/grid-system/box/Box";
8
9
  const Popup = ({ title, message, status, isOpen, buttons }) => {
9
10
  // contexts
10
11
  const { setIsPopupOpen } = useContext(NotificationContext);
@@ -74,11 +75,18 @@ const Popup = ({ title, message, status, isOpen, buttons }) => {
74
75
  title,
75
76
  "!"),
76
77
  React.createElement("span", { className: "message" }, message)),
77
- React.createElement(Button, { variant: "filled", color: buttonColor(), onClick: () => {
78
- (() => buttons?.okay?.onClick && buttons.okay?.onClick())();
79
- (() => {
80
- setIsPopupOpen && setIsPopupOpen((prev) => !prev);
81
- })();
82
- } }, buttons?.okay?.text ?? "Tamam"))), document.body));
78
+ React.createElement(Box, null,
79
+ React.createElement(Button, { variant: "filled", color: buttonColor(), onClick: () => {
80
+ (() => buttons?.okay?.onClick && buttons.okay?.onClick())();
81
+ (() => {
82
+ setIsPopupOpen && setIsPopupOpen((prev) => !prev);
83
+ })();
84
+ } }, buttons?.okay?.text ?? "Tamam"),
85
+ buttons?.cancel && (React.createElement(Button, { variant: "filled", color: "light", onClick: () => {
86
+ (() => buttons?.cancel?.onClick && buttons.cancel?.onClick())();
87
+ (() => {
88
+ setIsPopupOpen && setIsPopupOpen((prev) => !prev);
89
+ })();
90
+ } }, buttons?.cancel?.text ?? "İptal"))))), document.body));
83
91
  };
84
92
  export default Popup;
@@ -10,6 +10,10 @@ export type PopupButtonProps = {
10
10
  text?: string;
11
11
  onClick?: () => void;
12
12
  };
13
+ cancel?: {
14
+ text?: string;
15
+ onClick?: () => void;
16
+ };
13
17
  };
14
18
  type NotificationContextProps = {
15
19
  setTitle: React.Dispatch<React.SetStateAction<string>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ar-design",
3
- "version": "0.3.18",
3
+ "version": "0.3.20",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",