@yakad/ui 1.0.0

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.
@@ -0,0 +1,15 @@
1
+ .header {
2
+ display: flex;
3
+ flex-direction: row;
4
+ align-items: center;
5
+ box-sizing: border-box;
6
+ gap: 1.5rem;
7
+ width: 100%;
8
+ height: 5rem;
9
+ padding: 0 2rem;
10
+ border-bottom: 0.1rem solid #7d7d7d40;
11
+ background: var(--headerColor);
12
+ color: var(--onHeaderColor);
13
+ fill: var(--onHeaderColor);
14
+ user-select: none;
15
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { joinClassNames, joinStyles } from "library";
3
+ import styles from "./appBar.module.css";
4
+
5
+ function AppBar(props: React.HTMLAttributes<HTMLElement>) {
6
+ const joinedClassNames = joinClassNames(styles.header, props.className!);
7
+
8
+ return (
9
+ <header {...props} className={joinedClassNames}>
10
+ {props.children}
11
+ </header>
12
+ );
13
+ }
14
+
15
+ export default AppBar;
@@ -0,0 +1,87 @@
1
+ .button {
2
+ display: flex;
3
+ align-items: center;
4
+ line-height: 3rem;
5
+ border: none;
6
+ background: none;
7
+ color: inherit;
8
+ fill: inherit;
9
+ user-select: none;
10
+ cursor: pointer;
11
+ box-sizing: border-box;
12
+ }
13
+ .small {
14
+ min-width: 3rem;
15
+ height: 3rem;
16
+ padding: 0 1.2rem;
17
+ gap: 0.4rem;
18
+ font-size: 1.2rem;
19
+ --border-radius: 1.5rem;
20
+ }
21
+ .medium {
22
+ min-width: 4rem;
23
+ height: 4rem;
24
+ padding: 0 1.8rem;
25
+ gap: 0.8rem;
26
+ font-size: 1.6rem;
27
+ --border-radius: 2rem;
28
+ }
29
+ .large {
30
+ min-width: 5rem;
31
+ height: 5rem;
32
+ padding: 0 2.6rem;
33
+ gap: 1.1rem;
34
+ font-size: 1.8rem;
35
+ --border-radius: 2.5rem;
36
+ }
37
+
38
+ .iconButton {
39
+ padding: 0;
40
+ justify-content: center;
41
+ }
42
+
43
+ .none {
44
+ border-radius: 0;
45
+ }
46
+ .semi {
47
+ border-radius: 0 var(--border-radius) var(--border-radius) 0;
48
+ }
49
+ [dir="rtl"] .semi {
50
+ border-radius: var(--border-radius) 0 0 var(--border-radius);
51
+ }
52
+ .rounded {
53
+ border-radius: var(--border-radius);
54
+ }
55
+
56
+ @media (pointer: fine) {
57
+ .button:hover {
58
+ cursor: pointer;
59
+ box-shadow: inset 0 0 10rem #7d7d7d20;
60
+ }
61
+ }
62
+ .button:active {
63
+ box-shadow: inset 0 0 10rem #7d7d7d30;
64
+ }
65
+ .button:invalid {
66
+ border: 0.1rem solid var(--errorColor);
67
+ }
68
+
69
+ .outlined {
70
+ border: 0.1rem solid #7d7d7d70;
71
+ }
72
+ .filled {
73
+ background: var(--onBackgroundColor);
74
+ color: var(--onPrimaryColor);
75
+ fill: var(--onPrimaryColor);
76
+ }
77
+ .tonal {
78
+ background: var(--onHeaderColor);
79
+ color: var(--onSurfaceColor);
80
+ fill: var(--onSurfaceColor);
81
+ }
82
+ .elevated {
83
+ background-color: var(--onPrimaryColor);
84
+ color: var(--onSurfaceColor);
85
+ fill: var(--onSurfaceColor);
86
+ box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
87
+ }
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+ import { joinClassNames } from "library";
3
+ import styles from "./button.module.css";
4
+ import SvgIcon from "ui/svgIcon/svgIcon";
5
+
6
+ interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
7
+ variant?: "text" | "outlined" | "filled" | "tonal" | "elevated";
8
+ size?: "small" | "medium" | "large";
9
+ borderStyle?: "none" | "semi" | "rounded";
10
+ icon?: JSX.Element;
11
+ }
12
+
13
+ interface svgSizeMap {
14
+ small: number;
15
+ medium: number;
16
+ large: number;
17
+ }
18
+
19
+ const svgSizeMaps: svgSizeMap = {
20
+ small: 2,
21
+ medium: 2.4,
22
+ large: 3,
23
+ };
24
+
25
+ function Button(props: ButtonProps) {
26
+ const joinedClassNames = joinClassNames(
27
+ styles.button,
28
+ props.variant ? styles[props.variant] : styles.text,
29
+ props.size ? styles[props.size] : styles.medium,
30
+ props.borderStyle ? styles[props.borderStyle] : styles.rounded,
31
+ props.icon && !props.children ? styles.iconButton : "",
32
+ props.className!
33
+ );
34
+
35
+ return (
36
+ <button {...props} className={joinedClassNames}>
37
+ {props.icon ? (
38
+ <SvgIcon
39
+ size={
40
+ props.size
41
+ ? svgSizeMaps[props.size]
42
+ : svgSizeMaps.medium
43
+ }
44
+ >
45
+ {props.icon}
46
+ </SvgIcon>
47
+ ) : null}
48
+ {props.children}
49
+ </button>
50
+ );
51
+ }
52
+
53
+ export default Button;
@@ -0,0 +1,12 @@
1
+ .card {
2
+ width: 100%;
3
+ padding: 3rem;
4
+ box-sizing: border-box;
5
+ border-radius: 2rem;
6
+ background: var(--surfaceColor);
7
+ color: var(--onSurfaceColor);
8
+ fill: var(--onSurfaceColor);
9
+ box-shadow: 0px 6px 10px 0px hsla(0, 0%, 0%, 0.14),
10
+ 0px 1px 18px 0px hsla(0, 0%, 0%, 0.12),
11
+ 0px 3px 5px -1px hsla(0, 0%, 0%, 0.2);
12
+ }
package/card/card.tsx ADDED
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { joinClassNames } from "library";
3
+ import styles from "./card.module.css";
4
+
5
+ function Card(props: React.HTMLAttributes<HTMLElement>) {
6
+ const joinedClassNames = joinClassNames(styles.card, props.className!);
7
+
8
+ return (
9
+ <div {...props} className={joinedClassNames}>
10
+ {props.children}
11
+ </div>
12
+ );
13
+ }
14
+
15
+ export default Card;
@@ -0,0 +1,27 @@
1
+ import React, { useEffect, useRef } from "react";
2
+
3
+ interface ClickAwayListenerProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ onClickAway: React.MouseEventHandler<HTMLDivElement>;
5
+ }
6
+
7
+ function ClickAwayListener(props: ClickAwayListenerProps) {
8
+ const ref = useRef(null);
9
+
10
+ useEffect(() => {
11
+ const handleOutSideClick = (event: MouseEvent) => {
12
+ if (ref.current && !(ref.current as any).contains(event.target)) {
13
+ props.onClickAway && props.onClickAway(event as any);
14
+ }
15
+ };
16
+
17
+ document.addEventListener("click", handleOutSideClick, true);
18
+
19
+ // CleanUp When element unmount
20
+ return () =>
21
+ document.removeEventListener("click", handleOutSideClick, true);
22
+ }, [props.onClickAway]);
23
+
24
+ return <div ref={ref}>{props.children}</div>;
25
+ }
26
+
27
+ export default ClickAwayListener;
@@ -0,0 +1,23 @@
1
+ div.container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ width: 100%;
5
+ margin: auto;
6
+ box-sizing: border-box;
7
+ }
8
+
9
+ div.container.xs {
10
+ max-width: 44.4rem;
11
+ }
12
+ div.container.sm {
13
+ max-width: 60rem;
14
+ }
15
+ div.container.md {
16
+ max-width: 90rem;
17
+ }
18
+ div.container.lg {
19
+ max-width: 120rem;
20
+ }
21
+ div.container.xl {
22
+ max-width: 150rem;
23
+ }
@@ -0,0 +1,25 @@
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;
@@ -0,0 +1,6 @@
1
+ .footer {
2
+ display: flex;
3
+ flex-direction: row;
4
+ width: 100%;
5
+ box-sizing: border-box;
6
+ }
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,6 @@
1
+ .form {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 1.5rem;
5
+ width: 100%;
6
+ }
package/form/form.tsx ADDED
@@ -0,0 +1,23 @@
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;
@@ -0,0 +1,4 @@
1
+ .gridcontainer {
2
+ display: grid;
3
+ box-sizing: border-box;
4
+ }
@@ -0,0 +1,34 @@
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;
File without changes
@@ -0,0 +1,27 @@
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;
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ import { useNavigate } from "react-router-dom";
3
+
4
+ function HistoryBack(props: React.HTMLAttributes<HTMLDivElement>) {
5
+ const navigate = useNavigate();
6
+
7
+ return (
8
+ <div
9
+ {...props}
10
+ onClick={() => {
11
+ navigate(-1);
12
+ props.onClick!(null as any);
13
+ }}
14
+ >
15
+ {props.children}
16
+ </div>
17
+ );
18
+ }
19
+
20
+ export default HistoryBack;
@@ -0,0 +1,18 @@
1
+ .hr {
2
+ width: calc(100% - 1rem);
3
+ height: 0;
4
+ padding: 0;
5
+ margin: 0.5rem auto;
6
+ background: none;
7
+ border-top: 0.1rem solid var(--secondaryVariantColor);
8
+ }
9
+ .dotted {
10
+ border-top: 0.4rem dotted var(--secondaryVariantColor);
11
+ }
12
+ .dashed {
13
+ border-top: 0.2rem dashed var(--secondaryVariantColor);
14
+ }
15
+ .shortLine {
16
+ width: 30rem;
17
+ max-width: 80%;
18
+ }
package/hr/hr.tsx ADDED
@@ -0,0 +1,34 @@
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/index.tsx ADDED
@@ -0,0 +1,43 @@
1
+ import AppBar from "./appBar/appBar";
2
+ import Button from "./button/button";
3
+ import Container from "./container/container";
4
+ import GridContainer from "./gridContainer/gridContainer";
5
+ import GridItem from "./gridItem/gridItem";
6
+ import Stack from "./stack/stack";
7
+ import Navigation from "./navigation/navigation";
8
+ import ClickAwayListener from "./clickAwayListener/clickAwayListener";
9
+ import List from "./list/list";
10
+ import ListItem from "./listItem/listItem";
11
+ import Main from "./main/main";
12
+ import Page from "./page/page";
13
+ import Spacer from "./spacer/spacer";
14
+ import Hr from "./hr/hr";
15
+ import Form from "./form/form";
16
+ import SvgIcon from "./svgIcon/svgIcon";
17
+ import HistoryBack from "./historyBack/historyBack";
18
+ import Row from "./row/row";
19
+ import Footer from "./footer/footer";
20
+ import Card from "./card/card";
21
+
22
+ export {
23
+ Container,
24
+ GridContainer,
25
+ GridItem,
26
+ Stack,
27
+ Navigation,
28
+ ClickAwayListener,
29
+ AppBar,
30
+ Button,
31
+ List,
32
+ ListItem,
33
+ Main,
34
+ Page,
35
+ Spacer,
36
+ Hr,
37
+ Form,
38
+ SvgIcon,
39
+ HistoryBack,
40
+ Row,
41
+ Footer,
42
+ Card,
43
+ };
@@ -0,0 +1,22 @@
1
+ .list {
2
+ display: flex;
3
+ list-style-type: none;
4
+ max-height: 100rem;
5
+ padding: 0;
6
+ transition: max-height 300ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
7
+ }
8
+
9
+ .row {
10
+ flex-direction: row;
11
+ }
12
+ .column {
13
+ flex-direction: column;
14
+ align-items: stretch;
15
+ width: 100%;
16
+ box-sizing: border-box;
17
+ }
18
+
19
+ .collapsed {
20
+ max-height: 0;
21
+ overflow: hidden;
22
+ }
package/list/list.tsx ADDED
@@ -0,0 +1,25 @@
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;
@@ -0,0 +1,6 @@
1
+ .listItem {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
5
+ box-sizing: border-box;
6
+ }
@@ -0,0 +1,13 @@
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;
@@ -0,0 +1,19 @@
1
+ .main {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ align-self: flex-end;
6
+ box-sizing: border-box;
7
+ width: 100%;
8
+ transition: width 0.3s;
9
+ }
10
+
11
+ .navOpen {
12
+ width: calc(100% - 22rem);
13
+ }
14
+
15
+ @media screen and (max-width: 1000px) {
16
+ .navOpen {
17
+ width: 100%;
18
+ }
19
+ }
package/main/main.tsx ADDED
@@ -0,0 +1,25 @@
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;
@@ -0,0 +1,56 @@
1
+ .navigation {
2
+ position: fixed;
3
+ max-width: 100%;
4
+ transition: transform 0.3s;
5
+ background: var(--backgroundColor);
6
+ overflow-y: auto;
7
+ }
8
+
9
+ .auto,
10
+ .left {
11
+ top: 5.1rem;
12
+ left: 0;
13
+ width: 21.9rem;
14
+ height: calc(100% - 5.1rem);
15
+ max-height: 100%;
16
+ border-inline-end: 0.2rem solid #7d7d7d40;
17
+ transform: translate(-100%, 0);
18
+ }
19
+ [dir="rtl"] .auto,
20
+ .right {
21
+ right: 0;
22
+ top: 5.1rem;
23
+ width: 21.9rem;
24
+ height: calc(100% - 5.1rem);
25
+ max-height: 100%;
26
+ border-inline-end: 0.2rem solid #7d7d7d40;
27
+ transform: translate(100%, 0);
28
+ }
29
+
30
+ .top {
31
+ top: 0;
32
+ width: 100%;
33
+ height: auto;
34
+ border-bottom: 0.2rem solid #7d7d7d40;
35
+ transform: translate(0, -100%);
36
+ }
37
+ .bottom {
38
+ bottom: 0;
39
+ width: 100%;
40
+ height: auto;
41
+ border-top: 0.2rem solid #7d7d7d40;
42
+ transform: translate(0, 100%);
43
+ }
44
+
45
+ .open {
46
+ transform: translate(0, 0);
47
+ }
48
+
49
+ @media screen and (max-width: 1000px) {
50
+ .auto,
51
+ .left,
52
+ .right {
53
+ top: 0;
54
+ height: 100%;
55
+ }
56
+ }
@@ -0,0 +1,24 @@
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/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@yakad/ui",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "publishConfig": {
10
+ "access": "public"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/NatiqQuran/yakad.git"
15
+ },
16
+ "keywords": [
17
+ "ui"
18
+ ],
19
+ "author": "natiq",
20
+ "license": "GPL-3.0",
21
+ "bugs": {
22
+ "url": "https://github.com/NatiqQuran/yakad/issues"
23
+ },
24
+ "homepage": "https://github.com/NatiqQuran/yakad#readme"
25
+ }
@@ -0,0 +1,9 @@
1
+ .page {
2
+ display: flex;
3
+ flex-direction: column;
4
+ box-sizing: border-box;
5
+ width: 100%;
6
+ background: var(--backgroundColor);
7
+ color: var(--onBackgroundColor);
8
+ fill: var(--onBackgroundColor);
9
+ }
package/page/page.tsx ADDED
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,7 @@
1
+ .row {
2
+ display: flex;
3
+ flex-direction: row;
4
+ align-items: center;
5
+ gap: 1.5rem;
6
+ box-sizing: border-box;
7
+ }
package/row/row.tsx ADDED
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,5 @@
1
+ .spacer {
2
+ width: 0;
3
+ height: 100%;
4
+ margin: auto;
5
+ }
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import styles from "./spacer.module.css";
3
+
4
+ function Spacer() {
5
+ return <div className={styles.spacer}></div>;
6
+ }
7
+
8
+ export default Spacer;
@@ -0,0 +1,6 @@
1
+ .stack {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 1.5rem;
5
+ box-sizing: border-box;
6
+ }
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,5 @@
1
+ .svg svg {
2
+ display: block;
3
+ width: 100%;
4
+ height: 100%;
5
+ }
@@ -0,0 +1,26 @@
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;