math-main-components 0.0.9 → 0.0.10
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/dist/components/Accordeon/Accordeon.d.ts +3 -0
- package/dist/components/Accordeon/Accordeon.types.d.ts +4 -0
- package/dist/components/Accordeon/index.d.ts +1 -0
- package/dist/components/Dialog/Dialog.d.ts +3 -0
- package/dist/components/Dialog/Dialog.types.d.ts +6 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Gap/Gap.d.ts +3 -0
- package/dist/components/Gap/Gap.types.d.ts +3 -0
- package/dist/components/Gap/index.d.ts +1 -0
- package/dist/components/SvgIcon/SvgIcon.d.ts +4 -0
- package/dist/components/SvgIcon/SvgIcon.types.d.ts +8 -0
- package/dist/components/SvgIcon/index.d.ts +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/index.cjs.js +79 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +68 -0
- package/package.json +9 -6
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Accordeon';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Dialog';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './Gap';
|
@@ -0,0 +1 @@
|
|
1
|
+
export * from './SvgIcon';
|
@@ -0,0 +1,79 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
4
|
+
|
5
|
+
var React = require('react');
|
6
|
+
require('external-svg-loader');
|
7
|
+
|
8
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
9
|
+
|
10
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
11
|
+
|
12
|
+
function SvgIcon({ iconName, size = "24px", className = "", onClick }) {
|
13
|
+
return (React__default["default"].createElement(React__default["default"].Fragment, null,
|
14
|
+
React__default["default"].createElement("span", { onClick: onClick, className: `material-symbols-outlined ${className}`, style: { fontSize: size } }, iconName),
|
15
|
+
"Lib"));
|
16
|
+
}
|
17
|
+
|
18
|
+
function styleInject(css, ref) {
|
19
|
+
if ( ref === void 0 ) ref = {};
|
20
|
+
var insertAt = ref.insertAt;
|
21
|
+
|
22
|
+
if (!css || typeof document === 'undefined') { return; }
|
23
|
+
|
24
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
25
|
+
var style = document.createElement('style');
|
26
|
+
style.type = 'text/css';
|
27
|
+
|
28
|
+
if (insertAt === 'top') {
|
29
|
+
if (head.firstChild) {
|
30
|
+
head.insertBefore(style, head.firstChild);
|
31
|
+
} else {
|
32
|
+
head.appendChild(style);
|
33
|
+
}
|
34
|
+
} else {
|
35
|
+
head.appendChild(style);
|
36
|
+
}
|
37
|
+
|
38
|
+
if (style.styleSheet) {
|
39
|
+
style.styleSheet.cssText = css;
|
40
|
+
} else {
|
41
|
+
style.appendChild(document.createTextNode(css));
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
var css_248z$1 = ".styles-module_container__3IVfB {\n margin-top: 40px;\n background: white;\n border-radius: 30px;\n transition: 0.2s ease-in-out;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 16px 20px;\n color: grey;\n background: #F1F1F1;\n border-radius: 30px;\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n transition: 0.2s ease-in-out;\n gap: 10px;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb span {\n transition: 0.2s ease-in-out;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb h3 {\n margin: 0;\n font-weight: 400;\n font-size: 16px;\n user-select: none;\n -webkit-user-select: none;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb:hover {\n background: #e2e2e2;\n}\n.styles-module_container__3IVfB.styles-module_active__soD8R {\n box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n.styles-module_container__3IVfB.styles-module_active__soD8R .styles-module_head__xFYQb span {\n rotate: 180deg;\n}\n.styles-module_container__3IVfB .styles-module_content__XAf02 {\n transition: all 0.3s ease-in-out;\n line-height: 1.5;\n}\n.styles-module_container__3IVfB.styles-module_not_active__JcVLz .styles-module_content__XAf02 {\n height: 0;\n max-height: 0;\n overflow: hidden;\n opacity: 0;\n}\n.styles-module_container__3IVfB.styles-module_active__soD8R .styles-module_content__XAf02 {\n max-height: auto;\n overflow: visible;\n opacity: 1;\n padding: 10px 0px;\n}";
|
46
|
+
var styles$1 = {"container":"styles-module_container__3IVfB","head":"styles-module_head__xFYQb","active":"styles-module_active__soD8R","content":"styles-module_content__XAf02","not_active":"styles-module_not_active__JcVLz"};
|
47
|
+
styleInject(css_248z$1);
|
48
|
+
|
49
|
+
function Accordeon({ title, children }) {
|
50
|
+
const [isActive, setActive] = React.useState(false);
|
51
|
+
return (React__default["default"].createElement("div", { className: [styles$1.container, isActive ? styles$1.active : styles$1.not_active].join(" ") },
|
52
|
+
React__default["default"].createElement("div", { className: styles$1.head, onClick: () => setActive(!isActive) },
|
53
|
+
React__default["default"].createElement(SvgIcon, { iconName: "expand_more" }),
|
54
|
+
React__default["default"].createElement("h3", null, title)),
|
55
|
+
React__default["default"].createElement("div", { className: styles$1.content }, children)));
|
56
|
+
}
|
57
|
+
|
58
|
+
var css_248z = ".styles-module_container__9-1MH {\n position: fixed;\n height: 100vh;\n width: 100vw;\n background: rgba(255, 255, 255, 0.659);\n backdrop-filter: blur(10px) brightness(70%);\n left: 0;\n top: 0;\n z-index: 10000;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.styles-module_container__9-1MH.styles-module_active__AXoyo {\n opacity: 1;\n}\n.styles-module_container__9-1MH.styles-module_disabled__sELpy {\n pointer-events: none;\n opacity: 0;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M {\n background: white;\n border-radius: 20px;\n padding: 20px;\n box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;\n cursor: auto;\n}";
|
59
|
+
var styles = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M"};
|
60
|
+
styleInject(css_248z);
|
61
|
+
|
62
|
+
function Dialog({ active = false, onClose = (event) => { }, children = null }) {
|
63
|
+
function onClick(event) {
|
64
|
+
if (event.target.id == 'dialog-backdrop') {
|
65
|
+
onClose(event);
|
66
|
+
}
|
67
|
+
}
|
68
|
+
return (React__default["default"].createElement("div", { id: "dialog-backdrop", className: `${styles.container} ${active ? styles.active : styles.disabled}`, onClick: onClick },
|
69
|
+
React__default["default"].createElement("div", { className: styles.dialog_window }, children)));
|
70
|
+
}
|
71
|
+
|
72
|
+
function Gap({ size }) {
|
73
|
+
return (React__default["default"].createElement("div", { style: { height: size } }));
|
74
|
+
}
|
75
|
+
|
76
|
+
exports.Accordeon = Accordeon;
|
77
|
+
exports.Dialog = Dialog;
|
78
|
+
exports.Gap = Gap;
|
79
|
+
exports.SvgIcon = SvgIcon;
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export { Accordeon, Dialog, Gap, SvgIcon } from './components';
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import React, { useState } from 'react';
|
2
|
+
import 'external-svg-loader';
|
3
|
+
|
4
|
+
function SvgIcon({ iconName, size = "24px", className = "", onClick }) {
|
5
|
+
return (React.createElement(React.Fragment, null,
|
6
|
+
React.createElement("span", { onClick: onClick, className: `material-symbols-outlined ${className}`, style: { fontSize: size } }, iconName),
|
7
|
+
"Lib"));
|
8
|
+
}
|
9
|
+
|
10
|
+
function styleInject(css, ref) {
|
11
|
+
if ( ref === void 0 ) ref = {};
|
12
|
+
var insertAt = ref.insertAt;
|
13
|
+
|
14
|
+
if (!css || typeof document === 'undefined') { return; }
|
15
|
+
|
16
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
17
|
+
var style = document.createElement('style');
|
18
|
+
style.type = 'text/css';
|
19
|
+
|
20
|
+
if (insertAt === 'top') {
|
21
|
+
if (head.firstChild) {
|
22
|
+
head.insertBefore(style, head.firstChild);
|
23
|
+
} else {
|
24
|
+
head.appendChild(style);
|
25
|
+
}
|
26
|
+
} else {
|
27
|
+
head.appendChild(style);
|
28
|
+
}
|
29
|
+
|
30
|
+
if (style.styleSheet) {
|
31
|
+
style.styleSheet.cssText = css;
|
32
|
+
} else {
|
33
|
+
style.appendChild(document.createTextNode(css));
|
34
|
+
}
|
35
|
+
}
|
36
|
+
|
37
|
+
var css_248z$1 = ".styles-module_container__3IVfB {\n margin-top: 40px;\n background: white;\n border-radius: 30px;\n transition: 0.2s ease-in-out;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb {\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 16px 20px;\n color: grey;\n background: #F1F1F1;\n border-radius: 30px;\n cursor: pointer;\n user-select: none;\n -webkit-user-select: none;\n transition: 0.2s ease-in-out;\n gap: 10px;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb span {\n transition: 0.2s ease-in-out;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb h3 {\n margin: 0;\n font-weight: 400;\n font-size: 16px;\n user-select: none;\n -webkit-user-select: none;\n}\n.styles-module_container__3IVfB .styles-module_head__xFYQb:hover {\n background: #e2e2e2;\n}\n.styles-module_container__3IVfB.styles-module_active__soD8R {\n box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;\n}\n.styles-module_container__3IVfB.styles-module_active__soD8R .styles-module_head__xFYQb span {\n rotate: 180deg;\n}\n.styles-module_container__3IVfB .styles-module_content__XAf02 {\n transition: all 0.3s ease-in-out;\n line-height: 1.5;\n}\n.styles-module_container__3IVfB.styles-module_not_active__JcVLz .styles-module_content__XAf02 {\n height: 0;\n max-height: 0;\n overflow: hidden;\n opacity: 0;\n}\n.styles-module_container__3IVfB.styles-module_active__soD8R .styles-module_content__XAf02 {\n max-height: auto;\n overflow: visible;\n opacity: 1;\n padding: 10px 0px;\n}";
|
38
|
+
var styles$1 = {"container":"styles-module_container__3IVfB","head":"styles-module_head__xFYQb","active":"styles-module_active__soD8R","content":"styles-module_content__XAf02","not_active":"styles-module_not_active__JcVLz"};
|
39
|
+
styleInject(css_248z$1);
|
40
|
+
|
41
|
+
function Accordeon({ title, children }) {
|
42
|
+
const [isActive, setActive] = useState(false);
|
43
|
+
return (React.createElement("div", { className: [styles$1.container, isActive ? styles$1.active : styles$1.not_active].join(" ") },
|
44
|
+
React.createElement("div", { className: styles$1.head, onClick: () => setActive(!isActive) },
|
45
|
+
React.createElement(SvgIcon, { iconName: "expand_more" }),
|
46
|
+
React.createElement("h3", null, title)),
|
47
|
+
React.createElement("div", { className: styles$1.content }, children)));
|
48
|
+
}
|
49
|
+
|
50
|
+
var css_248z = ".styles-module_container__9-1MH {\n position: fixed;\n height: 100vh;\n width: 100vw;\n background: rgba(255, 255, 255, 0.659);\n backdrop-filter: blur(10px) brightness(70%);\n left: 0;\n top: 0;\n z-index: 10000;\n display: flex;\n flex-direction: row;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n}\n.styles-module_container__9-1MH.styles-module_active__AXoyo {\n opacity: 1;\n}\n.styles-module_container__9-1MH.styles-module_disabled__sELpy {\n pointer-events: none;\n opacity: 0;\n}\n.styles-module_container__9-1MH .styles-module_dialog_window__0Bn2M {\n background: white;\n border-radius: 20px;\n padding: 20px;\n box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;\n cursor: auto;\n}";
|
51
|
+
var styles = {"container":"styles-module_container__9-1MH","active":"styles-module_active__AXoyo","disabled":"styles-module_disabled__sELpy","dialog_window":"styles-module_dialog_window__0Bn2M"};
|
52
|
+
styleInject(css_248z);
|
53
|
+
|
54
|
+
function Dialog({ active = false, onClose = (event) => { }, children = null }) {
|
55
|
+
function onClick(event) {
|
56
|
+
if (event.target.id == 'dialog-backdrop') {
|
57
|
+
onClose(event);
|
58
|
+
}
|
59
|
+
}
|
60
|
+
return (React.createElement("div", { id: "dialog-backdrop", className: `${styles.container} ${active ? styles.active : styles.disabled}`, onClick: onClick },
|
61
|
+
React.createElement("div", { className: styles.dialog_window }, children)));
|
62
|
+
}
|
63
|
+
|
64
|
+
function Gap({ size }) {
|
65
|
+
return (React.createElement("div", { style: { height: size } }));
|
66
|
+
}
|
67
|
+
|
68
|
+
export { Accordeon, Dialog, Gap, SvgIcon };
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "math-main-components",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.10",
|
4
4
|
"author": "Emilian Scheel",
|
5
5
|
"files": [
|
6
6
|
"dist/**/*"
|
@@ -10,22 +10,24 @@
|
|
10
10
|
"types": "dist/index.d.ts",
|
11
11
|
"license": "MIT",
|
12
12
|
"devDependencies": {
|
13
|
+
"@babel/core": "^7.22.20",
|
13
14
|
"@rollup/plugin-commonjs": "^22.0.1",
|
14
15
|
"@rollup/plugin-node-resolve": "^13.3.0",
|
15
16
|
"@rollup/plugin-typescript": "^8.3.4",
|
16
17
|
"@types/react": "^18.0.15",
|
17
18
|
"@types/react-dom": "^18.0.6",
|
18
19
|
"autoprefixer": "^10.4.7",
|
20
|
+
"babel": "^6.23.0",
|
21
|
+
"babel-loader": "^9.1.3",
|
19
22
|
"postcss": "^8.4.14",
|
20
23
|
"postcss-modules": "^4.3.1",
|
21
|
-
"postcss-preset-env": "^7.6.0",
|
22
24
|
"rollup": "^2.77.2",
|
23
25
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
24
26
|
"rollup-plugin-postcss": "^4.0.2",
|
25
27
|
"sass": "^1.51.0",
|
26
28
|
"string-hash": "^1.1.3",
|
27
|
-
"typescript": "^
|
28
|
-
"typescript-plugin-css-modules": "^
|
29
|
+
"typescript": "^5.2.2",
|
30
|
+
"typescript-plugin-css-modules": "^5.0.1"
|
29
31
|
},
|
30
32
|
"peerDependencies": {
|
31
33
|
"react": "^17.0.2",
|
@@ -33,8 +35,9 @@
|
|
33
35
|
},
|
34
36
|
"scripts": {
|
35
37
|
"clean": "rm -rf dist",
|
36
|
-
"build": "npm run build:js && build:types",
|
38
|
+
"build": "npm run build:js && npm run build:types",
|
37
39
|
"build:js": "rollup -c",
|
38
40
|
"build:types": "tsc --emitDeclarationOnly --outDir dist"
|
39
|
-
}
|
41
|
+
},
|
42
|
+
"dependencies": {}
|
40
43
|
}
|