math-main-components 0.0.37 → 0.0.39

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,7 +1,8 @@
1
1
  import React, { MouseEvent } from 'react';
2
- export declare function PrimaryButton({ text, iconName, type, onClick }: {
3
- text: string;
4
- iconName: string;
2
+ export declare function PrimaryButton({ text, iconName, iconFill, type, onClick }: {
3
+ text?: string;
4
+ iconName?: string;
5
+ iconFill?: string;
5
6
  type?: string;
6
7
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
7
8
  }): React.JSX.Element;
package/dist/index.cjs.js CHANGED
@@ -385,20 +385,20 @@ function OptionFieldHorizontal({ title, iconName, onClick, preselected = false }
385
385
  React__default["default"].createElement("h3", null, title)));
386
386
  }
387
387
 
388
- 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}";
389
- var styles$a = {"container":"styles-module_container__oNbrP","button":"styles-module_button__UBk65","red":"styles-module_red__CHF3e"};
388
+ 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_onlyIcon__-Niv0 {\n width: 44px;\n height: 44px;\n padding: 0;\n align-items: center;\n justify-content: center;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_onlyIcon__-Niv0 span {\n font-size: 22px;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_red__CHF3e {\n background: #e40000;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_grey__hdqot {\n background: #EEEEEE;\n color: black;\n}";
389
+ var styles$a = {"container":"styles-module_container__oNbrP","button":"styles-module_button__UBk65","onlyIcon":"styles-module_onlyIcon__-Niv0","red":"styles-module_red__CHF3e","grey":"styles-module_grey__hdqot"};
390
390
  styleInject(css_248z$a);
391
391
 
392
- function PrimaryButton({ text, iconName, type = "blue", onClick = () => { } }) {
392
+ function PrimaryButton({ text, iconName, iconFill = "white", type = "blue", onClick = () => { } }) {
393
393
  function onClickButton(event) {
394
394
  event.preventDefault();
395
395
  if (onClick)
396
396
  onClick(event);
397
397
  }
398
398
  return (React__default["default"].createElement("div", { className: styles$a.container },
399
- React__default["default"].createElement("button", { className: `${styles$a.button} ${styles$a[type]}`, onClick: onClickButton },
399
+ React__default["default"].createElement("button", { className: [styles$a.button, styles$a[type], (text && !iconName) ? styles$a.onlyText : "", (!text && iconName) ? styles$a.onlyIcon : ""].join(" "), onClick: onClickButton },
400
400
  text,
401
- React__default["default"].createElement(SvgIcon, { iconName: iconName, fill: "white" }))));
401
+ iconName && React__default["default"].createElement(SvgIcon, { iconName: iconName, fill: iconFill }))));
402
402
  }
403
403
 
404
404
  var css_248z$9 = ".styles-module_container__u4q5n {\n margin-bottom: 50px;\n}\n\n.styles-module_background__jt-ry {\n background: #D9D9D9;\n width: 400px;\n max-width: 100%;\n height: 3px;\n position: relative;\n}\n\n.styles-module_progress__Zj-B7 {\n background: black;\n position: absolute;\n left: 0;\n top: 0;\n height: 3px;\n}";
package/dist/index.esm.js CHANGED
@@ -377,20 +377,20 @@ function OptionFieldHorizontal({ title, iconName, onClick, preselected = false }
377
377
  React.createElement("h3", null, title)));
378
378
  }
379
379
 
380
- 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}";
381
- var styles$a = {"container":"styles-module_container__oNbrP","button":"styles-module_button__UBk65","red":"styles-module_red__CHF3e"};
380
+ 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_onlyIcon__-Niv0 {\n width: 44px;\n height: 44px;\n padding: 0;\n align-items: center;\n justify-content: center;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_onlyIcon__-Niv0 span {\n font-size: 22px;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_red__CHF3e {\n background: #e40000;\n}\n.styles-module_container__oNbrP .styles-module_button__UBk65.styles-module_grey__hdqot {\n background: #EEEEEE;\n color: black;\n}";
381
+ var styles$a = {"container":"styles-module_container__oNbrP","button":"styles-module_button__UBk65","onlyIcon":"styles-module_onlyIcon__-Niv0","red":"styles-module_red__CHF3e","grey":"styles-module_grey__hdqot"};
382
382
  styleInject(css_248z$a);
383
383
 
384
- function PrimaryButton({ text, iconName, type = "blue", onClick = () => { } }) {
384
+ function PrimaryButton({ text, iconName, iconFill = "white", type = "blue", onClick = () => { } }) {
385
385
  function onClickButton(event) {
386
386
  event.preventDefault();
387
387
  if (onClick)
388
388
  onClick(event);
389
389
  }
390
390
  return (React.createElement("div", { className: styles$a.container },
391
- React.createElement("button", { className: `${styles$a.button} ${styles$a[type]}`, onClick: onClickButton },
391
+ React.createElement("button", { className: [styles$a.button, styles$a[type], (text && !iconName) ? styles$a.onlyText : "", (!text && iconName) ? styles$a.onlyIcon : ""].join(" "), onClick: onClickButton },
392
392
  text,
393
- React.createElement(SvgIcon, { iconName: iconName, fill: "white" }))));
393
+ iconName && React.createElement(SvgIcon, { iconName: iconName, fill: iconFill }))));
394
394
  }
395
395
 
396
396
  var css_248z$9 = ".styles-module_container__u4q5n {\n margin-bottom: 50px;\n}\n\n.styles-module_background__jt-ry {\n background: #D9D9D9;\n width: 400px;\n max-width: 100%;\n height: 3px;\n position: relative;\n}\n\n.styles-module_progress__Zj-B7 {\n background: black;\n position: absolute;\n left: 0;\n top: 0;\n height: 3px;\n}";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "author": "Emilian Scheel",
5
5
  "files": [
6
6
  "dist/**/*"