math-main-components 0.0.2 → 0.0.4

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.
Files changed (40) hide show
  1. package/README.md +7 -0
  2. package/package.json +10 -17
  3. package/src/components/Accordeon/Accordeon.tsx +24 -0
  4. package/src/components/Accordeon/index.tsx +1 -24
  5. package/src/components/Dialog/Dialog.tsx +26 -0
  6. package/src/components/Dialog/index.tsx +1 -26
  7. package/src/components/Gap/Gap.tsx +9 -0
  8. package/src/components/Gap/index.tsx +1 -9
  9. package/src/components/SvgIcon/SvgIcon.tsx +19 -0
  10. package/src/components/SvgIcon/index.ts +2 -0
  11. package/dist/cjs/index.js +0 -2
  12. package/dist/cjs/index.js.map +0 -1
  13. package/dist/cjs/types/components/Accordeon/Accordeon.types.d.ts +0 -4
  14. package/dist/cjs/types/components/Accordeon/index.d.ts +0 -3
  15. package/dist/cjs/types/components/Dialog/Dialog.types.d.ts +0 -6
  16. package/dist/cjs/types/components/Dialog/index.d.ts +0 -3
  17. package/dist/cjs/types/components/Gap/Gap.types.d.ts +0 -3
  18. package/dist/cjs/types/components/Gap/index.d.ts +0 -3
  19. package/dist/cjs/types/components/SvgIcon/SvgIcon.types.d.ts +0 -8
  20. package/dist/cjs/types/components/SvgIcon/index.d.ts +0 -4
  21. package/dist/cjs/types/index.d.ts +0 -1
  22. package/dist/esm/index.js +0 -2
  23. package/dist/esm/index.js.map +0 -1
  24. package/dist/esm/types/components/Accordeon/Accordeon.types.d.ts +0 -4
  25. package/dist/esm/types/components/Accordeon/index.d.ts +0 -3
  26. package/dist/esm/types/components/Dialog/Dialog.types.d.ts +0 -6
  27. package/dist/esm/types/components/Dialog/index.d.ts +0 -3
  28. package/dist/esm/types/components/Gap/Gap.types.d.ts +0 -3
  29. package/dist/esm/types/components/Gap/index.d.ts +0 -3
  30. package/dist/esm/types/components/SvgIcon/SvgIcon.types.d.ts +0 -8
  31. package/dist/esm/types/components/SvgIcon/index.d.ts +0 -4
  32. package/dist/esm/types/components/index.d.ts +0 -1
  33. package/dist/esm/types/index.d.ts +0 -1
  34. package/dist/types.d.ts +0 -2
  35. package/rollup.config.js +0 -39
  36. package/src/components/SvgIcon/index.tsx +0 -16
  37. package/src/types/typings.d.ts +0 -4
  38. package/tsconfig.json +0 -27
  39. package/yarn-error.log +0 -2108
  40. /package/{dist/cjs/types → src}/components/index.d.ts +0 -0
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # math-main-components
2
+
3
+ Component Library for math-main-app
4
+
5
+ Includes
6
+ - reusable ui components
7
+ - math components
package/package.json CHANGED
@@ -1,31 +1,24 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "author": "Emilian Scheel",
5
5
  "license": "MIT",
6
- "main": "dist/cjs/index.js",
7
- "module": "dist/esm/index.js",
8
- "types": "dist/index.d.ts",
9
- "scripts": {
10
- "build": "rollup -c --bundleConfigAsCjs"
11
- },
6
+ "main": "src/index.ts",
7
+ "files": [
8
+ "src/**/*"
9
+ ],
12
10
  "dependencies": {
13
- "prop-types": "^15.8.1"
11
+ "prop-types": "^15.8.1",
12
+ "react": "^18.2.0",
13
+ "react-dom": "^18.2.0",
14
+ "tsc": "^2.0.4"
14
15
  },
