math-main-components 0.0.34 → 0.0.36

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,6 +1,7 @@
1
1
  import React from 'react';
2
- export declare function OptionFieldHorizontal({ title, iconName, preselected }: {
2
+ export declare function OptionFieldHorizontal({ title, iconName, onClick, preselected }: {
3
3
  title: string;
4
- iconName: string;
4
+ iconName?: string;
5
+ onClick?: (event: any) => void;
5
6
  preselected?: boolean;
6
7
  }): React.JSX.Element;
@@ -4,9 +4,10 @@ export declare class RadioOption {
4
4
  name: string;
5
5
  constructor(text: string, name: string);
6
6
  }
7
- export declare function RadioButtons({ options, group, selected, width }: {
7
+ export declare function RadioButtons({ options, group, selected, onClick, width }: {
8
8
  options: RadioOption[];
9
9
  group: string;
10
10
  selected?: string;
11
+ onClick?: (event: any) => void;
11
12
  width?: string;
12
13
  }): React.JSX.Element;
package/dist/index.cjs.js CHANGED
@@ -370,13 +370,18 @@ function OptionField({ headline, description, iconName }) {
370
370
  React__default["default"].createElement("p", null, description)))));
371
371
  }
372
372
 
373
- var css_248z$b = ".styles-module_container__XCtqW {\n background: white;\n border-radius: 12px;\n padding: 30px;\n margin-bottom: 30px;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 18px;\n color: black;\n border: 1px solid #B1B1B1;\n transition: 0.2s ease-in-out;\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);\n}\n.styles-module_container__XCtqW:hover {\n background: #f0f0f0;\n border-color: #888888;\n}\n.styles-module_container__XCtqW h3 {\n font-weight: 500;\n margin: 0;\n}\n\n.styles-module_container__XCtqW.styles-module_preselected__WoSbB {\n border: 1px solid black;\n}";
373
+ var css_248z$b = ".styles-module_container__XCtqW {\n background: white;\n border-radius: 12px;\n padding: 30px;\n margin-bottom: 30px;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 18px;\n color: black;\n border: 1px solid #B1B1B1;\n transition: 0.2s ease-in-out;\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n}\n.styles-module_container__XCtqW:hover {\n background: #f0f0f0;\n border-color: #888888;\n}\n.styles-module_container__XCtqW h3 {\n font-weight: 500;\n margin: 0;\n}\n\n.styles-module_container__XCtqW.styles-module_preselected__WoSbB {\n border: 1px solid black;\n}";
374
374
  var styles$b = {"container":"styles-module_container__XCtqW","preselected":"styles-module_preselected__WoSbB"};
375
375
  styleInject(css_248z$b);
376
376
 
377
- function OptionFieldHorizontal({ title, iconName, preselected = false }) {
378
- return (React__default["default"].createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" ") },
379
- React__default["default"].createElement(SvgIcon, { iconName: iconName, size: "32px" }),
377
+ function OptionFieldHorizontal({ title, iconName, onClick, preselected = false }) {
378
+ function onClickDiv(event) {
379
+ event.preventDefault();
380
+ if (onClick)
381
+ onClick(event);
382
+ }
383
+ return (React__default["default"].createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" "), onClick: onClickDiv },
384
+ iconName && React__default["default"].createElement(SvgIcon, { iconName: iconName, size: "32px" }),
380
385
  React__default["default"].createElement("h3", null, title)));
381
386
  }
382
387
 
@@ -419,10 +424,12 @@ class RadioOption {
419
424
  this.name = name;
420
425
  }
421
426
  }
422
- function RadioButtons({ options, group, selected, width = "100%" }) {
427
+ function RadioButtons({ options, group, selected, onClick, width = "100%" }) {
423
428
  const [selectedOption, setSelected] = React.useState(selected);
424
429
  function onUpdateSelected(event) {
425
430
  setSelected(event.target.value);
431
+ if (onClick)
432
+ onClick(event);
426
433
  }
427
434
  return (React__default["default"].createElement("div", { className: styles$8.container, style: { width: width } }, options.map((option) => React__default["default"].createElement("div", { className: styles$8.option, key: option.name },
428
435
  selected && selected == option.name ?
package/dist/index.esm.js CHANGED
@@ -362,13 +362,18 @@ function OptionField({ headline, description, iconName }) {
362
362
  React.createElement("p", null, description)))));
363
363
  }
364
364
 
365
- var css_248z$b = ".styles-module_container__XCtqW {\n background: white;\n border-radius: 12px;\n padding: 30px;\n margin-bottom: 30px;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 18px;\n color: black;\n border: 1px solid #B1B1B1;\n transition: 0.2s ease-in-out;\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);\n}\n.styles-module_container__XCtqW:hover {\n background: #f0f0f0;\n border-color: #888888;\n}\n.styles-module_container__XCtqW h3 {\n font-weight: 500;\n margin: 0;\n}\n\n.styles-module_container__XCtqW.styles-module_preselected__WoSbB {\n border: 1px solid black;\n}";
365
+ var css_248z$b = ".styles-module_container__XCtqW {\n background: white;\n border-radius: 12px;\n padding: 30px;\n margin-bottom: 30px;\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 18px;\n color: black;\n border: 1px solid #B1B1B1;\n transition: 0.2s ease-in-out;\n box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n}\n.styles-module_container__XCtqW:hover {\n background: #f0f0f0;\n border-color: #888888;\n}\n.styles-module_container__XCtqW h3 {\n font-weight: 500;\n margin: 0;\n}\n\n.styles-module_container__XCtqW.styles-module_preselected__WoSbB {\n border: 1px solid black;\n}";
366
366
  var styles$b = {"container":"styles-module_container__XCtqW","preselected":"styles-module_preselected__WoSbB"};
367
367
  styleInject(css_248z$b);
368
368
 
369
- function OptionFieldHorizontal({ title, iconName, preselected = false }) {
370
- return (React.createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" ") },
371
- React.createElement(SvgIcon, { iconName: iconName, size: "32px" }),
369
+ function OptionFieldHorizontal({ title, iconName, onClick, preselected = false }) {
370
+ function onClickDiv(event) {
371
+ event.preventDefault();
372
+ if (onClick)
373
+ onClick(event);
374
+ }
375
+ return (React.createElement("div", { className: [styles$b.container, preselected ? styles$b.preselected : styles$b.not_preselected].join(" "), onClick: onClickDiv },
376
+ iconName && React.createElement(SvgIcon, { iconName: iconName, size: "32px" }),
372
377
  React.createElement("h3", null, title)));
373
378
  }
374
379
 
@@ -411,10 +416,12 @@ class RadioOption {
411
416
  this.name = name;
412
417
  }
413
418
  }
414
- function RadioButtons({ options, group, selected, width = "100%" }) {
419
+ function RadioButtons({ options, group, selected, onClick, width = "100%" }) {
415
420
  const [selectedOption, setSelected] = useState(selected);
416
421
  function onUpdateSelected(event) {
417
422
  setSelected(event.target.value);
423
+ if (onClick)
424
+ onClick(event);
418
425
  }
419
426
  return (React.createElement("div", { className: styles$8.container, style: { width: width } }, options.map((option) => React.createElement("div", { className: styles$8.option, key: option.name },
420
427
  selected && selected == option.name ?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.34",
3
+ "version": "0.0.36",
4
4
  "author": "Emilian Scheel",
5
5
  "files": [
6
6
  "dist/**/*"