@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.
Files changed (182) hide show
  1. package/declaration.d.ts +1 -0
  2. package/dist/appBar/appBar.d.ts +3 -0
  3. package/dist/appBar/appBar.js +9 -0
  4. package/dist/appBar/appBar.js.map +1 -0
  5. package/dist/button/button.d.ts +9 -0
  6. package/dist/button/button.js +17 -0
  7. package/dist/button/button.js.map +1 -0
  8. package/dist/card/card.d.ts +3 -0
  9. package/dist/card/card.js +9 -0
  10. package/dist/card/card.js.map +1 -0
  11. package/dist/clickAwayListener/clickAwayListener.d.ts +6 -0
  12. package/dist/clickAwayListener/clickAwayListener.js +17 -0
  13. package/dist/clickAwayListener/clickAwayListener.js.map +1 -0
  14. package/dist/container/container.d.ts +7 -0
  15. package/dist/container/container.js +9 -0
  16. package/dist/container/container.js.map +1 -0
  17. package/dist/footer/footer.d.ts +3 -0
  18. package/dist/footer/footer.js +8 -0
  19. package/dist/footer/footer.js.map +1 -0
  20. package/dist/form/form.d.ts +3 -0
  21. package/dist/form/form.js +12 -0
  22. package/dist/form/form.js.map +1 -0
  23. package/dist/gridContainer/gridContainer.d.ts +12 -0
  24. package/dist/gridContainer/gridContainer.js +11 -0
  25. package/dist/gridContainer/gridContainer.js.map +1 -0
  26. package/dist/gridItem/gridItem.d.ts +10 -0
  27. package/dist/gridItem/gridItem.js +9 -0
  28. package/dist/gridItem/gridItem.js.map +1 -0
  29. package/dist/historyBack/historyBack.d.ts +3 -0
  30. package/dist/historyBack/historyBack.js +11 -0
  31. package/dist/historyBack/historyBack.js.map +1 -0
  32. package/dist/hr/hr.d.ts +8 -0
  33. package/dist/hr/hr.js +12 -0
  34. package/dist/hr/hr.js.map +1 -0
  35. package/dist/index.d.ts +21 -0
  36. package/dist/index.js +22 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/list/list.d.ts +7 -0
  39. package/dist/list/list.js +9 -0
  40. package/dist/list/list.js.map +1 -0
  41. package/dist/listItem/listItem.d.ts +3 -0
  42. package/dist/listItem/listItem.js +7 -0
  43. package/dist/listItem/listItem.js.map +1 -0
  44. package/dist/main/main.d.ts +6 -0
  45. package/dist/main/main.js +10 -0
  46. package/dist/main/main.js.map +1 -0
  47. package/dist/navigation/navigation.d.ts +7 -0
  48. package/dist/navigation/navigation.js +9 -0
  49. package/dist/navigation/navigation.js.map +1 -0
  50. package/dist/page/page.d.ts +3 -0
  51. package/dist/page/page.js +9 -0
  52. package/dist/page/page.js.map +1 -0
  53. package/dist/row/row.d.ts +3 -0
  54. package/dist/row/row.js +9 -0
  55. package/dist/row/row.js.map +1 -0
  56. package/dist/spacer/spacer.d.ts +3 -0
  57. package/dist/spacer/spacer.js +7 -0
  58. package/dist/spacer/spacer.js.map +1 -0
  59. package/dist/src/appBar/appBar.d.ts +3 -0
  60. package/dist/src/appBar/appBar.js +9 -0
  61. package/dist/src/appBar/appBar.js.map +1 -0
  62. package/dist/src/button/button.d.ts +9 -0
  63. package/dist/src/button/button.js +19 -0
  64. package/dist/src/button/button.js.map +1 -0
  65. package/dist/src/card/card.d.ts +3 -0
  66. package/dist/src/card/card.js +9 -0
  67. package/dist/src/card/card.js.map +1 -0
  68. package/dist/src/clickAwayListener/clickAwayListener.d.ts +6 -0
  69. package/dist/src/clickAwayListener/clickAwayListener.js +17 -0
  70. package/dist/src/clickAwayListener/clickAwayListener.js.map +1 -0
  71. package/dist/src/container/container.d.ts +7 -0
  72. package/dist/src/container/container.js +9 -0
  73. package/dist/src/container/container.js.map +1 -0
  74. package/dist/src/footer/footer.d.ts +3 -0
  75. package/dist/src/footer/footer.js +9 -0
  76. package/dist/src/footer/footer.js.map +1 -0
  77. package/dist/src/form/form.d.ts +3 -0
  78. package/dist/src/form/form.js +12 -0
  79. package/dist/src/form/form.js.map +1 -0
  80. package/dist/src/gridContainer/gridContainer.d.ts +12 -0
  81. package/dist/src/gridContainer/gridContainer.js +11 -0
  82. package/dist/src/gridContainer/gridContainer.js.map +1 -0
  83. package/dist/src/gridItem/gridItem.d.ts +10 -0
  84. package/dist/src/gridItem/gridItem.js +9 -0
  85. package/dist/src/gridItem/gridItem.js.map +1 -0
  86. package/dist/src/historyBack/historyBack.d.ts +3 -0
  87. package/dist/src/historyBack/historyBack.js +11 -0
  88. package/dist/src/historyBack/historyBack.js.map +1 -0
  89. package/dist/src/hr/hr.d.ts +8 -0
  90. package/dist/src/hr/hr.js +12 -0
  91. package/dist/src/hr/hr.js.map +1 -0
  92. package/dist/src/list/list.d.ts +7 -0
  93. package/dist/src/list/list.js +9 -0
  94. package/dist/src/list/list.js.map +1 -0
  95. package/dist/src/listItem/listItem.d.ts +3 -0
  96. package/dist/src/listItem/listItem.js +7 -0
  97. package/dist/src/listItem/listItem.js.map +1 -0
  98. package/dist/src/main/main.d.ts +6 -0
  99. package/dist/src/main/main.js +10 -0
  100. package/dist/src/main/main.js.map +1 -0
  101. package/dist/src/navigation/navigation.d.ts +7 -0
  102. package/dist/src/navigation/navigation.js +9 -0
  103. package/dist/src/navigation/navigation.js.map +1 -0
  104. package/dist/src/page/page.d.ts +3 -0
  105. package/dist/src/page/page.js +9 -0
  106. package/dist/src/page/page.js.map +1 -0
  107. package/dist/src/row/row.d.ts +3 -0
  108. package/dist/src/row/row.js +9 -0
  109. package/dist/src/row/row.js.map +1 -0
  110. package/dist/src/spacer/spacer.d.ts +3 -0
  111. package/dist/src/spacer/spacer.js +7 -0
  112. package/dist/src/spacer/spacer.js.map +1 -0
  113. package/dist/src/stack/stack.d.ts +3 -0
  114. package/dist/src/stack/stack.js +9 -0
  115. package/dist/src/stack/stack.js.map +1 -0
  116. package/dist/src/svgIcon/svgIcon.d.ts +6 -0
  117. package/dist/src/svgIcon/svgIcon.js +12 -0
  118. package/dist/src/svgIcon/svgIcon.js.map +1 -0
  119. package/dist/stack/stack.d.ts +3 -0
  120. package/dist/stack/stack.js +9 -0
  121. package/dist/stack/stack.js.map +1 -0
  122. package/dist/svgIcon/svgIcon.d.ts +6 -0
  123. package/dist/svgIcon/svgIcon.js +12 -0
  124. package/dist/svgIcon/svgIcon.js.map +1 -0
  125. package/package.json +18 -11
  126. package/{appBar → src/appBar}/appBar.module.css +15 -15
  127. package/src/appBar/appBar.tsx +15 -0
  128. package/{button → src/button}/button.module.css +87 -87
  129. package/src/button/button.tsx +49 -0
  130. package/{card → src/card}/card.module.css +12 -12
  131. package/src/card/card.tsx +15 -0
  132. package/{clickAwayListener → src/clickAwayListener}/clickAwayListener.tsx +27 -27
  133. package/{container → src/container}/container.module.css +23 -23
  134. package/src/container/container.tsx +25 -0
  135. package/{footer → src/footer}/footer.module.css +6 -6
  136. package/src/footer/footer.tsx +15 -0
  137. package/{form → src/form}/form.module.css +6 -6
  138. package/src/form/form.tsx +23 -0
  139. package/{gridContainer → src/gridContainer}/gridContainer.module.css +4 -4
  140. package/src/gridContainer/gridContainer.tsx +34 -0
  141. package/{gridItem → src/gridItem}/gridItem.module.css +0 -0
  142. package/src/gridItem/gridItem.tsx +27 -0
  143. package/{historyBack → src/historyBack}/historyBack.tsx +20 -20
  144. package/{hr → src/hr}/hr.module.css +18 -18
  145. package/src/hr/hr.tsx +32 -0
  146. package/{index.tsx → src/index.tsx} +43 -43
  147. package/{list → src/list}/list.module.css +22 -22
  148. package/src/list/list.tsx +25 -0
  149. package/{listItem → src/listItem}/listItem.module.css +6 -6
  150. package/src/listItem/listItem.tsx +12 -0
  151. package/{main → src/main}/main.module.css +19 -19
  152. package/src/main/main.tsx +25 -0
  153. package/{navigation → src/navigation}/navigation.module.css +56 -56
  154. package/src/navigation/navigation.tsx +24 -0
  155. package/{page → src/page}/page.module.css +9 -9
  156. package/src/page/page.tsx +15 -0
  157. package/{row → src/row}/row.module.css +7 -7
  158. package/src/row/row.tsx +15 -0
  159. package/{spacer → src/spacer}/spacer.module.css +5 -5
  160. package/{spacer → src/spacer}/spacer.tsx +8 -8
  161. package/{stack → src/stack}/stack.module.css +6 -6
  162. package/src/stack/stack.tsx +15 -0
  163. package/{svgIcon → src/svgIcon}/svgIcon.module.css +5 -5
  164. package/src/svgIcon/svgIcon.tsx +26 -0
  165. package/tsconfig.json +22 -0
  166. package/appBar/appBar.tsx +0 -15
  167. package/button/button.tsx +0 -53
  168. package/card/card.tsx +0 -15
  169. package/container/container.tsx +0 -25
  170. package/footer/footer.tsx +0 -15
  171. package/form/form.tsx +0 -23
  172. package/gridContainer/gridContainer.tsx +0 -34
  173. package/gridItem/gridItem.tsx +0 -27
  174. package/hr/hr.tsx +0 -34
  175. package/list/list.tsx +0 -25
  176. package/listItem/listItem.tsx +0 -13
  177. package/main/main.tsx +0 -25
  178. package/navigation/navigation.tsx +0 -24
  179. package/page/page.tsx +0 -15
  180. package/row/row.tsx +0 -15
  181. package/stack/stack.tsx +0 -15
  182. package/svgIcon/svgIcon.tsx +0 -26
