@yakad/ui 1.0.0 → 1.0.1
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/declaration.d.ts +1 -0
- package/dist/appBar/appBar.d.ts +3 -0
- package/dist/appBar/appBar.js +9 -0
- package/dist/appBar/appBar.js.map +1 -0
- package/dist/button/button.d.ts +9 -0
- package/dist/button/button.js +17 -0
- package/dist/button/button.js.map +1 -0
- package/dist/card/card.d.ts +3 -0
- package/dist/card/card.js +9 -0
- package/dist/card/card.js.map +1 -0
- package/dist/clickAwayListener/clickAwayListener.d.ts +6 -0
- package/dist/clickAwayListener/clickAwayListener.js +17 -0
- package/dist/clickAwayListener/clickAwayListener.js.map +1 -0
- package/dist/container/container.d.ts +7 -0
- package/dist/container/container.js +9 -0
- package/dist/container/container.js.map +1 -0
- package/dist/footer/footer.d.ts +3 -0
- package/dist/footer/footer.js +8 -0
- package/dist/footer/footer.js.map +1 -0
- package/dist/form/form.d.ts +3 -0
- package/dist/form/form.js +12 -0
- package/dist/form/form.js.map +1 -0
- package/dist/gridContainer/gridContainer.d.ts +12 -0
- package/dist/gridContainer/gridContainer.js +11 -0
- package/dist/gridContainer/gridContainer.js.map +1 -0
- package/dist/gridItem/gridItem.d.ts +10 -0
- package/dist/gridItem/gridItem.js +9 -0
- package/dist/gridItem/gridItem.js.map +1 -0
- package/dist/historyBack/historyBack.d.ts +3 -0
- package/dist/historyBack/historyBack.js +11 -0
- package/dist/historyBack/historyBack.js.map +1 -0
- package/dist/hr/hr.d.ts +8 -0
- package/dist/hr/hr.js +12 -0
- package/dist/hr/hr.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/list/list.d.ts +7 -0
- package/dist/list/list.js +9 -0
- package/dist/list/list.js.map +1 -0
- package/dist/listItem/listItem.d.ts +3 -0
- package/dist/listItem/listItem.js +7 -0
- package/dist/listItem/listItem.js.map +1 -0
- package/dist/main/main.d.ts +6 -0
- package/dist/main/main.js +10 -0
- package/dist/main/main.js.map +1 -0
- package/dist/navigation/navigation.d.ts +7 -0
- package/dist/navigation/navigation.js +9 -0
- package/dist/navigation/navigation.js.map +1 -0
- package/dist/page/page.d.ts +3 -0
- package/dist/page/page.js +9 -0
- package/dist/page/page.js.map +1 -0
- package/dist/row/row.d.ts +3 -0
- package/dist/row/row.js +9 -0
- package/dist/row/row.js.map +1 -0
- package/dist/spacer/spacer.d.ts +3 -0
- package/dist/spacer/spacer.js +7 -0
- package/dist/spacer/spacer.js.map +1 -0
- package/dist/src/appBar/appBar.d.ts +3 -0
- package/dist/src/appBar/appBar.js +9 -0
- package/dist/src/appBar/appBar.js.map +1 -0
- package/dist/src/button/button.d.ts +9 -0
- package/dist/src/button/button.js +19 -0
- package/dist/src/button/button.js.map +1 -0
- package/dist/src/card/card.d.ts +3 -0
- package/dist/src/card/card.js +9 -0
- package/dist/src/card/card.js.map +1 -0
- package/dist/src/clickAwayListener/clickAwayListener.d.ts +6 -0
- package/dist/src/clickAwayListener/clickAwayListener.js +17 -0
- package/dist/src/clickAwayListener/clickAwayListener.js.map +1 -0
- package/dist/src/container/container.d.ts +7 -0
- package/dist/src/container/container.js +9 -0
- package/dist/src/container/container.js.map +1 -0
- package/dist/src/footer/footer.d.ts +3 -0
- package/dist/src/footer/footer.js +9 -0
- package/dist/src/footer/footer.js.map +1 -0
- package/dist/src/form/form.d.ts +3 -0
- package/dist/src/form/form.js +12 -0
- package/dist/src/form/form.js.map +1 -0
- package/dist/src/gridContainer/gridContainer.d.ts +12 -0
- package/dist/src/gridContainer/gridContainer.js +11 -0
- package/dist/src/gridContainer/gridContainer.js.map +1 -0
- package/dist/src/gridItem/gridItem.d.ts +10 -0
- package/dist/src/gridItem/gridItem.js +9 -0
- package/dist/src/gridItem/gridItem.js.map +1 -0
- package/dist/src/historyBack/historyBack.d.ts +3 -0
- package/dist/src/historyBack/historyBack.js +11 -0
- package/dist/src/historyBack/historyBack.js.map +1 -0
- package/dist/src/hr/hr.d.ts +8 -0
- package/dist/src/hr/hr.js +12 -0
- package/dist/src/hr/hr.js.map +1 -0
- package/dist/src/list/list.d.ts +7 -0
- package/dist/src/list/list.js +9 -0
- package/dist/src/list/list.js.map +1 -0
- package/dist/src/listItem/listItem.d.ts +3 -0
- package/dist/src/listItem/listItem.js +7 -0
- package/dist/src/listItem/listItem.js.map +1 -0
- package/dist/src/main/main.d.ts +6 -0
- package/dist/src/main/main.js +10 -0
- package/dist/src/main/main.js.map +1 -0
- package/dist/src/navigation/navigation.d.ts +7 -0
- package/dist/src/navigation/navigation.js +9 -0
- package/dist/src/navigation/navigation.js.map +1 -0
- package/dist/src/page/page.d.ts +3 -0
- package/dist/src/page/page.js +9 -0
- package/dist/src/page/page.js.map +1 -0
- package/dist/src/row/row.d.ts +3 -0
- package/dist/src/row/row.js +9 -0
- package/dist/src/row/row.js.map +1 -0
- package/dist/src/spacer/spacer.d.ts +3 -0
- package/dist/src/spacer/spacer.js +7 -0
- package/dist/src/spacer/spacer.js.map +1 -0
- package/dist/src/stack/stack.d.ts +3 -0
- package/dist/src/stack/stack.js +9 -0
- package/dist/src/stack/stack.js.map +1 -0
- package/dist/src/svgIcon/svgIcon.d.ts +6 -0
- package/dist/src/svgIcon/svgIcon.js +12 -0
- package/dist/src/svgIcon/svgIcon.js.map +1 -0
- package/dist/stack/stack.d.ts +3 -0
- package/dist/stack/stack.js +9 -0
- package/dist/stack/stack.js.map +1 -0
- package/dist/svgIcon/svgIcon.d.ts +6 -0
- package/dist/svgIcon/svgIcon.js +12 -0
- package/dist/svgIcon/svgIcon.js.map +1 -0
- package/package.json +18 -11
- package/{appBar → src/appBar}/appBar.module.css +15 -15
- package/src/appBar/appBar.tsx +15 -0
- package/{button → src/button}/button.module.css +87 -87
- package/src/button/button.tsx +49 -0
- package/{card → src/card}/card.module.css +12 -12
- package/src/card/card.tsx +15 -0
- package/{clickAwayListener → src/clickAwayListener}/clickAwayListener.tsx +27 -27
- package/{container → src/container}/container.module.css +23 -23
- package/src/container/container.tsx +25 -0
- package/{footer → src/footer}/footer.module.css +6 -6
- package/src/footer/footer.tsx +15 -0
- package/{form → src/form}/form.module.css +6 -6
- package/src/form/form.tsx +23 -0
- package/{gridContainer → src/gridContainer}/gridContainer.module.css +4 -4
- package/src/gridContainer/gridContainer.tsx +34 -0
- package/{gridItem → src/gridItem}/gridItem.module.css +0 -0
- package/src/gridItem/gridItem.tsx +27 -0
- package/{historyBack → src/historyBack}/historyBack.tsx +20 -20
- package/{hr → src/hr}/hr.module.css +18 -18
- package/src/hr/hr.tsx +32 -0
- package/{index.tsx → src/index.tsx} +43 -43
- package/{list → src/list}/list.module.css +22 -22
- package/src/list/list.tsx +25 -0
- package/{listItem → src/listItem}/listItem.module.css +6 -6
- package/src/listItem/listItem.tsx +12 -0
- package/{main → src/main}/main.module.css +19 -19
- package/src/main/main.tsx +25 -0
- package/{navigation → src/navigation}/navigation.module.css +56 -56
- package/src/navigation/navigation.tsx +24 -0
- package/{page → src/page}/page.module.css +9 -9
- package/src/page/page.tsx +15 -0
- package/{row → src/row}/row.module.css +7 -7
- package/src/row/row.tsx +15 -0
- package/{spacer → src/spacer}/spacer.module.css +5 -5
- package/{spacer → src/spacer}/spacer.tsx +8 -8
- package/{stack → src/stack}/stack.module.css +6 -6
- package/src/stack/stack.tsx +15 -0
- package/{svgIcon → src/svgIcon}/svgIcon.module.css +5 -5
- package/src/svgIcon/svgIcon.tsx +26 -0
- package/tsconfig.json +22 -0
- package/appBar/appBar.tsx +0 -15
- package/button/button.tsx +0 -53
- package/card/card.tsx +0 -15
- package/container/container.tsx +0 -25
- package/footer/footer.tsx +0 -15
- package/form/form.tsx +0 -23
- package/gridContainer/gridContainer.tsx +0 -34
- package/gridItem/gridItem.tsx +0 -27
- package/hr/hr.tsx +0 -34
- package/list/list.tsx +0 -25
- package/listItem/listItem.tsx +0 -13
- package/main/main.tsx +0 -25
- package/navigation/navigation.tsx +0 -24
- package/page/page.tsx +0 -15
- package/row/row.tsx +0 -15
- package/stack/stack.tsx +0 -15
- package/svgIcon/svgIcon.tsx +0 -26
package/container/container.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./container.module.css";
|
|
4
|
-
|
|
5
|
-
type ScreenSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
6
|
-
|
|
7
|
-
interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
|
-
maxWidth?: ScreenSize;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function Container(props: ContainerProps) {
|
|
12
|
-
const joinedClassNames = joinClassNames(
|
|
13
|
-
props.maxWidth ? styles[props.maxWidth] : "",
|
|
14
|
-
styles.container,
|
|
15
|
-
props.className!
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<div {...props} className={joinedClassNames}>
|
|
20
|
-
{props.children}
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Container;
|
package/footer/footer.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./footer.module.css";
|
|
4
|
-
|
|
5
|
-
function Footer(props: React.HTMLAttributes<HTMLElement>) {
|
|
6
|
-
const joinedClassNames = joinClassNames(styles.footer, props.className!);
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<footer {...props} className={joinedClassNames}>
|
|
10
|
-
{props.children}
|
|
11
|
-
</footer>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Footer;
|
package/form/form.tsx
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./form.module.css";
|
|
4
|
-
|
|
5
|
-
function Form(props: React.HTMLAttributes<HTMLFormElement>) {
|
|
6
|
-
const joinedClassNames = joinClassNames(styles.form, props.className!);
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<form
|
|
10
|
-
{...props}
|
|
11
|
-
className={joinedClassNames}
|
|
12
|
-
onSubmit={(e) => {
|
|
13
|
-
e.preventDefault();
|
|
14
|
-
|
|
15
|
-
props.onSubmit!(null as any);
|
|
16
|
-
}}
|
|
17
|
-
>
|
|
18
|
-
{props.children}
|
|
19
|
-
</form>
|
|
20
|
-
);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default Form;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./gridContainer.module.css";
|
|
4
|
-
|
|
5
|
-
interface GridContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
xs?: number;
|
|
7
|
-
sm?: number;
|
|
8
|
-
md?: number;
|
|
9
|
-
lg?: number;
|
|
10
|
-
xl?: number;
|
|
11
|
-
rowGap?: number;
|
|
12
|
-
columnGap?: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Custom Button Element
|
|
16
|
-
function GridContainer(props: GridContainerProps) {
|
|
17
|
-
const joinedClassNames = joinClassNames(
|
|
18
|
-
styles.gridcontainer,
|
|
19
|
-
props.className!
|
|
20
|
-
);
|
|
21
|
-
const joinedStyles = joinStyles(
|
|
22
|
-
props.xl ? { gridTemplateColumns: " 1fr".repeat(props.xl) } : {},
|
|
23
|
-
{ columnGap: props.columnGap ? props.columnGap + "rem" : "1.5rem" },
|
|
24
|
-
{ rowGap: props.rowGap ? props.rowGap + "rem" : "1.5rem" },
|
|
25
|
-
props.style!
|
|
26
|
-
);
|
|
27
|
-
return (
|
|
28
|
-
<div {...props} className={joinedClassNames} style={joinedStyles}>
|
|
29
|
-
{props.children}
|
|
30
|
-
</div>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default GridContainer;
|
package/gridItem/gridItem.tsx
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./gridItem.module.css";
|
|
4
|
-
|
|
5
|
-
interface GridItemProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
xs?: number;
|
|
7
|
-
sm?: number;
|
|
8
|
-
md?: number;
|
|
9
|
-
lg?: number;
|
|
10
|
-
xl?: number;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Custom Button Element
|
|
14
|
-
function GridItem(props: GridItemProps) {
|
|
15
|
-
const joinedStyles = joinStyles(
|
|
16
|
-
props.xl ? { gridColumn: "span " + props.xl } : {},
|
|
17
|
-
props.style!
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
return (
|
|
21
|
-
<div {...props} style={joinedStyles}>
|
|
22
|
-
{props.children}
|
|
23
|
-
</div>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default GridItem;
|
package/hr/hr.tsx
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./hr.module.css";
|
|
4
|
-
|
|
5
|
-
interface HrProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
-
variant?: "dotted" | "dashed" | "shortLine";
|
|
7
|
-
height?: number;
|
|
8
|
-
marginTopBottom?: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function Hr(props: HrProps) {
|
|
12
|
-
const joinedClassNames = joinClassNames(
|
|
13
|
-
styles.hr,
|
|
14
|
-
props.variant ? styles[props.variant] : "",
|
|
15
|
-
props.className!
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
const joinedStyles = joinStyles(
|
|
19
|
-
props.height ? { borderTopWidth: props.height + "rem" } : {},
|
|
20
|
-
props.marginTopBottom
|
|
21
|
-
? joinStyles(
|
|
22
|
-
{ marginTop: props.marginTopBottom + "rem" },
|
|
23
|
-
{ marginBottom: props.marginTopBottom + "rem" }
|
|
24
|
-
)
|
|
25
|
-
: {},
|
|
26
|
-
props.style!
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<hr {...props} className={joinedClassNames} style={joinedStyles}></hr>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default Hr;
|
package/list/list.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames } from "library";
|
|
3
|
-
import styles from "./list.module.css";
|
|
4
|
-
|
|
5
|
-
interface ListProps extends React.HTMLAttributes<HTMLUListElement> {
|
|
6
|
-
direction?: "row" | "column";
|
|
7
|
-
collapsed?: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function List(props: ListProps) {
|
|
11
|
-
const joinedClassNames = joinClassNames(
|
|
12
|
-
styles.list,
|
|
13
|
-
props.direction ? styles[props.direction] : styles.row,
|
|
14
|
-
props.collapsed ? styles.collapsed : "",
|
|
15
|
-
props.className!
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<ul {...props} className={joinedClassNames}>
|
|
20
|
-
{props.children}
|
|
21
|
-
</ul>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default List;
|
package/listItem/listItem.tsx
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { listenerCount } from "process";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import styles from "./listItem.module.css";
|
|
4
|
-
|
|
5
|
-
function ListItem(props: React.HTMLAttributes<HTMLLIElement>) {
|
|
6
|
-
return (
|
|
7
|
-
<li className={styles.listItem} {...props}>
|
|
8
|
-
{props.children}
|
|
9
|
-
</li>
|
|
10
|
-
);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export default ListItem;
|
package/main/main.tsx
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./main.module.css";
|
|
4
|
-
|
|
5
|
-
interface MainProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
navOpen?: boolean;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function Main(props: MainProps) {
|
|
10
|
-
const navOpenClass = props.navOpen ? styles.navOpen : "";
|
|
11
|
-
|
|
12
|
-
const joinedClassNames = joinClassNames(
|
|
13
|
-
styles.main,
|
|
14
|
-
navOpenClass,
|
|
15
|
-
props.className!
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<main {...props} className={joinedClassNames}>
|
|
20
|
-
{props.children}
|
|
21
|
-
</main>
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export default Main;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames } from "library";
|
|
3
|
-
import styles from "./navigation.module.css";
|
|
4
|
-
|
|
5
|
-
interface NavigationProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
-
anchor?: "left" | "right" | "top" | "bottom" | "auto";
|
|
7
|
-
open: boolean;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function Navigation(props: NavigationProps) {
|
|
11
|
-
const joinedClassNames = joinClassNames(
|
|
12
|
-
styles.navigation,
|
|
13
|
-
props.anchor ? styles[props.anchor] : styles.auto,
|
|
14
|
-
props.open ? styles.open : ""
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
return (
|
|
18
|
-
<nav {...props} className={joinedClassNames}>
|
|
19
|
-
{props.children}
|
|
20
|
-
</nav>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default Navigation;
|
package/page/page.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./page.module.css";
|
|
4
|
-
|
|
5
|
-
function Page(props: React.HTMLAttributes<HTMLDivElement>) {
|
|
6
|
-
const joinedClassNames = joinClassNames(styles.page, props.className!);
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div {...props} className={joinedClassNames}>
|
|
10
|
-
{props.children}
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Page;
|
package/row/row.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./row.module.css";
|
|
4
|
-
|
|
5
|
-
function Row(props: React.HTMLAttributes<HTMLDivElement>) {
|
|
6
|
-
const joinedClassNames = joinClassNames(styles.row, props.className!);
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div {...props} className={joinedClassNames}>
|
|
10
|
-
{props.children}
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Row;
|
package/stack/stack.tsx
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./stack.module.css";
|
|
4
|
-
|
|
5
|
-
function Stack(props: React.HTMLAttributes<HTMLDivElement>) {
|
|
6
|
-
const joinedClassNames = joinClassNames(styles.stack, props.className!);
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<div {...props} className={joinedClassNames}>
|
|
10
|
-
{props.children}
|
|
11
|
-
</div>
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default Stack;
|
package/svgIcon/svgIcon.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { joinClassNames, joinStyles } from "library";
|
|
3
|
-
import styles from "./svgIcon.module.css";
|
|
4
|
-
|
|
5
|
-
interface SvgIconProps extends React.HTMLAttributes<HTMLElement> {
|
|
6
|
-
size?: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function SvgIcon(props: SvgIconProps) {
|
|
10
|
-
const joinedClassNames = joinClassNames(styles.svg, props.className!);
|
|
11
|
-
|
|
12
|
-
const joinedStyles = joinStyles(
|
|
13
|
-
props.size
|
|
14
|
-
? { width: props.size + "rem", height: props.size + "rem" }
|
|
15
|
-
: { width: "2.4rem", height: "2.4rem" },
|
|
16
|
-
props.style!
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<div {...props} className={joinedClassNames} style={joinedStyles}>
|
|
21
|
-
{props.children}
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default SvgIcon;
|