math-main-components 0.0.8 → 0.0.9

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/package.json CHANGED
@@ -1,27 +1,40 @@
1
1
  {
2
2
  "name": "math-main-components",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "author": "Emilian Scheel",
5
- "license": "MIT",
6
- "main": "src/index.ts",
7
5
  "files": [
8
- "src/**/*"
6
+ "dist/**/*"
9
7
  ],
10
- "dependencies": {
11
- "@tsconfig/recommended": "^1.0.3",
12
- "@types/react": "^18.2.22",
13
- "css-loader": "^6.8.1",
14
- "css-modules-typescript-loader": "^4.0.1",
15
- "node-sass": "^9.0.0",
16
- "prop-types": "^15.8.1",
17
- "react": "^18.2.0",
18
- "react-dom": "^18.2.0",
19
- "sass": "^1.67.0",
20
- "sass-loader": "^13.3.2",
21
- "style-loader": "^3.3.3",
22
- "ts-loader": "^9.4.4",
23
- "tsc": "^2.0.4",
24
- "typescript": "^5.2.2",
25
- "webpack": "^5.88.2"
8
+ "main": "dist/index.cjs.js",
9
+ "module": "dist/index.esm.js",
10
+ "types": "dist/index.d.ts",
11
+ "license": "MIT",
12
+ "devDependencies": {
13
+ "@rollup/plugin-commonjs": "^22.0.1",
14
+ "@rollup/plugin-node-resolve": "^13.3.0",
15
+ "@rollup/plugin-typescript": "^8.3.4",
16
+ "@types/react": "^18.0.15",
17
+ "@types/react-dom": "^18.0.6",
18
+ "autoprefixer": "^10.4.7",
19
+ "postcss": "^8.4.14",
20
+ "postcss-modules": "^4.3.1",
21
+ "postcss-preset-env": "^7.6.0",
22
+ "rollup": "^2.77.2",
23
+ "rollup-plugin-peer-deps-external": "^2.2.4",
24
+ "rollup-plugin-postcss": "^4.0.2",
25
+ "sass": "^1.51.0",
26
+ "string-hash": "^1.1.3",
27
+ "typescript": "^4.7.4",
28
+ "typescript-plugin-css-modules": "^3.4.0"
29
+ },
30
+ "peerDependencies": {
31
+ "react": "^17.0.2",
32
+ "react-dom": "^17.0.2"
33
+ },
34
+ "scripts": {
35
+ "clean": "rm -rf dist",
36
+ "build": "npm run build:js && build:types",
37
+ "build:js": "rollup -c",
38
+ "build:types": "tsc --emitDeclarationOnly --outDir dist"
26
39
  }
27
40
  }
@@ -1,24 +0,0 @@
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,4 +0,0 @@
1
- export interface AccordeonProps {
2
- title?: string,
3
- children?: any
4
- }
@@ -1 +0,0 @@
1
- export * from './Accordeon';
@@ -1,66 +0,0 @@
1
- .container {
2
- margin-top: 40px;
3
- background: white;
4
- border-radius: 30px;
5
- transition: 0.2s ease-in-out;
6
-
7
- .head {
8
- display: flex;
9
- flex-direction: row;
10
- align-items: center;
11
- padding: 16px 20px;
12
- color: grey;
13
- background: #F1F1F1;
14
- border-radius: 30px;
15
- cursor: pointer;
16
- user-select: none;
17
- -webkit-user-select: none;
18
- transition: 0.2s ease-in-out;
19
-
20
- gap: 10px;
21
-
22
- span {
23
- transition: 0.2s ease-in-out;
24
- }
25
-
26
- h3 {
27
- margin: 0;
28
- font-weight: 400;
29
- font-size: 16px;
30
- user-select: none;
31
- -webkit-user-select: none;
32
- }
33
-
34
- &:hover {
35
- background: #e2e2e2;
36
- }
37
- }
38
-
39
- &.active {
40
- box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px,
41
- rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
42
- }
43
-
44
- &.active .head span {
45
- rotate: 180deg;
46
- }
47
-
48
- .content {
49
- transition: all 0.3s ease-in-out;
50
- line-height: 1.5;
51
- }
52
-
53
- &.not_active .content {
54
- height: 0;
55
- max-height: 0;
56
- overflow: hidden;
57
- opacity: 0;
58
- }
59
-
60
- &.active .content {
61
- max-height: auto;
62
- overflow: visible;
63
- opacity: 1;
64
- padding: 10px 0px;
65
- }
66
- }
@@ -1,26 +0,0 @@
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,5 +0,0 @@
1
- export interface DialogProps {
2
- active?: boolean
3
- onClose?: (event: React.MouseEventHandler<HTMLDivElement>) => void
4
- children: any
5
- }
@@ -1 +0,0 @@
1
- export * from './Dialog';
@@ -1,32 +0,0 @@
1
- .container {
2
- position: fixed;
3
- height: 100vh;
4
- width: 100vw;
5
- background: rgba(255, 255, 255, 0.659);
6
- backdrop-filter: blur(10px) brightness(70%);
7
- left: 0;
8
- top: 0;
9
- z-index: 10000;
10
- display: flex;
11
- flex-direction: row;
12
- align-items: center;
13
- justify-content: center;
14
- cursor: pointer;
15
-
16
- &.active {
17
- opacity: 1;
18
- }
19
-
20
- &.disabled {
21
- pointer-events: none;
22
- opacity: 0;
23
- }
24
-
25
- .dialog_window {
26
- background: white;
27
- border-radius: 20px;
28
- padding: 20px;
29
- box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
30
- cursor: auto;
31
- }
32
- }
@@ -1,9 +0,0 @@
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,3 +0,0 @@
1
- export interface GapProps {
2
- size?: string;
3
- }
@@ -1 +0,0 @@
1
- export * from './';
@@ -1,19 +0,0 @@
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
- }
@@ -1,9 +0,0 @@
1
- import { MouseEventHandler } from "react"
2
-
3
- export interface SvgIconProps {
4
- iconName?: string
5
- size?: string
6
- fill?: string
7
- className?: string
8
- onClick?: MouseEventHandler<HTMLSpanElement>
9
- }
@@ -1,2 +0,0 @@
1
-
2
- export * from './SvgIcon';
@@ -1,5 +0,0 @@
1
- export * from './Accordeon';
2
- export * from './Dialog';
3
- export * from './Gap';
4
- export * from './SvgIcon';
5
-
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from './components';
@@ -1,4 +0,0 @@
1
- declare module '*.scss' {
2
- const content: Record<string, string>;
3
- export default content;
4
- }