@cyber-harbour/ui 1.0.74 → 1.0.76
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/README.md +76 -0
- package/bin/switch-ui-lib.js +196 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +90 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +26 -26
- package/dist/index.mjs.map +1 -1
- package/package.json +12 -2
- package/.env.example +0 -0
- package/src/Core/Alert/Alert.tsx +0 -87
- package/src/Core/Alert/index.ts +0 -1
- package/src/Core/Box/Box.tsx +0 -46
- package/src/Core/Box/index.ts +0 -1
- package/src/Core/Button/Button.tsx +0 -208
- package/src/Core/Button/index.ts +0 -1
- package/src/Core/Checkbox/Checkbox.tsx +0 -73
- package/src/Core/Checkbox/index.ts +0 -1
- package/src/Core/ContentLoader/ContentLoader.tsx +0 -13
- package/src/Core/ContentLoader/index.ts +0 -1
- package/src/Core/ContextMenu/ContextMenu.tsx +0 -153
- package/src/Core/ContextMenu/ContextMenuDelimiter.tsx +0 -13
- package/src/Core/ContextMenu/index.ts +0 -3
- package/src/Core/ContextMenu/useContextMenuControl.ts +0 -21
- package/src/Core/Drawer/Drawer.tsx +0 -118
- package/src/Core/Drawer/index.ts +0 -1
- package/src/Core/EmptyData/EmptyData.tsx +0 -44
- package/src/Core/EmptyData/index.ts +0 -1
- package/src/Core/Flex/FlexContainer.tsx +0 -94
- package/src/Core/Flex/FlexItem.tsx +0 -58
- package/src/Core/Flex/index.ts +0 -4
- package/src/Core/Header/Header.tsx +0 -37
- package/src/Core/Header/HeaderDelimeter.tsx +0 -12
- package/src/Core/Header/HeaderSection.tsx +0 -37
- package/src/Core/Header/index.ts +0 -3
- package/src/Core/IconComponents/AlertIcon.tsx +0 -18
- package/src/Core/IconComponents/AndroidIcon.tsx +0 -28
- package/src/Core/IconComponents/ApiIcon.tsx +0 -26
- package/src/Core/IconComponents/ArrowCircleTopRightIcon.tsx +0 -27
- package/src/Core/IconComponents/ArrowRightIcon.tsx +0 -23
- package/src/Core/IconComponents/BallsMenu.tsx +0 -15
- package/src/Core/IconComponents/BugReportIcon.tsx +0 -16
- package/src/Core/IconComponents/BusIcon.tsx +0 -24
- package/src/Core/IconComponents/CalendarIcon.tsx +0 -26
- package/src/Core/IconComponents/CarIcon.tsx +0 -16
- package/src/Core/IconComponents/Check.tsx +0 -16
- package/src/Core/IconComponents/ChevronDown.tsx +0 -18
- package/src/Core/IconComponents/ChevronLeftIcon.tsx +0 -23
- package/src/Core/IconComponents/ChevronRightIcon.tsx +0 -23
- package/src/Core/IconComponents/ChevronUp.tsx +0 -18
- package/src/Core/IconComponents/CloseCircleIcon.tsx +0 -24
- package/src/Core/IconComponents/ClosedLockIcon.tsx +0 -22
- package/src/Core/IconComponents/Cross.tsx +0 -16
- package/src/Core/IconComponents/DataSetsIcon.tsx +0 -26
- package/src/Core/IconComponents/DeepSearchIcon.tsx +0 -16
- package/src/Core/IconComponents/DisabledVisibleIcon.tsx +0 -26
- package/src/Core/IconComponents/DocsIcon.tsx +0 -26
- package/src/Core/IconComponents/DownloadIcon.tsx +0 -26
- package/src/Core/IconComponents/EditUserIcon.tsx +0 -26
- package/src/Core/IconComponents/EnableVisibleIcon.tsx +0 -22
- package/src/Core/IconComponents/EnterArrowLeftIcon.tsx +0 -16
- package/src/Core/IconComponents/FileIcon.tsx +0 -16
- package/src/Core/IconComponents/FiltersIcon.tsx +0 -38
- package/src/Core/IconComponents/FlashIcon.tsx +0 -16
- package/src/Core/IconComponents/FolderAlertIcon.tsx +0 -32
- package/src/Core/IconComponents/FolderInfoIcon.tsx +0 -28
- package/src/Core/IconComponents/HomepageIcon.tsx +0 -16
- package/src/Core/IconComponents/InfoCircleFilled.tsx +0 -18
- package/src/Core/IconComponents/InfoCircleIcon.tsx +0 -23
- package/src/Core/IconComponents/IosIcon.tsx +0 -20
- package/src/Core/IconComponents/MapRadarIcon.tsx +0 -22
- package/src/Core/IconComponents/MaximizeIcon.tsx +0 -28
- package/src/Core/IconComponents/MicrosoftIcon.tsx +0 -28
- package/src/Core/IconComponents/MoonIcon.tsx +0 -16
- package/src/Core/IconComponents/OpenLockIcon.tsx +0 -30
- package/src/Core/IconComponents/OrganizationIcon.tsx +0 -26
- package/src/Core/IconComponents/PassportIcon.tsx +0 -796
- package/src/Core/IconComponents/PasswordFinderIcon.tsx +0 -22
- package/src/Core/IconComponents/PencilIcon.tsx +0 -16
- package/src/Core/IconComponents/PhonebookIcon.tsx +0 -22
- package/src/Core/IconComponents/PlaneIcon.tsx +0 -17
- package/src/Core/IconComponents/Plus.tsx +0 -20
- package/src/Core/IconComponents/PointIcon.tsx +0 -16
- package/src/Core/IconComponents/PrintIcon.tsx +0 -16
- package/src/Core/IconComponents/Profiler2Icon.tsx +0 -30
- package/src/Core/IconComponents/ProfilerIcon.tsx +0 -22
- package/src/Core/IconComponents/RelationIcon.tsx +0 -28
- package/src/Core/IconComponents/RelationPointsIcon.tsx +0 -36
- package/src/Core/IconComponents/RotateLeftIcon.tsx +0 -24
- package/src/Core/IconComponents/RotateRightIcon.tsx +0 -24
- package/src/Core/IconComponents/SandBoxIcon.tsx +0 -16
- package/src/Core/IconComponents/SearchIcon.tsx +0 -14
- package/src/Core/IconComponents/ShipIcon.tsx +0 -32
- package/src/Core/IconComponents/StatisticIcon.tsx +0 -26
- package/src/Core/IconComponents/SunIcon.tsx +0 -49
- package/src/Core/IconComponents/Unfold.tsx +0 -20
- package/src/Core/IconComponents/UpRightArrowCircleIcon.tsx +0 -22
- package/src/Core/IconComponents/UserInCircle.tsx +0 -24
- package/src/Core/IconComponents/Users.tsx +0 -36
- package/src/Core/IconComponents/VectorIcon.tsx +0 -17
- package/src/Core/IconComponents/WayIcon.tsx +0 -24
- package/src/Core/IconComponents/index.ts +0 -66
- package/src/Core/Input/Input.tsx +0 -245
- package/src/Core/Input/index.ts +0 -1
- package/src/Core/Label/Label.tsx +0 -139
- package/src/Core/Label/index.ts +0 -1
- package/src/Core/Line/Line.tsx +0 -26
- package/src/Core/Line/index.ts +0 -1
- package/src/Core/LinerProgress/LinerProgress.tsx +0 -47
- package/src/Core/LinerProgress/index.ts +0 -1
- package/src/Core/ListMenu/ListMenu.tsx +0 -31
- package/src/Core/ListMenu/ListMenuItem.tsx +0 -105
- package/src/Core/ListMenu/ListMenuSection.tsx +0 -54
- package/src/Core/ListMenu/index.ts +0 -3
- package/src/Core/Modal/Modal.tsx +0 -116
- package/src/Core/Modal/index.ts +0 -1
- package/src/Core/Overlay/Overlay.tsx +0 -94
- package/src/Core/Overlay/index.ts +0 -1
- package/src/Core/Pagination/Pagination.tsx +0 -139
- package/src/Core/Pagination/index.ts +0 -1
- package/src/Core/RowActionsMenu/RowActionsMenu.tsx +0 -153
- package/src/Core/RowActionsMenu/index.ts +0 -1
- package/src/Core/Select/Select.tsx +0 -197
- package/src/Core/Select/index.ts +0 -1
- package/src/Core/Sidebar/Sidebar.tsx +0 -80
- package/src/Core/Sidebar/SidebarContext.tsx +0 -13
- package/src/Core/Sidebar/SidebarDelimeter.tsx +0 -35
- package/src/Core/Sidebar/SidebarItem.tsx +0 -137
- package/src/Core/Sidebar/SidebarSection.tsx +0 -31
- package/src/Core/Sidebar/index.ts +0 -5
- package/src/Core/Switch/Switch.tsx +0 -71
- package/src/Core/Switch/index.ts +0 -1
- package/src/Core/Table/Cell.tsx +0 -42
- package/src/Core/Table/Row.tsx +0 -3
- package/src/Core/Table/Table.tsx +0 -94
- package/src/Core/Table/index.ts +0 -1
- package/src/Core/Tag/Tag.tsx +0 -144
- package/src/Core/Tag/index.ts +0 -1
- package/src/Core/Tooltip/Tooltip.tsx +0 -103
- package/src/Core/Tooltip/index.ts +0 -1
- package/src/Core/Typography/Typography.tsx +0 -70
- package/src/Core/Typography/index.ts +0 -1
- package/src/Core/index.ts +0 -27
- package/src/FullscreenCard/FullscreenCard.tsx +0 -56
- package/src/FullscreenCard/index.ts +0 -1
- package/src/Graph2D/Graph2D.tsx +0 -1837
- package/src/Graph2D/GraphLoader.tsx +0 -68
- package/src/Graph2D/icons/eye_light.png +0 -0
- package/src/Graph2D/icons/eye_light_hover.png +0 -0
- package/src/Graph2D/icons/group_light.png +0 -0
- package/src/Graph2D/icons/group_light_hover.png +0 -0
- package/src/Graph2D/index.ts +0 -2
- package/src/Graph2D/json_test.json +0 -44444
- package/src/Graph2D/types.ts +0 -122
- package/src/Layouts/Container/Container.tsx +0 -33
- package/src/Layouts/Container/index.ts +0 -1
- package/src/Layouts/PageLayout/PageLayout.tsx +0 -63
- package/src/Layouts/PageLayout/index.ts +0 -1
- package/src/Layouts/index.ts +0 -2
- package/src/Theme/Breakpoint.tsx +0 -50
- package/src/Theme/GlobalStyle.tsx +0 -18
- package/src/Theme/ThemeProvider.tsx +0 -30
- package/src/Theme/componentFabric.tsx +0 -159
- package/src/Theme/index.ts +0 -8
- package/src/Theme/styled.d.ts +0 -7
- package/src/Theme/themes/config.ts +0 -41
- package/src/Theme/themes/dark.ts +0 -1005
- package/src/Theme/themes/index.ts +0 -2
- package/src/Theme/themes/light.ts +0 -1004
- package/src/Theme/types.ts +0 -362
- package/src/Theme/useTheme.tsx +0 -7
- package/src/Theme/utils.ts +0 -205
- package/src/custom.d.ts +0 -19
- package/src/index.ts +0 -5
- package/src/utils.ts +0 -30
- package/tsconfig.paths.json +0 -5
- package/tsup.config.ts +0 -30
- package/tsup.dev.config.ts +0 -10
package/src/Core/Table/Table.tsx
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { ReactNode, useMemo, CSSProperties } from 'react';
|
|
2
|
-
import { styled } from 'styled-components';
|
|
3
|
-
import { Row } from './Row';
|
|
4
|
-
import { Cell, HeadCell } from './Cell';
|
|
5
|
-
|
|
6
|
-
export type ColumnTable<ID = string> = {
|
|
7
|
-
id: ID;
|
|
8
|
-
title: string;
|
|
9
|
-
width?: CSSProperties['width'];
|
|
10
|
-
className?: string;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export type RenderCellProps<T = string> = {
|
|
14
|
-
rowIndex: number;
|
|
15
|
-
cellIndex: number;
|
|
16
|
-
columnId: T;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type RenderHeaderCellProps<T = string> = {
|
|
20
|
-
title: string;
|
|
21
|
-
columnId: T;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
interface TableProps {
|
|
25
|
-
columns: ColumnTable[];
|
|
26
|
-
rowCount: number;
|
|
27
|
-
renderCell: (props: RenderCellProps<any>) => any;
|
|
28
|
-
renderHeaderCell: (props: RenderHeaderCellProps<any>) => any;
|
|
29
|
-
rowIds?: string[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export const Table = ({ columns, rowCount, renderCell, renderHeaderCell, rowIds }: TableProps) => {
|
|
33
|
-
const cellCount = columns.length;
|
|
34
|
-
|
|
35
|
-
const data = useMemo(() => {
|
|
36
|
-
const items: ReactNode[][] = [];
|
|
37
|
-
for (let i = 0; i < rowCount; i++) {
|
|
38
|
-
items[i] = [];
|
|
39
|
-
for (let j = 0; j < cellCount; j++) {
|
|
40
|
-
items[i][j] = renderCell({
|
|
41
|
-
rowIndex: i,
|
|
42
|
-
cellIndex: j,
|
|
43
|
-
columnId: columns[j].id,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
return items;
|
|
48
|
-
}, [rowCount, cellCount, columns, renderCell]);
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<StyledTable>
|
|
52
|
-
<StyledHead>
|
|
53
|
-
<Row>
|
|
54
|
-
{columns.map(({ id, title, width }) => (
|
|
55
|
-
<HeadCell
|
|
56
|
-
key={id}
|
|
57
|
-
style={{
|
|
58
|
-
width,
|
|
59
|
-
}}
|
|
60
|
-
>
|
|
61
|
-
{renderHeaderCell({ title, columnId: id })}
|
|
62
|
-
</HeadCell>
|
|
63
|
-
))}
|
|
64
|
-
</Row>
|
|
65
|
-
</StyledHead>
|
|
66
|
-
<tbody>
|
|
67
|
-
{data.map((cells, rowIndex) => (
|
|
68
|
-
<Row key={`row-${rowIndex}`} id={rowIds ? rowIds[rowIndex] : `row-${rowIndex}`}>
|
|
69
|
-
{cells.map((cell, cellIndex) => (
|
|
70
|
-
<Cell className={columns[cellIndex]?.className} key={`cell-${cellIndex}`}>
|
|
71
|
-
{cell}
|
|
72
|
-
</Cell>
|
|
73
|
-
))}
|
|
74
|
-
</Row>
|
|
75
|
-
))}
|
|
76
|
-
</tbody>
|
|
77
|
-
</StyledTable>
|
|
78
|
-
);
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const StyledTable = styled.table`
|
|
82
|
-
width: 100%;
|
|
83
|
-
border-spacing: 0;
|
|
84
|
-
table-layout: fixed;
|
|
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
|
-
);
|
package/src/Core/Table/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Table';
|
package/src/Core/Tag/Tag.tsx
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import {
|
|
4
|
-
FabricComponent,
|
|
5
|
-
createComponent,
|
|
6
|
-
TagVariant,
|
|
7
|
-
TagColor,
|
|
8
|
-
hexToRgba,
|
|
9
|
-
generatePropertySpaceStyle,
|
|
10
|
-
createStyledComponent,
|
|
11
|
-
} from '../../Theme';
|
|
12
|
-
import { CrossIcon } from '../IconComponents';
|
|
13
|
-
|
|
14
|
-
type TagProps = FabricComponent<{
|
|
15
|
-
children?: any;
|
|
16
|
-
variant?: TagVariant;
|
|
17
|
-
color?: TagColor;
|
|
18
|
-
className?: string;
|
|
19
|
-
icon?: any;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
onClick?: () => void;
|
|
22
|
-
onDelete?: () => void;
|
|
23
|
-
}> &
|
|
24
|
-
Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
25
|
-
|
|
26
|
-
export const Tag = createComponent<TagProps>(
|
|
27
|
-
({ children, variant = 'fill', color = 'default', className, disabled, icon, onClick, onDelete, ...props }) => {
|
|
28
|
-
return (
|
|
29
|
-
<StyledContainer
|
|
30
|
-
$variant={variant}
|
|
31
|
-
$color={color}
|
|
32
|
-
$clickable={!!onClick && !disabled}
|
|
33
|
-
onClick={!disabled ? onClick : undefined}
|
|
34
|
-
className={className}
|
|
35
|
-
{...props}
|
|
36
|
-
>
|
|
37
|
-
{!!children && <Content>{children}</Content>}
|
|
38
|
-
{!!onDelete && !disabled && (
|
|
39
|
-
<DeleteButton
|
|
40
|
-
aria-label="delete"
|
|
41
|
-
onClick={(e) => {
|
|
42
|
-
e.stopPropagation();
|
|
43
|
-
onDelete();
|
|
44
|
-
}}
|
|
45
|
-
>
|
|
46
|
-
<CrossIcon />
|
|
47
|
-
</DeleteButton>
|
|
48
|
-
)}
|
|
49
|
-
</StyledContainer>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
type StyledProps = {
|
|
55
|
-
$variant: TagVariant;
|
|
56
|
-
$color: TagColor;
|
|
57
|
-
$clickable: boolean;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const Content = styled.span(
|
|
61
|
-
({ theme }) => `
|
|
62
|
-
display: inline-flex;
|
|
63
|
-
flex-wrap: wrap;
|
|
64
|
-
align-items: center;
|
|
65
|
-
justify-content: flex-start;
|
|
66
|
-
min-width: 0;
|
|
67
|
-
word-break: break-word;
|
|
68
|
-
|
|
69
|
-
font-size: 14px;
|
|
70
|
-
line-height: 16px;
|
|
71
|
-
@media (min-width: ${theme.breakpoints.m}) {
|
|
72
|
-
justify-content: center;
|
|
73
|
-
}
|
|
74
|
-
`
|
|
75
|
-
);
|
|
76
|
-
|
|
77
|
-
const DeleteButton = styled.button`
|
|
78
|
-
align-self: flex-start;
|
|
79
|
-
border: none;
|
|
80
|
-
outline: none;
|
|
81
|
-
background-color: transparent;
|
|
82
|
-
cursor: pointer;
|
|
83
|
-
color: currentColor;
|
|
84
|
-
transition: color 0.2s ease;
|
|
85
|
-
svg {
|
|
86
|
-
width: 10px;
|
|
87
|
-
height: 10px;
|
|
88
|
-
fill: currentColor;
|
|
89
|
-
}
|
|
90
|
-
`;
|
|
91
|
-
|
|
92
|
-
const Container = styled.div<FabricComponent<StyledProps>>(
|
|
93
|
-
({
|
|
94
|
-
theme,
|
|
95
|
-
$variant,
|
|
96
|
-
$color,
|
|
97
|
-
$clickable,
|
|
98
|
-
py = theme.tag[$variant].paddingBlock,
|
|
99
|
-
px = theme.tag[$variant].paddingInline,
|
|
100
|
-
}) => {
|
|
101
|
-
const color = theme.tag[$variant].color[$color] || $color;
|
|
102
|
-
return `
|
|
103
|
-
display: inline-flex;
|
|
104
|
-
align-items: center;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
min-width: 0;
|
|
107
|
-
border-width: ${theme.tag[$variant].borderWidth};
|
|
108
|
-
border-style: solid;
|
|
109
|
-
border-color: ${color};
|
|
110
|
-
border-radius: ${theme.tag[$variant].borderRadius};
|
|
111
|
-
background-color: ${$variant === 'outlined' ? theme.colors.background : hexToRgba(color, 0.05)};
|
|
112
|
-
color: ${color};
|
|
113
|
-
|
|
114
|
-
${Content} {
|
|
115
|
-
${generatePropertySpaceStyle(theme, 'padding-block', py)};
|
|
116
|
-
${generatePropertySpaceStyle(theme, 'padding-inline', px)};
|
|
117
|
-
color: ${color};
|
|
118
|
-
${
|
|
119
|
-
$clickable
|
|
120
|
-
? `
|
|
121
|
-
cursor: pointer;
|
|
122
|
-
transition: color 0.2s ease;
|
|
123
|
-
&:hover {
|
|
124
|
-
color: ${hexToRgba(color, 0.7)};
|
|
125
|
-
}
|
|
126
|
-
`
|
|
127
|
-
: ''
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
${DeleteButton} {
|
|
131
|
-
${generatePropertySpaceStyle(theme, 'padding-block', py)};
|
|
132
|
-
${generatePropertySpaceStyle(theme, 'padding-right', px)};
|
|
133
|
-
|
|
134
|
-
&:hover {
|
|
135
|
-
color: ${hexToRgba(color, 0.7)};
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
`;
|
|
139
|
-
}
|
|
140
|
-
);
|
|
141
|
-
|
|
142
|
-
const StyledContainer = createStyledComponent(Container, {
|
|
143
|
-
ignoreStyles: ['padding-block', 'padding-inline'],
|
|
144
|
-
});
|
package/src/Core/Tag/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Tag';
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { useCallback, useState } from 'react';
|
|
2
|
-
import { Popover, PopoverAlign, PopoverPosition } from 'react-tiny-popover';
|
|
3
|
-
import { createComponent, pxToRem } from '../../Theme';
|
|
4
|
-
import { styled } from 'styled-components';
|
|
5
|
-
|
|
6
|
-
interface TooltipProps {
|
|
7
|
-
className?: string;
|
|
8
|
-
children?: any;
|
|
9
|
-
content?: any;
|
|
10
|
-
positions?: PopoverPosition[] | PopoverPosition;
|
|
11
|
-
align?: PopoverAlign;
|
|
12
|
-
anchorClassName?: string;
|
|
13
|
-
offset?: number;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const Tooltip = createComponent<TooltipProps>(
|
|
17
|
-
({ className, positions = ['top'], align = 'center', anchorClassName, content, offset = 6, children }) => {
|
|
18
|
-
const [isOpen, setIsOpen] = useState<boolean>(false);
|
|
19
|
-
|
|
20
|
-
const position = Array.isArray(positions) ? positions[0] : positions;
|
|
21
|
-
|
|
22
|
-
const handleMouseEnter = useCallback(() => {
|
|
23
|
-
if (content) setIsOpen(true);
|
|
24
|
-
}, [content]);
|
|
25
|
-
|
|
26
|
-
const handleClose = useCallback(() => {
|
|
27
|
-
setIsOpen(false);
|
|
28
|
-
}, []);
|
|
29
|
-
|
|
30
|
-
const handleClickOrTouch = useCallback(() => {
|
|
31
|
-
if (content) setIsOpen((prev) => !prev);
|
|
32
|
-
}, [content]);
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<Popover
|
|
36
|
-
padding={offset}
|
|
37
|
-
positions={positions}
|
|
38
|
-
isOpen={isOpen}
|
|
39
|
-
align={align}
|
|
40
|
-
onClickOutside={handleClose}
|
|
41
|
-
content={
|
|
42
|
-
!!content && (
|
|
43
|
-
<StyledContent className={className} $position={position} $offset={offset}>
|
|
44
|
-
{content}
|
|
45
|
-
</StyledContent>
|
|
46
|
-
)
|
|
47
|
-
}
|
|
48
|
-
containerStyle={{
|
|
49
|
-
zIndex: `${9999}`,
|
|
50
|
-
}}
|
|
51
|
-
>
|
|
52
|
-
<StyledAnchor
|
|
53
|
-
onMouseEnter={handleMouseEnter}
|
|
54
|
-
onMouseLeave={handleClose}
|
|
55
|
-
className={anchorClassName}
|
|
56
|
-
onTouchStart={handleClickOrTouch}
|
|
57
|
-
>
|
|
58
|
-
{children}
|
|
59
|
-
</StyledAnchor>
|
|
60
|
-
</Popover>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
const StyledAnchor = styled.div`
|
|
65
|
-
display: inline-block;
|
|
66
|
-
`;
|
|
67
|
-
|
|
68
|
-
const StyledContent = styled.div<{ $position: PopoverPosition; $offset: number }>(
|
|
69
|
-
({ theme, $position, $offset }) => `
|
|
70
|
-
padding: ${theme.tooltip.padding};
|
|
71
|
-
max-width: ${theme.tooltip.maxWidth};
|
|
72
|
-
border-radius: ${theme.tooltip.borderRadius};
|
|
73
|
-
background: ${theme.tooltip.background};
|
|
74
|
-
box-shadow: ${theme.tooltip.shadow};
|
|
75
|
-
|
|
76
|
-
color: ${theme.tooltip.color};
|
|
77
|
-
font-size: ${theme.tooltip.fontSize};
|
|
78
|
-
line-height: 1.4;
|
|
79
|
-
word-break: break-word;
|
|
80
|
-
white-space: pre-line;
|
|
81
|
-
animation: fadeIn-${$position} 0.3s ease forwards;
|
|
82
|
-
transform-origin: ${
|
|
83
|
-
$position === 'top' ? 'bottom' : $position === 'bottom' ? 'top' : $position === 'left' ? 'right' : 'left'
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
@keyframes fadeIn-top {
|
|
87
|
-
from { opacity: 0.5; transform: translateY(${pxToRem($offset, theme.baseSize)}); }
|
|
88
|
-
to { opacity: 1; transform: translateY(0); }
|
|
89
|
-
}
|
|
90
|
-
@keyframes fadeIn-bottom {
|
|
91
|
-
from { opacity: 0.5; transform: translateY(-${pxToRem($offset, theme.baseSize)}); }
|
|
92
|
-
to { opacity: 1; transform: translateY(0); }
|
|
93
|
-
}
|
|
94
|
-
@keyframes fadeIn-left {
|
|
95
|
-
from { opacity: 0.5; transform: translateX(${pxToRem($offset, theme.baseSize)}); }
|
|
96
|
-
to { opacity: 1; transform: translateX(0); }
|
|
97
|
-
}
|
|
98
|
-
@keyframes fadeIn-right {
|
|
99
|
-
from { opacity: 0.5; transform: translateX(-${pxToRem($offset, theme.baseSize)}); }
|
|
100
|
-
to { opacity: 1; transform: translateX(0); }
|
|
101
|
-
}
|
|
102
|
-
`
|
|
103
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Tooltip';
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { CSSProperties, ElementType } from 'react';
|
|
3
|
-
import {
|
|
4
|
-
ColorVariant,
|
|
5
|
-
createComponent,
|
|
6
|
-
createStyledComponent,
|
|
7
|
-
FabricComponent,
|
|
8
|
-
StyledFabricComponent,
|
|
9
|
-
TypographyVariant,
|
|
10
|
-
} from '../../Theme';
|
|
11
|
-
import { resolveThemeColor } from '../../Theme/utils';
|
|
12
|
-
|
|
13
|
-
type TypographyProps = FabricComponent<{
|
|
14
|
-
style?: CSSProperties;
|
|
15
|
-
variant?: TypographyVariant;
|
|
16
|
-
element?: ElementType;
|
|
17
|
-
children: any;
|
|
18
|
-
weight?: CSSProperties['fontWeight'];
|
|
19
|
-
fontStyle?: CSSProperties['fontStyle'];
|
|
20
|
-
color?: ColorVariant | string;
|
|
21
|
-
className?: string;
|
|
22
|
-
ellipsis?: boolean;
|
|
23
|
-
}> &
|
|
24
|
-
Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
25
|
-
|
|
26
|
-
type StyledProps = {
|
|
27
|
-
$variant: TypographyVariant;
|
|
28
|
-
$weight?: CSSProperties['fontWeight'];
|
|
29
|
-
$style?: CSSProperties['fontStyle'];
|
|
30
|
-
$color?: ColorVariant | string;
|
|
31
|
-
$ellipsis?: boolean;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
// Create a styled component that can be dynamically rendered as different HTML elements
|
|
35
|
-
const StyledTypography = createStyledComponent<StyledFabricComponent<StyledProps>>(
|
|
36
|
-
styled('div')(({ theme, $variant, $color, $weight = '400', $style = 'initial', $ellipsis }) => {
|
|
37
|
-
// Resolve color from theme if it's a theme color path, or use the direct color value
|
|
38
|
-
|
|
39
|
-
return `
|
|
40
|
-
font-size: ${theme.typography.variants[$variant].fontSize};
|
|
41
|
-
font-weight: ${$weight};
|
|
42
|
-
font-style: ${$style};
|
|
43
|
-
color: ${resolveThemeColor(theme, $color) || theme.colors.text.main};
|
|
44
|
-
${$ellipsis ? 'overflow: hidden; text-overflow: ellipsis; white-space: nowrap;' : ''}
|
|
45
|
-
`;
|
|
46
|
-
})
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
export const Typography = createComponent<TypographyProps>(
|
|
50
|
-
({ variant = 'body', element, children, weight, fontStyle, color, className, style, ellipsis = false, ...props }) => {
|
|
51
|
-
// Determine which HTML element to render based on the variant if not explicitly specified
|
|
52
|
-
const Element = element || (variant.startsWith('h') ? variant : 'p');
|
|
53
|
-
|
|
54
|
-
return (
|
|
55
|
-
<StyledTypography
|
|
56
|
-
as={Element}
|
|
57
|
-
$variant={variant}
|
|
58
|
-
$weight={weight}
|
|
59
|
-
$style={fontStyle}
|
|
60
|
-
$color={color}
|
|
61
|
-
$ellipsis={ellipsis}
|
|
62
|
-
className={className}
|
|
63
|
-
style={style}
|
|
64
|
-
{...props}
|
|
65
|
-
>
|
|
66
|
-
{children}
|
|
67
|
-
</StyledTypography>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Typography';
|
package/src/Core/index.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export * from './Button';
|
|
2
|
-
export * from './IconComponents';
|
|
3
|
-
export * from './Sidebar';
|
|
4
|
-
export * from './Typography';
|
|
5
|
-
export * from './ListMenu';
|
|
6
|
-
export * from './Header';
|
|
7
|
-
export * from './Table';
|
|
8
|
-
export * from './Pagination';
|
|
9
|
-
export * from './ContextMenu';
|
|
10
|
-
export * from './Select';
|
|
11
|
-
export * from './RowActionsMenu';
|
|
12
|
-
export * from './Input';
|
|
13
|
-
export * from './Flex';
|
|
14
|
-
export * from './Box';
|
|
15
|
-
export * from './Line';
|
|
16
|
-
export * from './EmptyData';
|
|
17
|
-
export * from './Tag';
|
|
18
|
-
export * from './Alert';
|
|
19
|
-
export * from './Label';
|
|
20
|
-
export * from './Checkbox';
|
|
21
|
-
export * from './LinerProgress';
|
|
22
|
-
export * from './Switch';
|
|
23
|
-
export * from './Drawer';
|
|
24
|
-
export * from './Tooltip';
|
|
25
|
-
export * from './ContentLoader';
|
|
26
|
-
export * from './Overlay';
|
|
27
|
-
export * from './Modal';
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components';
|
|
2
|
-
import { createComponent, pxToRem } from '../Theme';
|
|
3
|
-
|
|
4
|
-
interface FullscreenCardProps {
|
|
5
|
-
children: any;
|
|
6
|
-
className?: string;
|
|
7
|
-
position: 'absolute' | 'fixed';
|
|
8
|
-
isActive: boolean;
|
|
9
|
-
top?: number;
|
|
10
|
-
left?: number;
|
|
11
|
-
right?: number;
|
|
12
|
-
bottom?: number;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const FullscreenCard = createComponent<FullscreenCardProps>(
|
|
16
|
-
({ isActive, position, top = 0, left = 0, right, bottom, ...props }) => {
|
|
17
|
-
return (
|
|
18
|
-
<StyledContainer
|
|
19
|
-
$isActive={isActive}
|
|
20
|
-
$position={position}
|
|
21
|
-
$top={top}
|
|
22
|
-
$left={left}
|
|
23
|
-
$right={right}
|
|
24
|
-
$bottom={bottom}
|
|
25
|
-
{...props}
|
|
26
|
-
/>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
const StyledContainer = styled.div<{
|
|
32
|
-
$isActive: boolean;
|
|
33
|
-
$top?: number;
|
|
34
|
-
$left?: number;
|
|
35
|
-
$right?: number;
|
|
36
|
-
$bottom?: number;
|
|
37
|
-
$position: 'absolute' | 'fixed';
|
|
38
|
-
}>(
|
|
39
|
-
({ $isActive, $top, $left, $right, $bottom, $position, theme }) => `
|
|
40
|
-
${
|
|
41
|
-
$isActive
|
|
42
|
-
? `
|
|
43
|
-
position: ${$position};
|
|
44
|
-
z-index: 1000;
|
|
45
|
-
${typeof $top === 'number' ? `top: ${pxToRem($top, theme.baseSize)};` : ''}
|
|
46
|
-
${typeof $left === 'number' ? `left: ${pxToRem($left, theme.baseSize)};` : ''}
|
|
47
|
-
${typeof $right === 'number' ? `right: ${pxToRem($right, theme.baseSize)};` : ''}
|
|
48
|
-
${typeof $bottom === 'number' ? `bottom: ${pxToRem($bottom, theme.baseSize)};` : ''}
|
|
49
|
-
|
|
50
|
-
`
|
|
51
|
-
: ''
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
min-width: 0;
|
|
55
|
-
`
|
|
56
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './FullscreenCard';
|