@@ -1,43 +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
- };
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
+ };
@@ -1,22 +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
- }
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
+ }
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { joinClassNames } from "@yakad/lib";
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;
@@ -1,6 +1,6 @@
1
- .listItem {
2
- display: flex;
3
- flex-direction: column;
4
- align-items: stretch;
5
- box-sizing: border-box;
6
- }
1
+ .listItem {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: stretch;
5
+ box-sizing: border-box;
6
+ }
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import styles from "./listItem.module.css";
3
+
4
+ function ListItem(props: React.HTMLAttributes<HTMLLIElement>) {
5
+ return (
6
+ <li className={styles.listItem} {...props}>
7
+ {props.children}
8
+ </li>
9
+ );
10
+ }
11
+
12
+ export default ListItem;
@@ -1,19 +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
- }
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
+ }
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ import { joinClassNames, joinStyles } from "@yakad/lib";
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,56 +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
- }
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 "@yakad/lib";
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;
@@ -1,9 +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
- }
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
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { joinClassNames, joinStyles } from "@yakad/lib";
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;
@@ -1,7 +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
- }
1
+ .row {
2
+ display: flex;
3
+ flex-direction: row;
4
+ align-items: center;
5
+ gap: 1.5rem;
6
+ box-sizing: border-box;
7
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { joinClassNames, joinStyles } from "@yakad/lib";
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;
@@ -1,5 +1,5 @@
1
- .spacer {
2
- width: 0;
3
- height: 100%;
4
- margin: auto;
5
- }
1
+ .spacer {
2
+ width: 0;
3
+ height: 100%;
4
+ margin: auto;
5
+ }
@@ -1,8 +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;
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;
@@ -1,6 +1,6 @@
1
- .stack {
2
- display: flex;
3
- flex-direction: column;
4
- gap: 1.5rem;
5
- box-sizing: border-box;
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 "@yakad/lib";
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;
@@ -1,5 +1,5 @@
1
- .svg svg {
2
- display: block;
3
- width: 100%;
4
- height: 100%;
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 "@yakad/lib";
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;
package/tsconfig.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "compilerOptions": {
3
+ "outDir": "./dist/",
4
+ "baseUrl": "src",
5
+ "target": "es5",
6
+ "lib": ["dom", "dom.iterable", "esnext"],
7
+ "allowJs": true,
8
+ "skipLibCheck": true,
9
+ "esModuleInterop": true,
10
+ "allowSyntheticDefaultImports": true,
11
+ "strict": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "noFallthroughCasesInSwitch": true,
14
+ "module": "esnext",
15
+ "moduleResolution": "node",
16
+ "resolveJsonModule": true,
17
+ "isolatedModules": true,
18
+ "noEmit": true,
19
+ "jsx": "react-jsx"
20
+ },
21
+ "include": ["src", "declaration.d.ts"]
22
+ }
package/appBar/appBar.tsx DELETED
@@ -1,15 +0,0 @@
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;
package/button/button.tsx DELETED
@@ -1,53 +0,0 @@
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;
package/card/card.tsx DELETED
@@ -1,15 +0,0 @@
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;