@cyber-harbour/ui 1.0.18 → 1.0.19
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/dist/index.d.mts +31 -11
- package/dist/index.d.ts +31 -11
- package/dist/index.js +33 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -32
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Core/IconComponents/BallsMenu.tsx +15 -0
- package/src/Core/IconComponents/Check.tsx +13 -0
- package/src/Core/IconComponents/ChevronDown.tsx +18 -0
- package/src/Core/IconComponents/ChevronUp.tsx +18 -0
- package/src/Core/IconComponents/index.ts +4 -0
- package/src/Core/ListMenu/ListMenuSection.tsx +1 -1
- package/src/Core/Pagination/Pagination.tsx +1 -1
- package/src/Core/Table/Table.tsx +15 -6
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
interface InfoCircleIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
fill?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const BallsMenu = ({ fill = 'currentColor', ...props }: InfoCircleIconProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg viewBox="0 0 16 3" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<ellipse cx="1.56746" cy="1.5" rx="1.53633" ry="1.5" fill={fill} />
|
|
11
|
+
<ellipse cx="7.71278" cy="1.5" rx="1.53633" ry="1.5" fill={fill} />
|
|
12
|
+
<ellipse cx="13.8581" cy="1.5" rx="1.53633" ry="1.5" fill={fill} />
|
|
13
|
+
</svg>
|
|
14
|
+
);
|
|
15
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
interface InfoCircleIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
fill?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const CheckIcon = ({ fill = 'currentColor', ...props }: InfoCircleIconProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg viewBox="0 0 16 12" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path d="M14.4983 1L5.34428 11L1.18338 6.45455" stroke={fill} stroke-width="1.5" stroke-linejoin="round" />;
|
|
11
|
+
</svg>
|
|
12
|
+
);
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ChevronRightIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
fill?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ChevronDownIcon = ({ fill = 'currentColor', ...props }: ChevronRightIconProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg viewBox="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
fill-rule="evenodd"
|
|
12
|
+
clip-rule="evenodd"
|
|
13
|
+
d="M17.4517 5.77798L16.4067 6.79197L10.8447 12.1899C10.0753 12.9367 8.82791 12.9367 8.05853 12.1899L2.49647 6.79197L1.45166 5.77798L3.54128 3.75L4.58609 4.76399L9.45161 9.48599L14.3172 4.76399L15.362 3.75L17.4517 5.77798Z"
|
|
14
|
+
fill={fill}
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ChevronRightIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
fill?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ChevronUpIcon = ({ fill = 'currentColor', ...props }: ChevronRightIconProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg viewBox="0 0 17 17" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
fill-rule="evenodd"
|
|
12
|
+
clip-rule="evenodd"
|
|
13
|
+
d="M0.20166 10.722L1.24661 9.70803L6.80863 4.31012C7.57801 3.56329 8.82541 3.56329 9.59479 4.31012L15.1569 9.70803L16.2017 10.722L14.112 12.75L13.0672 11.736L8.20171 7.01401L3.33611 11.736L2.29136 12.75L0.20166 10.722Z"
|
|
14
|
+
fill={fill}
|
|
15
|
+
/>
|
|
16
|
+
</svg>
|
|
17
|
+
);
|
|
18
|
+
};
|
|
@@ -32,3 +32,7 @@ export { StatisticIcon } from './StatisticIcon';
|
|
|
32
32
|
export { SunIcon } from './SunIcon';
|
|
33
33
|
export { UpRightArrowCircleIcon } from './UpRightArrowCircleIcon';
|
|
34
34
|
export { VectorIcon } from './VectorIcon';
|
|
35
|
+
export { BallsMenu } from './BallsMenu';
|
|
36
|
+
export { CheckIcon } from './Check';
|
|
37
|
+
export { ChevronDownIcon } from './ChevronDown';
|
|
38
|
+
export { ChevronUpIcon } from './ChevronUp';
|
|
@@ -2,7 +2,7 @@ import { ReactNode } from 'react';
|
|
|
2
2
|
import { styled } from 'styled-components';
|
|
3
3
|
|
|
4
4
|
export interface ListMenuSectionProps {
|
|
5
|
-
items:
|
|
5
|
+
items: any;
|
|
6
6
|
title?: string;
|
|
7
7
|
}
|
|
8
8
|
export const ListMenuSection = ({ title, items }: ListMenuSectionProps) => {
|
|
@@ -16,7 +16,7 @@ const VISIBLE_GROUPE = 5;
|
|
|
16
16
|
const STEP = 1;
|
|
17
17
|
const ELLIPSIS = '...';
|
|
18
18
|
|
|
19
|
-
export const Pagination
|
|
19
|
+
export const Pagination = ({ total_items, limit, offset, onChangePage }: PaginationProps) => {
|
|
20
20
|
const currentPage = useMemo(() => (offset ? offset / limit + 1 : 1), [limit, offset]);
|
|
21
21
|
const pages = Math.ceil(total_items / limit);
|
|
22
22
|
const paginationItems: (number | string)[] = useMemo(() => {
|
package/src/Core/Table/Table.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode, useMemo, CSSProperties } from 'react';
|
|
2
2
|
import { styled } from 'styled-components';
|
|
3
3
|
import { Row } from './Row';
|
|
4
4
|
import { Cell, HeadCell } from './Cell';
|
|
@@ -24,12 +24,12 @@ export type RenderHeaderCellProps<T = string> = {
|
|
|
24
24
|
interface TableProps {
|
|
25
25
|
columns: ColumnTable[];
|
|
26
26
|
rowCount: number;
|
|
27
|
-
renderCell: (props: RenderCellProps<any>) =>
|
|
28
|
-
renderHeaderCell: (props: RenderHeaderCellProps<any>) =>
|
|
27
|
+
renderCell: (props: RenderCellProps<any>) => any;
|
|
28
|
+
renderHeaderCell: (props: RenderHeaderCellProps<any>) => any;
|
|
29
29
|
rowIds?: string[];
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export const Table
|
|
32
|
+
export const Table = ({ columns, rowCount, renderCell, renderHeaderCell, rowIds }: TableProps) => {
|
|
33
33
|
const cellCount = columns.length;
|
|
34
34
|
|
|
35
35
|
const data = useMemo(() => {
|
|
@@ -49,7 +49,7 @@ export const Table: FC<TableProps> = ({ columns, rowCount, renderCell, renderHea
|
|
|
49
49
|
|
|
50
50
|
return (
|
|
51
51
|
<StyledTable>
|
|
52
|
-
<
|
|
52
|
+
<StyledHead>
|
|
53
53
|
<Row>
|
|
54
54
|
{columns.map(({ id, title, width }) => (
|
|
55
55
|
<HeadCell
|
|
@@ -62,7 +62,7 @@ export const Table: FC<TableProps> = ({ columns, rowCount, renderCell, renderHea
|
|
|
62
62
|
</HeadCell>
|
|
63
63
|
))}
|
|
64
64
|
</Row>
|
|
65
|
-
</
|
|
65
|
+
</StyledHead>
|
|
66
66
|
<tbody>
|
|
67
67
|
{data.map((cells, rowIndex) => (
|
|
68
68
|
<Row key={`row-${rowIndex}`} id={rowIds ? rowIds[rowIndex] : `row-${rowIndex}`}>
|
|
@@ -83,3 +83,12 @@ const StyledTable = styled.table`
|
|
|
83
83
|
border-spacing: 0;
|
|
84
84
|
table-layout: fixed;
|
|
85
85
|
`;
|
|
86
|
+
|
|
87
|
+
const StyledHead = styled.thead(
|
|
88
|
+
({ theme }) => `
|
|
89
|
+
background-color: ${theme.colors.background};
|
|
90
|
+
position: sticky;
|
|
91
|
+
top: 0;
|
|
92
|
+
z-index: 1;
|
|
93
|
+
`
|
|
94
|
+
);
|