15
16
  "devDependencies": {
16
- "rollup-plugin-dts": "^6.0.2",
17
- "rollup-plugin-peer-deps-external": "^2.2.4",
18
- "rollup-plugin-terser": "^7.0.2",
19
- "tslib": "^2.6.2",
20
- "@rollup/plugin-commonjs": "^25.0.4",
21
- "@rollup/plugin-node-resolve": "^15.2.1",
22
- "@rollup/plugin-typescript": "^11.1.3",
23
- "@types/node-sass": "^4.11.4",
17
+ "@tsconfig/recommended": "^1.0.3",
24
18
  "@types/react": "^18.2.22",
25
19
  "css-loader": "^6.8.1",
26
20
  "css-modules-typescript-loader": "^4.0.1",
27
21
  "node-sass": "^9.0.0",
28
- "rollup": "^3.29.2",
29
22
  "sass": "^1.67.0",
30
23
  "sass-loader": "^13.3.2",
31
24
  "typescript": "^5.2.2"
@@ -0,0 +1,24 @@
1
+ import React, { useState } from 'react'
2
+ import { SvgIcon } from '../SvgIcon'
3
+ import { AccordeonProps } from './Accordeon.types'
4
+ import styles from './styles.module.scss'
5
+
6
+ export function Accordeon({
7
+ title,
8
+ children
9
+ }: AccordeonProps) {
10
+
11
+ const [isActive, setActive] = useState(false)
12
+
13
+ return (
14
+ <div className={[styles.container, isActive ? styles.active : styles.not_active].join(" ")}>
15
+ <div className={styles.head} onClick={() => setActive(!isActive)}>
16
+ <SvgIcon iconName="expand_more" />
17
+ <h3>{title}</h3>
18
+ </div>
19
+ <div className={styles.content}>
20
+ {children}
21
+ </div>
22
+ </div>
23
+ )
24
+ }
@@ -1,24 +1 @@
1
- import React, { useState } from 'react'
2
- import SvgIcon from '../SvgIcon'
3
- import { AccordeonProps } from './Accordeon.types'
4
- import styles from './styles.module.scss'
5
-
6
- export default function Accordeon({
7
- title,
8
- children
9
- }: AccordeonProps) {
10
-
11
- const [isActive, setActive] = useState(false)
12
-
13
- return (
14
- <div className={[styles.container, isActive ? styles.active : styles.not_active].join(" ")}>
15
- <div className={styles.head} onClick={() => setActive(!isActive)}>
16
- <SvgIcon iconName="expand_more" />
17
- <h3>{title}</h3>
18
- </div>
19
- <div className={styles.content}>
20
- {children}
21
- </div>
22
- </div>
23
- )
24
- }
1
+ export * from './Accordeon';
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { DialogProps } from "./Dialog.types";
3
+ import styles from './styles.module.scss';
4
+
5
+
6
+
7
+ export function Dialog({
8
+ active = false,
9
+ onClose = (event: any) => { },
10
+ children = null
11
+ }: DialogProps) {
12
+
13
+ function onClick(event: any) {
14
+ if (event.target.id == 'dialog-backdrop') {
15
+ onClose(event)
16
+ }
17
+ }
18
+
19
+ return (
20
+ <div id="dialog-backdrop" className={`${styles.container} ${active ? styles.active : styles.disabled}`} onClick={onClick}>
21
+ <div className={styles.dialog_window}>
22
+ {children}
23
+ </div>
24
+ </div>
25
+ )
26
+ }
@@ -1,26 +1 @@
1
- import React from "react";
2
- import { DialogProps } from "./Dialog.types";
3
- import styles from './styles.module.scss';
4
-
5
-
6
-
7
- export default function Dialog({
8
- active = false,
9
- onClose = (event: any) => { },
10
- children = null
11
- }: DialogProps) {
12
-
13
- function onClick(event: any) {
14
- if (event.target.id == 'dialog-backdrop') {
15
- onClose(event)
16
- }
17
- }
18
-
19
- return (
20
- <div id="dialog-backdrop" className={`${styles.container} ${active ? styles.active : styles.disabled}`} onClick={onClick}>
21
- <div className={styles.dialog_window}>
22
- {children}
23
- </div>
24
- </div>
25
- )
26
- }
1
+ export * from './Dialog';
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import { GapProps } from "./Gap.types";
3
+
4
+
5
+ export function Gap({ size }: GapProps) {
6
+ return (
7
+ <div style={{ height: size }}></div>
8
+ )
9
+ }
@@ -1,9 +1 @@
1
- import React from "react";
2
- import { GapProps } from "./Gap.types";
3
-
4
-
5
- export default function Gap({ size }: GapProps) {
6
- return (
7
- <div style={{ height: size }}></div>
8
- )
9
- }
1
+ export * from './';
@@ -0,0 +1,19 @@
1
+ import "external-svg-loader";
2
+ import { SvgIconProps } from "./SvgIcon.types";
3
+
4
+
5
+ export function SvgIcon({
6
+ iconName,
7
+ size = "24px",
8
+ className = "",
9
+ onClick
10
+ }: SvgIconProps) {
11
+ return (
12
+ <>
13
+ <span onClick={onClick} className={`material-symbols-outlined ${className}`} style={{ fontSize: size }}>
14
+ {iconName}
15
+ </span >
16
+ Lib
17
+ </>
18
+ )
19
+ }
@@ -0,0 +1,2 @@
1
+
2
+ export * from './SvgIcon';
package/dist/cjs/index.js DELETED
@@ -1,2 +0,0 @@
1
- "use strict";require("react");
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface AccordeonProps {
2
- title?: string;
3
- children?: any;
4
- }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { AccordeonProps } from './Accordeon.types';
3
- export default function Accordeon({ title, children }: AccordeonProps): React.JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export interface DialogProps {
3
- active?: boolean;
4
- onClose?: (event: React.MouseEventHandler<HTMLDivElement>) => void;
5
- children: any;
6
- }
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { DialogProps } from "./Dialog.types";
3
- export default function Dialog({ active, onClose, children }: DialogProps): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- export interface GapProps {
2
- size?: string;
3
- }
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { GapProps } from "./Gap.types";
3
- export default function Gap({ size }: GapProps): React.JSX.Element;
@@ -1,8 +0,0 @@
1
- import { MouseEventHandler } from "react";
2
- export interface SvgIconProps {
3
- iconName?: string;
4
- size?: string;
5
- fill?: string;
6
- className?: string;
7
- onClick?: MouseEventHandler<HTMLSpanElement>;
8
- }
@@ -1,4 +0,0 @@
1
- import "external-svg-loader";
2
- import React from 'react';
3
- import { SvgIconProps } from "./SvgIcon.types";
4
- export default function SvgIcon({ iconName, size, className, onClick }: SvgIconProps): React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from './components';
package/dist/esm/index.js DELETED
@@ -1,2 +0,0 @@
1
- import"react";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,4 +0,0 @@
1
- export interface AccordeonProps {
2
- title?: string;
3
- children?: any;
4
- }
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import { AccordeonProps } from './Accordeon.types';
3
- export default function Accordeon({ title, children }: AccordeonProps): React.JSX.Element;
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- export interface DialogProps {
3
- active?: boolean;
4
- onClose?: (event: React.MouseEventHandler<HTMLDivElement>) => void;
5
- children: any;
6
- }
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { DialogProps } from "./Dialog.types";
3
- export default function Dialog({ active, onClose, children }: DialogProps): React.JSX.Element;
@@ -1,3 +0,0 @@
1
- export interface GapProps {
2
- size?: string;
3
- }
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- import { GapProps } from "./Gap.types";
3
- export default function Gap({ size }: GapProps): React.JSX.Element;
@@ -1,8 +0,0 @@
1
- import { MouseEventHandler } from "react";
2
- export interface SvgIconProps {
3
- iconName?: string;
4
- size?: string;
5
- fill?: string;
6
- className?: string;
7
- onClick?: MouseEventHandler<HTMLSpanElement>;
8
- }
@@ -1,4 +0,0 @@
1
- import "external-svg-loader";
2
- import React from 'react';
3
- import { SvgIconProps } from "./SvgIcon.types";
4
- export default function SvgIcon({ iconName, size, className, onClick }: SvgIconProps): React.JSX.Element;
@@ -1 +0,0 @@
1
- export * from './Gap';
@@ -1 +0,0 @@
1
- export * from './components';
package/dist/types.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
package/rollup.config.js DELETED
@@ -1,39 +0,0 @@
1
- import commonjs from "@rollup/plugin-commonjs";
2
- import resolve from "@rollup/plugin-node-resolve";
3
- import typescript from "@rollup/plugin-typescript";
4
- import dts from "rollup-plugin-dts";
5
- import peerDepsExternal from "rollup-plugin-peer-deps-external";
6
- import { terser } from "rollup-plugin-terser";
7
-
8
- const packageJson = require("./package.json");
9
-
10
- export default [
11
- {
12
- input: "src/index.ts",
13
- output: [
14
- {
15
- file: packageJson.main,
16
- format: "cjs",
17
- sourcemap: true,
18
- },
19
- {
20
- file: packageJson.module,
21
- format: "esm",
22
- sourcemap: true,
23
- },
24
- ],
25
- plugins: [
26
- peerDepsExternal(),
27
- resolve(),
28
- commonjs(),
29
- typescript({ tsconfig: "./tsconfig.json" }),
30
- terser(),
31
- ],
32
- external: ["react", "react-dom", "styled-components"],
33
- },
34
- {
35
- input: "src/index.ts",
36
- output: [{ file: "dist/types.d.ts", format: "es" }],
37
- plugins: [dts.default()],
38
- },
39
- ];
@@ -1,16 +0,0 @@
1
- import "external-svg-loader";
2
- import React from 'react';
3
- import { SvgIconProps } from "./SvgIcon.types";
4
-
5
-
6
- export default function SvgIcon({
7
- iconName,
8
- size = "24px",
9
- className = "",
10
- onClick
11
- }: SvgIconProps) {
12
- return (
13
- <span onClick={onClick} className={`material-symbols-outlined ${className}`} style={{ fontSize: size }
14
- }> {iconName}</span >
15
- )
16
- }
@@ -1,4 +0,0 @@
1
- declare module "*.module.scss" {
2
- const content: Record<string, string>;
3
- export default content;
4
- }
package/tsconfig.json DELETED
@@ -1,27 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "esModuleInterop": true,
4
- "strict": true,
5
- "skipLibCheck": true,
6
- "jsx": "react",
7
- "module": "ESNext",
8
- "declaration": true,
9
- "declarationDir": "types",
10
- "sourceMap": true,
11
- "outDir": "dist",
12
- "moduleResolution": "node",
13
- "emitDeclarationOnly": false,
14
- "allowSyntheticDefaultImports": true,
15
- "forceConsistentCasingInFileNames": true
16
- },
17
- "include": [
18
- "src/types/typings.d.ts",
19
- "src/**/*"
20
- ],
21
- "exclude": [
22
- "dist",
23
- "node_modules",
24
- "src/**/*.test.tsx",
25
- "src/**/*.stories.tsx"
26
- ]
27
- }