@bouko/react 2.7.6 → 2.7.7

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,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="1em" height="1em">
2
+ <path
3
+ d="M73.4 297.4C60.9 309.9 60.9 330.2 73.4 342.7L233.4 502.7C245.9 515.2 266.2 515.2 278.7 502.7C291.2 490.2 291.2 469.9 278.7 457.4L173.3 352L544 352C561.7 352 576 337.7 576 320C576 302.3 561.7 288 544 288L173.3 288L278.7 182.6C291.2 170.1 291.2 149.8 278.7 137.3C266.2 124.8 245.9 124.8 233.4 137.3L73.4 297.3z"
4
+ fill="currentColor"
5
+ />
6
+ </svg>
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="1em" height="1em">
2
+ <path
3
+ d="M566.6 342.6C579.1 330.1 579.1 309.8 566.6 297.3L406.6 137.3C394.1 124.8 373.8 124.8 361.3 137.3C348.8 149.8 348.8 170.1 361.3 182.6L466.7 288L96 288C78.3 288 64 302.3 64 320C64 337.7 78.3 352 96 352L466.7 352L361.3 457.4C348.8 469.9 348.8 490.2 361.3 502.7C373.8 515.2 394.1 515.2 406.6 502.7L566.6 342.7z"
4
+ fill="currentColor"
5
+ />
6
+ </svg>
@@ -5,6 +5,7 @@ export { default as AbsoluteBox } from "./layout/absolute";
5
5
  export { default as Heading } from "./heading/normal";
6
6
  export { default as PageHeading } from "./heading/page";
7
7
  export * from "./layout/flex";
8
+ export { default as Pagination } from "./pagination";
8
9
  export { default as Button } from "./button/normal";
9
10
  export { default as IconButton } from "./button/icon";
10
11
  export { default as Badge } from "./text/badge";
@@ -5,6 +5,7 @@ export { default as AbsoluteBox } from "./layout/absolute";
5
5
  export { default as Heading } from "./heading/normal";
6
6
  export { default as PageHeading } from "./heading/page";
7
7
  export * from "./layout/flex";
8
+ export { default as Pagination } from "./pagination";
8
9
  export { default as Button } from "./button/normal";
9
10
  export { default as IconButton } from "./button/icon";
10
11
  export { default as Badge } from "./text/badge";
@@ -0,0 +1,9 @@
1
+ type Props = {
2
+ style?: string;
3
+ page: number;
4
+ prev: () => void;
5
+ next: () => void;
6
+ count: number;
7
+ };
8
+ export default function Pagination({ style, page, prev, next, count }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import LeftArrow from "../../assets/icons/arrow-left.svg";
3
+ import RightArrow from "../../assets/icons/arrow-right.svg";
4
+ import { RowBox } from "@bouko/react";
5
+ import { cn } from "@bouko/style";
6
+ export default function Pagination({ style, page, prev, next, count }) {
7
+ return (_jsxs(RowBox, { style: cn(styles.container, style), children: [_jsx(LeftArrow, { className: cn(styles.arrow, page === 1 && "cursor-not-allowed"), onClick: page > 1 ? prev : undefined }), _jsx("span", { className: styles.page, children: page }), _jsx(RightArrow, { className: cn(styles.arrow, count === 0 && "cursor-not-allowed"), onClick: count > 0 ? next : undefined })] }));
8
+ }
9
+ const styles = {
10
+ container: "justify-between items-center gap-4 text-primary-darker",
11
+ arrow: "text-xs duration-200 hover:text-primary-dark cursor-pointer",
12
+ page: "text-sm font-mono font-semibold"
13
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "@bouko/react",
4
- "version": "2.7.6",
4
+ "version": "2.7.7",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "MIT",