math-main-components 0.0.158 → 0.0.160

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,10 +1,7 @@
1
1
  import React from "react";
2
- export interface DialogData {
3
- isActive: boolean;
4
- data?: any;
5
- }
6
- export declare function Dialog({ data, text, onClose, onSubmit, children }: {
7
- data?: DialogData;
2
+ export declare function Dialog({ data, enabled, text, onClose, onSubmit, children }: {
3
+ data?: unknown;
4
+ enabled?: boolean;
8
5
  text?: any;
9
6
  onClose?: (event: React.MouseEvent<HTMLDivElement | HTMLButtonElement>, data?: any | undefined) => void;
10
7
  onSubmit?: (event: React.MouseEvent<HTMLButtonElement>, data?: any | undefined) => void;
package/dist/index.cjs.js CHANGED
@@ -148,21 +148,21 @@ var css_248z$o = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
148
148
  var styles$o = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M","cancel_button":"styles-module_cancel_button__KhwLS","submit_button":"styles-module_submit_button__xLzux"};
149
149
  styleInject(css_248z$o);
150
150
 
151
- function Dialog({ data, text, onClose, onSubmit, children }) {
151
+ function Dialog({ data, enabled, text, onClose, onSubmit = () => { }, children }) {
152
152
  function onClick(event) {
153
153
  const element = event.target;
154
154
  const id = element.id;
155
155
  if (["dialog-backdrop", "cancel-button"].includes(id)) {
156
156
  if (onClose)
157
- onClose(event, data?.data);
157
+ onClose(event, data);
158
158
  }
159
159
  }
160
- return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${data?.isActive ? styles$o.active : styles$o.disabled}`, onClick: onClick },
160
+ return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${enabled ? styles$o.active : styles$o.disabled}`, onClick: onClick },
161
161
  React__default["default"].createElement("div", { className: styles$o.dialog_window },
162
162
  children,
163
163
  text && React__default["default"].createElement("h1", null, text),
164
164
  React__default["default"].createElement("button", { className: styles$o.cancel_button, id: "cancel-button", onClick: onClick }, "Abbrechen"),
165
- React__default["default"].createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit && onSubmit(event, data?.data) }, "Best\u00E4tigen"))));
165
+ React__default["default"].createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit(event, data) }, "Best\u00E4tigen"))));
166
166
  }
167
167
 
168
168
  var css_248z$n = ".styles-module_card__hT9fw {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 20px;\n padding: 100px 0px;\n}\n.styles-module_card__hT9fw h1 {\n margin: 0;\n font-size: 22px;\n font-weight: 500;\n}\n.styles-module_card__hT9fw p {\n margin: 0;\n font-size: 16px;\n}";
