@raketa-builder/ui 0.1.0 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/ui",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "MIT",
@@ -10,7 +10,7 @@
10
10
  "dev": "tsup src/index.js --format cjs --loader \".js=jsx\" --watch"
11
11
  },
12
12
  "peerDependencies": {
13
- "styled-components": "^5.1.0",
13
+ "styled-components": "5.1.0",
14
14
  "react": "18.2.0",
15
15
  "react-dom": "18.2.0"
16
16
  },
@@ -21,7 +21,7 @@
21
21
  "eslint-config-custom": "*",
22
22
  "react": "18.2.0",
23
23
  "tsconfig": "*",
24
- "tsup": "^6.5.0",
24
+ "tsup": "6.5.0",
25
25
  "typescript": "4.5.2"
26
26
  }
27
27
  }
package/src/Button.js CHANGED
@@ -49,12 +49,6 @@ const variants = {
49
49
  },
50
50
  };
51
51
 
52
- const sizes = {
53
- sm: theme.font.small,
54
- md: theme.font.base,
55
- lg: theme.font.medium,
56
- };
57
-
58
52
  const getColor = (props, variant, key) =>
59
53
  props.theme.colors[variants[variant][key]];
60
54
 
@@ -66,7 +60,7 @@ const Button = styled.button`
66
60
  border-radius: 48px;
67
61
  background-color: ${(props) => getColor(props, props.variant, "background")};
68
62
  color: ${(props) => getColor(props, props.variant, "color")};
69
- font-size: ${(props) => sizes[props.size || "md"]};
63
+ font-size: ${(props) => Button.sizes[props.size]};
70
64
  font-weight: 700;
71
65
  line-height: 1;
72
66
  transition: 0.2s ease-in-out all;
@@ -96,7 +90,16 @@ const Button = styled.button`
96
90
 
97
91
  Button.defaultProps = {
98
92
  type: "button",
93
+ size: "md",
99
94
  variant: "primary",
100
95
  };
101
96
 
97
+ Button.variants = ["primary", "secondary", "success", "danger"];
98
+
99
+ Button.sizes = {
100
+ sm: theme.font.small,
101
+ md: theme.font.base,
102
+ lg: theme.font.medium,
103
+ };
104
+
102
105
  export default Button;
File without changes
File without changes
File without changes
@@ -46,7 +46,7 @@ const Prev = ({ LinkComponent, router, currentPage }) => {
46
46
  query: { ...router.query, ...{ page: currentPage - 1 } },
47
47
  }}
48
48
  >
49
- <a>Previous</a>
49
+ Previous
50
50
  </LinkComponent>
51
51
  );
52
52
  };
@@ -63,7 +63,7 @@ const Next = ({ currentPage, pagesCount, LinkComponent, router }) => {
63
63
  query: { ...router.query, ...{ page: currentPage + 1 } },
64
64
  }}
65
65
  >
66
- <a>Next</a>
66
+ Next
67
67
  </LinkComponent>
68
68
  );
69
69
  };
@@ -98,7 +98,7 @@ const Pagination = ({ pagination, LinkComponent, router }) => {
98
98
  query: { ...router.query, ...{ page: pageNum } },
99
99
  }}
100
100
  >
101
- <a>{pageNum}</a>
101
+ {pageNum}
102
102
  </LinkComponent>
103
103
  );
104
104
  }
File without changes