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.
- package/README.md +7 -0
- package/package.json +10 -17
- package/src/components/Accordeon/Accordeon.tsx +24 -0
- package/src/components/Accordeon/index.tsx +1 -24
- package/src/components/Dialog/Dialog.tsx +26 -0
- package/src/components/Dialog/index.tsx +1 -26
- package/src/components/Gap/Gap.tsx +9 -0
- package/src/components/Gap/index.tsx +1 -9
- package/src/components/SvgIcon/SvgIcon.tsx +19 -0
- package/src/components/SvgIcon/index.ts +2 -0
- package/dist/cjs/index.js +0 -2
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/types/components/Accordeon/Accordeon.types.d.ts +0 -4
- package/dist/cjs/types/components/Accordeon/index.d.ts +0 -3
- package/dist/cjs/types/components/Dialog/Dialog.types.d.ts +0 -6
- package/dist/cjs/types/components/Dialog/index.d.ts +0 -3
- package/dist/cjs/types/components/Gap/Gap.types.d.ts +0 -3
- package/dist/cjs/types/components/Gap/index.d.ts +0 -3
- package/dist/cjs/types/components/SvgIcon/SvgIcon.types.d.ts +0 -8
- package/dist/cjs/types/components/SvgIcon/index.d.ts +0 -4
- package/dist/cjs/types/index.d.ts +0 -1
- package/dist/esm/index.js +0 -2
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/types/components/Accordeon/Accordeon.types.d.ts +0 -4
- package/dist/esm/types/components/Accordeon/index.d.ts +0 -3
- package/dist/esm/types/components/Dialog/Dialog.types.d.ts +0 -6
- package/dist/esm/types/components/Dialog/index.d.ts +0 -3
- package/dist/esm/types/components/Gap/Gap.types.d.ts +0 -3
- package/dist/esm/types/components/Gap/index.d.ts +0 -3
- package/dist/esm/types/components/SvgIcon/SvgIcon.types.d.ts +0 -8
- package/dist/esm/types/components/SvgIcon/index.d.ts +0 -4
- package/dist/esm/types/components/index.d.ts +0 -1
- package/dist/esm/types/index.d.ts +0 -1
- package/dist/types.d.ts +0 -2
- package/rollup.config.js +0 -39
- package/src/components/SvgIcon/index.tsx +0 -16
- package/src/types/typings.d.ts +0 -4
- package/tsconfig.json +0 -27
- package/yarn-error.log +0 -2108
- /package/{dist/cjs/types → src}/components/index.d.ts +0 -0
package/README.md
ADDED
package/package.json
CHANGED
@@ -1,31 +1,24 @@
|
|
1
1
|
{
|
2
2
|
"name": "math-main-components",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.4",
|
4
4
|
"author": "Emilian Scheel",
|
5
5
|
"license": "MIT",
|
6
|
-
"main": "
|
7
|
-
"
|
8
|
-
|
9
|
-
|
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
|
-
"
|
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
|
-
|
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
|
-
|
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,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
|
+
}
|
package/dist/cjs/index.js
DELETED
package/dist/cjs/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components';
|
package/dist/esm/index.js
DELETED
package/dist/esm/index.js.map
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './Gap';
|
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components';
|
package/dist/types.d.ts
DELETED
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
|
-
}
|
package/src/types/typings.d.ts
DELETED
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
|
-
}
|