@@ -256,25 +256,25 @@ var styles$h = {"container":"styles-module_container__IXTeq","input":"styles-mod
256
256
  styleInject(css_248z$h);
257
257
 
258
258
  function InputNames({ width = "100%", placeholder = { firstName: "", lastName: "" }, title = { firstName: "Vorname", lastName: "Nachname" }, defaultValue = { firstName: "", lastName: "" }, onInput = (name, event) => { }, onInputFirstName = (event) => { }, onInputLastName = (event) => { }, }) {
259
- const [value1, setValue1] = React.useState(defaultValue.firstName ? defaultValue.firstName : "");
260
- const [value2, setValue2] = React.useState(defaultValue.lastName ? defaultValue.lastName : "");
259
+ const [firstName, setFirstName] = React.useState(defaultValue.firstName ? defaultValue.firstName : "");
260
+ const [lastName, setLastName] = React.useState(defaultValue.lastName ? defaultValue.lastName : "");
261
261
  function onInput1(event) {
262
- setValue1(event.target.value);
262
+ setFirstName(event.target.value);
263
263
  onInputFirstName(event);
264
264
  onInput("firstName", event);
265
265
  }
266
266
  function onInput2(event) {
267
- setValue2(event.target.value);
267
+ setLastName(event.target.value);
268
268
  onInputLastName(event);
269
269
  onInput("lastName", event);
270
270
  }
271
271
  return (React__default["default"].createElement("div", { className: styles$h.container, style: { width: width } },
272
272
  React__default["default"].createElement("div", { className: styles$h.form },
273
- React__default["default"].createElement("input", { className: `${styles$h.input} ${title.firstName != undefined ? styles$h.with_title : styles$h.without_title} ${value1.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "firstName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.firstName, defaultValue: defaultValue.firstName, onInput: onInput1 }),
273
+ React__default["default"].createElement("input", { className: `${styles$h.input} ${title.firstName != undefined ? styles$h.with_title : styles$h.without_title} ${firstName.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "firstName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.firstName, defaultValue: defaultValue.firstName, onInput: onInput1 }),
274
274
  React__default["default"].createElement("label", { htmlFor: "text", className: styles$h.label },
275
275
  React__default["default"].createElement("span", { className: styles$h.label_text }, title.firstName))),
276
276
  React__default["default"].createElement("div", { className: styles$h.form },
277
- React__default["default"].createElement("input", { className: `${styles$h.input} ${title.lastName != undefined ? styles$h.with_title : styles$h.without_title} ${value2.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "lastName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.lastName, defaultValue: defaultValue.lastName, onInput: onInput2 }),
277
+ React__default["default"].createElement("input", { className: `${styles$h.input} ${title.lastName != undefined ? styles$h.with_title : styles$h.without_title} ${lastName.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "lastName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.lastName, defaultValue: defaultValue.lastName, onInput: onInput2 }),
278
278
  React__default["default"].createElement("label", { htmlFor: "text", className: styles$h.label },
279
279
  React__default["default"].createElement("span", { className: styles$h.label_text }, title.lastName)))));
280
280
  }
package/dist/index.esm.js CHANGED
@@ -140,21 +140,21 @@ var css_248z$o = ".styles-module_container__9-1MH {\n position: fixed;\n heigh
140
140
  var styles$o = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M","cancel_button":"styles-module_cancel_button__KhwLS","submit_button":"styles-module_submit_button__xLzux"};
141
141
  styleInject(css_248z$o);
142
142
 
143
- function Dialog({ data, text, onClose, onSubmit, children }) {
143
+ function Dialog({ data, enabled, text, onClose, onSubmit = () => { }, children }) {
144
144
  function onClick(event) {
145
145
  const element = event.target;
146
146
  const id = element.id;
147
147
  if (["dialog-backdrop", "cancel-button"].includes(id)) {
148
148
  if (onClose)
149
- onClose(event, data?.data);
149
+ onClose(event, data);
150
150
  }
151
151
  }
152
- return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${data?.isActive ? styles$o.active : styles$o.disabled}`, onClick: onClick },
152
+ return (React.createElement("div", { id: "dialog-backdrop", className: `${styles$o.container} ${enabled ? styles$o.active : styles$o.disabled}`, onClick: onClick },
153
153
  React.createElement("div", { className: styles$o.dialog_window },
154
154
  children,
155
155
  text && React.createElement("h1", null, text),
156
156
  React.createElement("button", { className: styles$o.cancel_button, id: "cancel-button", onClick: onClick }, "Abbrechen"),
157
- React.createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit && onSubmit(event, data?.data) }, "Best\u00E4tigen"))));
157
+ React.createElement("button", { className: styles$o.submit_button, id: "submit-button", onClick: (event) => onSubmit(event, data) }, "Best\u00E4tigen"))));
158
158
  }
159
159
 
160
160
  var css_248z$n = ".styles-module_card__hT9fw {\n display: flex;\n align-items: center;\n flex-direction: column;\n gap: 20px;\n padding: 100px 0px;\n}\n.styles-module_card__hT9fw h1 {\n margin: 0;\n font-size: 22px;\n font-weight: 500;\n}\n.styles-module_card__hT9fw p {\n margin: 0;\n font-size: 16px;\n}";
@@ -248,25 +248,25 @@ var styles$h = {"container":"styles-module_container__IXTeq","input":"styles-mod
248
248
  styleInject(css_248z$h);
249
249
 
250
250
  function InputNames({ width = "100%", placeholder = { firstName: "", lastName: "" }, title = { firstName: "Vorname", lastName: "Nachname" }, defaultValue = { firstName: "", lastName: "" }, onInput = (name, event) => { }, onInputFirstName = (event) => { }, onInputLastName = (event) => { }, }) {
251
- const [value1, setValue1] = useState(defaultValue.firstName ? defaultValue.firstName : "");
252
- const [value2, setValue2] = useState(defaultValue.lastName ? defaultValue.lastName : "");
251
+ const [firstName, setFirstName] = useState(defaultValue.firstName ? defaultValue.firstName : "");
252
+ const [lastName, setLastName] = useState(defaultValue.lastName ? defaultValue.lastName : "");
253
253
  function onInput1(event) {
254
- setValue1(event.target.value);
254
+ setFirstName(event.target.value);
255
255
  onInputFirstName(event);
256
256
  onInput("firstName", event);
257
257
  }
258
258
  function onInput2(event) {
259
- setValue2(event.target.value);
259
+ setLastName(event.target.value);
260
260
  onInputLastName(event);
261
261
  onInput("lastName", event);
262
262
  }
263
263
  return (React.createElement("div", { className: styles$h.container, style: { width: width } },
264
264
  React.createElement("div", { className: styles$h.form },
265
- React.createElement("input", { className: `${styles$h.input} ${title.firstName != undefined ? styles$h.with_title : styles$h.without_title} ${value1.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "firstName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.firstName, defaultValue: defaultValue.firstName, onInput: onInput1 }),
265
+ React.createElement("input", { className: `${styles$h.input} ${title.firstName != undefined ? styles$h.with_title : styles$h.without_title} ${firstName.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "firstName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.firstName, defaultValue: defaultValue.firstName, onInput: onInput1 }),
266
266
  React.createElement("label", { htmlFor: "text", className: styles$h.label },
267
267
  React.createElement("span", { className: styles$h.label_text }, title.firstName))),
268
268
  React.createElement("div", { className: styles$h.form },
269
- React.createElement("input", { className: `${styles$h.input} ${title.lastName != undefined ? styles$h.with_title : styles$h.without_title} ${value2.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "lastName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.lastName, defaultValue: defaultValue.lastName, onInput: onInput2 }),
269
+ React.createElement("input", { className: `${styles$h.input} ${title.lastName != undefined ? styles$h.with_title : styles$h.without_title} ${lastName.length > 0 ? styles$h.valid : styles$h.not_valid}`, name: "lastName", type: "name", style: { width: width != "100%" ? "100px" : width }, placeholder: placeholder.lastName, defaultValue: defaultValue.lastName, onInput: onInput2 }),
270
270
  React.createElement("label", { htmlFor: "text", className: styles$h.label },
271
271
  React.createElement("span", { className: styles$h.label_text }, title.lastName)))));
272
272
  }
@@ -2,6 +2,7 @@ import { PortableTextBlock } from "sanity";
2
2
  import { Category } from "./Category";
3
3
  export type Calculator = {
4
4
  _id: string;
5
+ _type: "calculators";
5
6
  previewImage: {
6
7
  asset: {
7
8
  _ref: string;
@@ -1,5 +1,6 @@
1
1
  export type Category = {
2
2
  _id: string;
3
+ _type: "categories";
3
4
  title: string;
4
5
  isTopLevel: boolean;
5
6
  hasEBooks: boolean;
@@ -3,6 +3,7 @@ import { Category } from "./Category";
3
3
  import { Product } from "./Product";
4
4
  export type Ebook = {
5
5
  _id: string;
6
+ _type: "ebooks";
6
7
  title: string;
7
8
  previewImage: {
8
9
  asset: {
@@ -1,5 +1,6 @@
1
1
  export type HelpData = {
2
2
  _id: string;
3
+ _type: "helpData";
3
4
  title: string;
4
5
  content: any;
5
6
  openButtonText: string;
@@ -1,6 +1,7 @@
1
1
  import { Category } from "./Category";
2
2
  export type Material = {
3
3
  _id: string;
4
+ _type: "materials";
4
5
  title: string;
5
6
  fileId: string;
6
7
  fileExpire?: string;
@@ -2,6 +2,7 @@ import { PortableTextBlock } from "sanity";
2
2
  import { Category } from "./Category";
3
3
  export type Movie = {
4
4
  _id: string;
5
+ _type: "movies";
5
6
  title: string;
6
7
  previewImage: {
7
8
  asset: {
@@ -2,6 +2,7 @@ import { PortableTextBlock } from "sanity";
2
2
  import { Ebook } from "./Ebook";
3
3
  export type Product = {
4
4
  _id: string;
5
+ _type: "product";
5
6
  title: string;
6
7
  combinable: boolean;
7
8
  enabled: boolean;
@@ -1,11 +1,14 @@
1
1
  import { PortableTextBlock } from "sanity";
2
2
  export type About = {
3
- id: number;
3
+ _id: string;
4
+ _type: "about";
4
5
  quote: string;
5
6
  description: PortableTextBlock[];
6
7
  persons: Person[];
7
8
  };
8
9
  export type Person = {
10
+ _id: number;
11
+ _type: "person";
9
12
  name: string;
10
13
  role: string;
11
14
  linkedIn: string;
@@ -1,5 +1,6 @@
1
1
  export type BenefitForIndividuals = {
2
2
  _id: string;
3
+ _type: "benefitsForIndividual";
3
4
  priority: number;
4
5
  title: string;
5
6
  subtitle: string;
@@ -1,5 +1,6 @@
1
1
  export type BenefitForSchools = {
2
2
  _id: string;
3
+ _type: "benefitsForSchools";
3
4
  priority: number;
4
5
  title: string;
5
6
  subtitle: string;
@@ -1,5 +1,6 @@
1
1
  export type Concept = {
2
2
  _id: string;
3
+ _type: "concept";
3
4
  title: string;
4
5
  subtitle: string;
5
6
  description: string;
@@ -1,6 +1,7 @@
1
1
  import { PortableTextBlock } from "sanity";
2
2
  export type Content = {
3
3
  _id: string;
4
+ _type: "content";
4
5
  priority: number;
5
6
  title: string;
6
7
  subtitle: string;
@@ -1,6 +1,7 @@
1
1
  import { PortableTextBlock } from "sanity";
2
2
  export type Faq = {
3
3
  _id: string;
4
+ _type: "faq";
4
5
  priority: number;
5
6
  question: string;
6
7
  answer: PortableTextBlock[];
@@ -1,5 +1,6 @@
1
1
  export type Feature = {
2
2
  _id: string;
3
+ _type: "feature";
3
4
  priority: number;
4
5
  title: string;
5
6
  subtitle: string;
@@ -1,5 +1,6 @@
1
1
  export type FooterLink = {
2
2
  _id: string;
3
+ _type: "footerLinks";
3
4
  title: string;
4
5
  link: string;
5
6
  priority: number;
@@ -1,7 +1,7 @@
1
1
  import { PortableTextBlock } from "sanity";
2
2
  export type Home = {
3
3
  _id: string;
4
- _type: string;
4
+ _type: "home";
5
5
  helpMockup?: {
6
6
  asset: {
7
7
  _type: string;
@@ -1,6 +1,7 @@
1
1
  import { PortableTextBlock } from "sanity";
2
2
  export type News = {
3
3
  _id: string;
4
+ _type: "news";
4
5
  visible: boolean;
5
6
  headline: string;
6
7
  slug: {
@@ -2,6 +2,7 @@ import { PortableTextBlock } from "sanity";
2
2
  import { Product } from "../Product";
3
3
  export type Pricing = {
4
4
  _id: string;
5
+ _type: "pricing";
5
6
  title: string;
6
7
  position: PricingPosition;
7
8
  limitation: string;
@@ -1,5 +1,7 @@
1
1
  import { PortableTextBlock } from "sanity";
2
2
  export type StaticPage = {
3
+ _id: string;
4
+ _type: "page";
3
5
  title: string;
4
6
  slug: {
5
7
  current: string;
@@ -1,5 +1,6 @@
1
1
  export type Website = {
2
2
  _id: string;
3
+ _type: "website";
3
4
  heroDescription: string;
4
5
  heroTitle: string;
5
6
  title: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.158",
3
+ "version": "0.0.160",
4
4
  "author": "Emilian Scheel",
5
5
  "files": [
6
6
  "dist/**/*"