@yakad/ui 1.0.0 → 1.0.2
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/package.json +18 -11
- package/src/appBar/appBar.d.ts +3 -0
- package/src/appBar/appBar.js +9 -0
- package/src/appBar/appBar.js.map +1 -0
- package/{appBar → src/appBar}/appBar.module.css +15 -15
- package/src/appBar/appBar.tsx +15 -0
- package/src/button/button.d.ts +9 -0
- package/src/button/button.js +17 -0
- package/src/button/button.js.map +1 -0
- package/{button → src/button}/button.module.css +87 -87
- package/src/button/button.tsx +49 -0
- package/src/card/card.d.ts +3 -0
- package/src/card/card.js +9 -0
- package/src/card/card.js.map +1 -0
- package/{card → src/card}/card.module.css +12 -12
- package/src/card/card.tsx +15 -0
- package/src/clickAwayListener/clickAwayListener.d.ts +6 -0
- package/src/clickAwayListener/clickAwayListener.js +17 -0
- package/src/clickAwayListener/clickAwayListener.js.map +1 -0
- package/{clickAwayListener → src/clickAwayListener}/clickAwayListener.tsx +27 -27
- package/src/container/container.d.ts +7 -0
- package/src/container/container.js +9 -0
- package/src/container/container.js.map +1 -0
- package/{container → src/container}/container.module.css +23 -23
- package/src/container/container.tsx +25 -0
- package/src/footer/footer.d.ts +3 -0
- package/src/footer/footer.js +9 -0
- package/src/footer/footer.js.map +1 -0
- package/{footer → src/footer}/footer.module.css +6 -6
- package/src/footer/footer.tsx +15 -0
- package/src/form/form.d.ts +3 -0
- package/src/form/form.js +12 -0
- package/src/form/form.js.map +1 -0
- package/{form → src/form}/form.module.css +6 -6
- package/src/form/form.tsx +23 -0
- package/src/gridContainer/gridContainer.d.ts +12 -0
- package/src/gridContainer/gridContainer.js +11 -0
- package/src/gridContainer/gridContainer.js.map +1 -0
- package/{gridContainer → src/gridContainer}/gridContainer.module.css +4 -4
- package/src/gridContainer/gridContainer.tsx +34 -0
- package/src/gridItem/gridItem.d.ts +10 -0
- package/src/gridItem/gridItem.js +9 -0
- package/src/gridItem/gridItem.js.map +1 -0
- package/{gridItem → src/gridItem}/gridItem.module.css +0 -0
- package/src/gridItem/gridItem.tsx +27 -0
- package/src/historyBack/historyBack.d.ts +3 -0
- package/src/historyBack/historyBack.js +11 -0
- package/src/historyBack/historyBack.js.map +1 -0
- package/{historyBack → src/historyBack}/historyBack.tsx +20 -20
- package/src/hr/hr.d.ts +8 -0
- package/src/hr/hr.js +12 -0
- package/src/hr/hr.js.map +1 -0
- package/{hr → src/hr}/hr.module.css +18 -18
- package/src/hr/hr.tsx +32 -0
- package/src/index.d.ts +21 -0
- package/src/index.js +22 -0
- package/src/index.js.map +1 -0
- package/{index.tsx → src/index.tsx} +43 -43
- package/src/list/list.d.ts +7 -0
- package/src/list/list.js +9 -0
- package/src/list/list.js.map +1 -0
- package/{list → src/list}/list.module.css +22 -22
- package/src/list/list.tsx +25 -0
- package/src/listItem/listItem.d.ts +3 -0
- package/src/listItem/listItem.js +7 -0
- package/src/listItem/listItem.js.map +1 -0
- package/{listItem → src/listItem}/listItem.module.css +6 -6
- package/src/listItem/listItem.tsx +12 -0
- package/src/main/main.d.ts +6 -0
- package/src/main/main.js +10 -0
- package/src/main/main.js.map +1 -0
- package/{main → src/main}/main.module.css +19 -19
- package/src/main/main.tsx +25 -0
- package/src/navigation/navigation.d.ts +7 -0
- package/src/navigation/navigation.js +9 -0
- package/src/navigation/navigation.js.map +1 -0
- package/{navigation → src/navigation}/navigation.module.css +56 -56
- package/src/navigation/navigation.tsx +24 -0
- package/src/page/page.d.ts +3 -0
- package/src/page/page.js +9 -0
- package/src/page/page.js.map +1 -0
- package/{page → src/page}/page.module.css +9 -9
- package/src/page/page.tsx +15 -0
- package/src/row/row.d.ts +3 -0
- package/src/row/row.js +9 -0
- package/src/row/row.js.map +1 -0
- package/{row → src/row}/row.module.css +7 -7
- package/src/row/row.tsx +15 -0
- package/src/spacer/spacer.d.ts +3 -0
- package/src/spacer/spacer.js +7 -0
- package/src/spacer/spacer.js.map +1 -0
- package/{spacer → src/spacer}/spacer.module.css +5 -5
- package/{spacer → src/spacer}/spacer.tsx +8 -8
- package/src/stack/stack.d.ts +3 -0
- package/src/stack/stack.js +9 -0
- package/src/stack/stack.js.map +1 -0
- package/{stack → src/stack}/stack.module.css +6 -6
- package/src/stack/stack.tsx +15 -0
- package/src/svgIcon/svgIcon.d.ts +6 -0
- package/src/svgIcon/svgIcon.js +12 -0
- package/src/svgIcon/svgIcon.js.map +1 -0
- package/{svgIcon → src/svgIcon}/svgIcon.module.css +5 -5
- package/src/svgIcon/svgIcon.tsx +26 -0
- package/tsconfig.json +13 -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/declaration.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare module "*.module.css";
|
package/package.json
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yakad/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "./src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
"publishConfig": {
|
|
10
|
-
"access": "public"
|
|
7
|
+
"build": "tsc",
|
|
8
|
+
"test": "echo hector test: not impl"
|
|
11
9
|
},
|
|
12
10
|
"repository": {
|
|
13
11
|
"type": "git",
|
|
14
12
|
"url": "git+https://github.com/NatiqQuran/yakad.git"
|
|
15
13
|
},
|
|
16
|
-
"
|
|
17
|
-
"ui"
|
|
18
|
-
],
|
|
19
|
-
"author": "natiq",
|
|
14
|
+
"author": "Natiq",
|
|
20
15
|
"license": "GPL-3.0",
|
|
21
16
|
"bugs": {
|
|
22
17
|
"url": "https://github.com/NatiqQuran/yakad/issues"
|
|
23
18
|
},
|
|
24
|
-
"homepage": "https://github.com/NatiqQuran/yakad#readme"
|
|
19
|
+
"homepage": "https://github.com/NatiqQuran/yakad#readme",
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@types/react": "^18.0.24",
|
|
22
|
+
"@types/react-dom": "^18.0.6",
|
|
23
|
+
"@yakad/lib": "^1.0.1",
|
|
24
|
+
"react": "^18.2.0",
|
|
25
|
+
"react-dom": "^18.2.0",
|
|
26
|
+
"react-router-dom": "^6.4.2",
|
|
27
|
+
"typescript": "^4.8.4"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"typescript-plugin-css-modules": "^3.4.0"
|
|
31
|
+
}
|
|
25
32
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { joinClassNames } from "@yakad/lib";
|
|
3
|
+
import styles from "./appBar.module.css";
|
|
4
|
+
function AppBar(props) {
|
|
5
|
+
const joinedClassNames = joinClassNames(styles.header, props.className);
|
|
6
|
+
return (React.createElement("header", { ...props, className: joinedClassNames }, props.children));
|
|
7
|
+
}
|
|
8
|
+
export default AppBar;
|
|
9
|
+
//# sourceMappingURL=appBar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appBar.js","sourceRoot":"","sources":["appBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AACxD,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,SAAS,MAAM,CAAC,KAAwC;IACtD,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAEzE,OAAO,CACL,mCAAY,KAAK,EAAE,SAAS,EAAE,gBAAgB,IAC3C,KAAK,CAAC,QAAQ,CACR,CACV,CAAC;AACJ,CAAC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,15 +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
|
-
}
|
|
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 "@yakad/lib";
|
|
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,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
variant?: "text" | "outlined" | "filled" | "tonal" | "elevated";
|
|
4
|
+
size?: "small" | "medium" | "large";
|
|
5
|
+
borderStyle?: "none" | "semi" | "rounded";
|
|
6
|
+
icon?: JSX.Element;
|
|
7
|
+
}
|
|
8
|
+
declare function Button(props: ButtonProps): JSX.Element;
|
|
9
|
+
export default Button;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { joinClassNames } from "@yakad/lib";
|
|
3
|
+
import styles from "./button.module.css";
|
|
4
|
+
import SvgIcon from "../svgIcon/svgIcon";
|
|
5
|
+
const svgSizeMaps = {
|
|
6
|
+
small: 2,
|
|
7
|
+
medium: 2.4,
|
|
8
|
+
large: 3,
|
|
9
|
+
};
|
|
10
|
+
function Button(props) {
|
|
11
|
+
const joinedClassNames = joinClassNames(styles.button, props.variant ? styles[props.variant] : styles.text, props.size ? styles[props.size] : styles.medium, props.borderStyle ? styles[props.borderStyle] : styles.rounded, props.icon && !props.children ? styles.iconButton : "", props.className);
|
|
12
|
+
return (React.createElement("button", { ...props, className: joinedClassNames },
|
|
13
|
+
props.icon ? (React.createElement(SvgIcon, { size: props.size ? svgSizeMaps[props.size] : svgSizeMaps.medium }, props.icon)) : null,
|
|
14
|
+
props.children));
|
|
15
|
+
}
|
|
16
|
+
export default Button;
|
|
17
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AACzC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AAezC,MAAM,WAAW,GAAe;IAC9B,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,CAAC;CACT,CAAC;AAEF,SAAS,MAAM,CAAC,KAAkB;IAChC,MAAM,gBAAgB,GAAG,cAAc,CACrC,MAAM,CAAC,MAAM,EACb,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EACnD,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAC/C,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAC9D,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,EACtD,KAAK,CAAC,SAAU,CACjB,CAAC;IAEF,OAAO,CACL,mCAAY,KAAK,EAAE,SAAS,EAAE,gBAAgB;QAC3C,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CACZ,oBAAC,OAAO,IACN,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,MAAM,IAE9D,KAAK,CAAC,IAAI,CACH,CACX,CAAC,CAAC,CAAC,IAAI;QACP,KAAK,CAAC,QAAQ,CACR,CACV,CAAC;AACJ,CAAC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,87 +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
|
-
}
|
|
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,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { joinClassNames } from "@yakad/lib";
|
|
3
|
+
import styles from "./button.module.css";
|
|
4
|
+
import SvgIcon from "../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={props.size ? svgSizeMaps[props.size] : svgSizeMaps.medium}
|
|
40
|
+
>
|
|
41
|
+
{props.icon}
|
|
42
|
+
</SvgIcon>
|
|
43
|
+
) : null}
|
|
44
|
+
{props.children}
|
|
45
|
+
</button>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default Button;
|
package/src/card/card.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { joinClassNames } from "@yakad/lib";
|
|
3
|
+
import styles from "./card.module.css";
|
|
4
|
+
function Card(props) {
|
|
5
|
+
const joinedClassNames = joinClassNames(styles.card, props.className);
|
|
6
|
+
return (React.createElement("div", { ...props, className: joinedClassNames }, props.children));
|
|
7
|
+
}
|
|
8
|
+
export default Card;
|
|
9
|
+
//# sourceMappingURL=card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.js","sourceRoot":"","sources":["card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,SAAS,IAAI,CAAC,KAAwC;IACpD,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAEvE,OAAO,CACL,gCAAS,KAAK,EAAE,SAAS,EAAE,gBAAgB,IACxC,KAAK,CAAC,QAAQ,CACX,CACP,CAAC;AACJ,CAAC;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -1,12 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { joinClassNames } from "@yakad/lib";
|
|
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,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface ClickAwayListenerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
onClickAway: React.MouseEventHandler<HTMLDivElement>;
|
|
4
|
+
}
|
|
5
|
+
declare function ClickAwayListener(props: ClickAwayListenerProps): JSX.Element;
|
|
6
|
+
export default ClickAwayListener;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from "react";
|
|
2
|
+
function ClickAwayListener(props) {
|
|
3
|
+
const ref = useRef(null);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const handleOutSideClick = (event) => {
|
|
6
|
+
if (ref.current && !ref.current.contains(event.target)) {
|
|
7
|
+
props.onClickAway && props.onClickAway(event);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
document.addEventListener("click", handleOutSideClick, true);
|
|
11
|
+
// CleanUp When element unmount
|
|
12
|
+
return () => document.removeEventListener("click", handleOutSideClick, true);
|
|
13
|
+
}, [props.onClickAway]);
|
|
14
|
+
return React.createElement("div", { ref: ref }, props.children);
|
|
15
|
+
}
|
|
16
|
+
export default ClickAwayListener;
|
|
17
|
+
//# sourceMappingURL=clickAwayListener.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clickAwayListener.js","sourceRoot":"","sources":["clickAwayListener.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAMjD,SAAS,iBAAiB,CAAC,KAA6B;IACpD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzB,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,kBAAkB,GAAG,CAAC,KAAiB,EAAE,EAAE;YAC7C,IAAI,GAAG,CAAC,OAAO,IAAI,CAAE,GAAG,CAAC,OAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBAC7D,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,CAAC,KAAY,CAAC,CAAC;aACxD;QACL,CAAC,CAAC;QAEF,QAAQ,CAAC,gBAAgB,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;QAE7D,+BAA+B;QAC/B,OAAO,GAAG,EAAE,CACR,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAE,kBAAkB,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAExB,OAAO,6BAAK,GAAG,EAAE,GAAG,IAAG,KAAK,CAAC,QAAQ,CAAO,CAAC;AACjD,CAAC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,27 +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;
|
|
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,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare type ScreenSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
3
|
+
interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
maxWidth?: ScreenSize;
|
|
5
|
+
}
|
|
6
|
+
declare function Container(props: ContainerProps): JSX.Element;
|
|
7
|
+
export default Container;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { joinClassNames } from "@yakad/lib";
|
|
3
|
+
import styles from "./container.module.css";
|
|
4
|
+
function Container(props) {
|
|
5
|
+
const joinedClassNames = joinClassNames(props.maxWidth ? styles[props.maxWidth] : "", styles.container, props.className);
|
|
6
|
+
return (React.createElement("div", { ...props, className: joinedClassNames }, props.children));
|
|
7
|
+
}
|
|
8
|
+
export default Container;
|
|
9
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAc,MAAM,YAAY,CAAC;AACxD,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAQ5C,SAAS,SAAS,CAAC,KAAqB;IACtC,MAAM,gBAAgB,GAAG,cAAc,CACrC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,EAC5C,MAAM,CAAC,SAAS,EAChB,KAAK,CAAC,SAAU,CACjB,CAAC;IAEF,OAAO,CACL,gCAAS,KAAK,EAAE,SAAS,EAAE,gBAAgB,IACxC,KAAK,CAAC,QAAQ,CACX,CACP,CAAC;AACJ,CAAC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -1,23 +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
|
-
}
|
|
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 "@yakad/lib";
|
|
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,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { joinClassNames } from "@yakad/lib";
|
|
3
|
+
import styles from "./footer.module.css";
|
|
4
|
+
function Footer(props) {
|
|
5
|
+
const joinedClassNames = joinClassNames(styles.footer, props.className);
|
|
6
|
+
return (React.createElement("footer", { ...props, className: joinedClassNames }, props.children));
|
|
7
|
+
}
|
|
8
|
+
export default Footer;
|
|
9
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sourceRoot":"","sources":["footer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,SAAS,MAAM,CAAC,KAAwC;IACtD,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,SAAU,CAAC,CAAC;IAEzE,OAAO,CACL,mCAAY,KAAK,EAAE,SAAS,EAAE,gBAAgB,IAC3C,KAAK,CAAC,QAAQ,CACR,CACV,CAAC;AACJ,CAAC;AAED,eAAe,MAAM,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.footer {
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: row;
|
|
4
|
-
width: 100%;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
}
|
|
1
|
+
.footer {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: row;
|
|
4
|
+
width: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
}
|