math-main-components 0.0.19 → 0.0.21

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.
@@ -1,3 +1,7 @@
1
1
  import React from "react";
2
2
  import { DialogProps } from "./Dialog.types";
3
- export declare function Dialog({ active, onClose, children }: DialogProps): React.JSX.Element;
3
+ export interface DialogData {
4
+ isActive: boolean;
5
+ data: any;
6
+ }
7
+ export declare function Dialog({ data, onClose, children }: DialogProps): React.JSX.Element;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
+ import { DialogData } from "./Dialog";
2
3
  export interface DialogProps {
3
- active?: boolean;
4
- onClose?: (event: React.MouseEventHandler<HTMLDivElement>) => void;
4
+ data?: DialogData;
5
+ onClose?: (event: React.MouseEventHandler<HTMLDivElement>, data: any) => void;
5
6
  children: any;
6
7
  }
package/dist/index.cjs.js CHANGED
@@ -135,13 +135,13 @@ var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
135
135
  var styles$m = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M"};
136
136
  styleInject(css_248z$m);
137
137
 
138
- function Dialog({ active = false, onClose = (event) => { }, children = null }) {
138
+ function Dialog({ data, onClose = (event, data) => { }, children = null }) {
139
139
  function onClick(event) {
140
- if (event.target.id == 'dialog-backdrop') {
141
- onClose(event);
140
+ if (event.target.id == 'dialog-backdrop' && data) {
141
+ onClose(event, data.data);
142
142
  }
143
143
  }
144
- return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${active ? styles$m.active : styles$m.disabled}`, onClick: onClick },
144
+ return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
145
145
  React__default["default"].createElement("div", { className: styles$m.dialog_window }, children)));
146
146
  }
147
147
 
@@ -375,7 +375,7 @@ function OptionFieldHorizontal({ title, iconName, preselected = false }) {
375
375
  React__default["default"].createElement("h3", null, title)));
376
376
  }
377
377
 
378
- var css_248z$a = ".styles-module_container__oNbrP {\n padding-top: 10px;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65 {\n padding: 10px 18px;\n background: #0075FF;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n color: white;\n align-items: center;\n border: none;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_red__CHF3e {\n background: #e40000;\n}";
378
+ var css_248z$a = ".styles-module_container__oNbrP .styles-module_button__UBk65 {\n padding: 10px 18px;\n background: #0075FF;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n color: white;\n align-items: center;\n border: none;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_red__CHF3e {\n background: #e40000;\n}";
379
379
  var styles$a = {"container":"styles-module_container__oNbrP","button":"styles-module_button__UBk65","red":"styles-module_red__CHF3e"};
380
380
  styleInject(css_248z$a);
381
381
 
package/dist/index.esm.js CHANGED
@@ -127,13 +127,13 @@ var css_248z$m = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
127
127
  var styles$m = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M"};
128
128
  styleInject(css_248z$m);
129
129
 
130
- function Dialog({ active = false, onClose = (event) => { }, children = null }) {
130
+ function Dialog({ data, onClose = (event, data) => { }, children = null }) {
131
131
  function onClick(event) {
132
- if (event.target.id == 'dialog-backdrop') {
133
- onClose(event);
132
+ if (event.target.id == 'dialog-backdrop' && data) {
133
+ onClose(event, data.data);
134
134
  }
135
135
  }
136
- return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${active ? styles$m.active : styles$m.disabled}`, onClick: onClick },
136
+ return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$m.container} ${data?.isActive ? styles$m.active : styles$m.disabled}`, onClick: onClick },
137
137
  React.createElement("div", { className: styles$m.dialog_window }, children)));
138
138
  }
139
139
 
@@ -367,7 +367,7 @@ function OptionFieldHorizontal({ title, iconName, preselected = false }) {
367
367
  React.createElement("h3", null, title)));
368
368
  }
369
369
 
370
- var css_248z$a = ".styles-module_container__oNbrP {\n padding-top: 10px;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65 {\n padding: 10px 18px;\n background: #0075FF;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n color: white;\n align-items: center;\n border: none;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_red__CHF3e {\n background: #e40000;\n}";
370
+ var css_248z$a = ".styles-module_container__oNbrP .styles-module_button__UBk65 {\n padding: 10px 18px;\n background: #0075FF;\n border-radius: 40px;\n cursor: pointer;\n display: flex;\n flex-direction: row;\n gap: 10px;\n font-size: 15px;\n color: white;\n align-items: center;\n border: none;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_red__CHF3e {\n background: #e40000;\n}";
371
371
  var styles$a = {"container":"styles-module_container__oNbrP","button":"styles-module_button__UBk65","red":"styles-module_red__CHF3e"};
372
372
  styleInject(css_248z$a);
373
373
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "author": "Emilian Scheel",
5
5
  "files": [
6
6
  "dist/**/*"