@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
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SVGProps } from 'react';
|
|
2
|
-
|
|
3
|
-
interface WayIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
-
fill?: string;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export const WayIcon = ({ fill = 'currentColor', ...props }: WayIconProps) => {
|
|
8
|
-
return (
|
|
9
|
-
<svg viewBox="0 0 35 17" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
-
<path
|
|
11
|
-
d="M25.226 7.83626C27.0276 7.66984 28.707 9.06174 28.707 10.8924C28.707 12.0876 27.3787 14.0847 26.6917 15.0832C26.478 15.3858 26.1116 15.9759 25.8673 16.2179C25.6993 16.3995 25.4551 16.4298 25.2566 16.2482C25.0428 16.0515 24.6306 15.3858 24.4321 15.1135C23.7756 14.1603 22.5084 12.254 22.4168 11.1345C22.2794 9.48536 23.5619 8.00268 25.2108 7.85139L25.226 7.83626ZM25.3634 9.65179C23.7909 9.8636 23.913 12.2994 25.5925 12.254C27.4093 12.2087 27.2108 9.40972 25.3634 9.65179Z"
|
|
12
|
-
fill={fill}
|
|
13
|
-
/>
|
|
14
|
-
<path
|
|
15
|
-
d="M12.7511 10.0087L13.5756 9.35818L13.6825 9.32792C15.3771 9.35818 16.9802 9.14636 18.2474 9.91796C20.0184 10.9921 18.7818 12.8228 16.1863 12.9438C14.2168 13.0346 12.0488 12.8682 10.0641 12.9438C6.75104 13.0649 6.68997 15.6217 9.9114 15.8336H23.3925L24.278 16.4992H9.56025C8.82741 16.4992 7.66709 16.0756 7.20907 15.773C5.20903 14.4719 6.73578 12.3235 9.81979 12.1874C11.7893 12.1117 13.9725 12.2781 15.942 12.1874C17.7589 12.1117 18.4459 10.8711 17.0718 10.2357C16.8733 10.1449 16.339 9.99361 16.0947 9.99361H12.7664L12.7511 10.0087Z"
|
|
16
|
-
fill={fill}
|
|
17
|
-
/>
|
|
18
|
-
<path
|
|
19
|
-
d="M9.63714 0.526254C12.3242 0.223666 14.4769 2.58385 13.6372 5.17098C13.0418 7.00163 11.5914 8.74151 10.5226 10.3301C10.37 10.4663 10.1257 10.4814 9.94249 10.4057C9.75928 10.3301 9.14858 9.4072 8.98064 9.18026C8.07986 7.9094 6.36991 5.36766 6.49205 3.80933C6.61419 2.251 8.03406 0.692677 9.63714 0.526254ZM10.141 2.59898C7.97299 2.70489 8.38521 6.24516 10.599 5.63999C12.3242 5.17098 12.0341 2.5082 10.141 2.59898Z"
|
|
20
|
-
fill={fill}
|
|
21
|
-
/>
|
|
22
|
-
</svg>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
export { AlertIcon } from './AlertIcon';
|
|
2
|
-
export { ApiIcon } from './ApiIcon';
|
|
3
|
-
export { ArrowCircleTopRightIcon } from './ArrowCircleTopRightIcon';
|
|
4
|
-
export { ArrowRightIcon } from './ArrowRightIcon';
|
|
5
|
-
export { BugReportIcon } from './BugReportIcon';
|
|
6
|
-
export { CalendarIcon } from './CalendarIcon';
|
|
7
|
-
export { ChevronLeftIcon } from './ChevronLeftIcon';
|
|
8
|
-
export { ChevronRightIcon } from './ChevronRightIcon';
|
|
9
|
-
export { CloseCircleIcon } from './CloseCircleIcon';
|
|
10
|
-
export { ClosedLockIcon } from './ClosedLockIcon';
|
|
11
|
-
export { DataSetsIcon } from './DataSetsIcon';
|
|
12
|
-
export { DeepSearchIcon } from './DeepSearchIcon';
|
|
13
|
-
export { DisabledVisibleIcon } from './DisabledVisibleIcon';
|
|
14
|
-
export { DocsIcon } from './DocsIcon';
|
|
15
|
-
export { DownloadIcon } from './DownloadIcon';
|
|
16
|
-
export { EditUserIcon } from './EditUserIcon';
|
|
17
|
-
export { EnableVisibleIcon } from './EnableVisibleIcon';
|
|
18
|
-
export { EnterArrowLeftIcon } from './EnterArrowLeftIcon';
|
|
19
|
-
export { FiltersIcon } from './FiltersIcon';
|
|
20
|
-
export { HomepageIcon } from './HomepageIcon';
|
|
21
|
-
export { InfoCircleIcon } from './InfoCircleIcon';
|
|
22
|
-
export { MapRadarIcon } from './MapRadarIcon';
|
|
23
|
-
export { MoonIcon } from './MoonIcon';
|
|
24
|
-
export { OpenLockIcon } from './OpenLockIcon';
|
|
25
|
-
export { OrganizationIcon } from './OrganizationIcon';
|
|
26
|
-
export { PasswordFinderIcon } from './PasswordFinderIcon';
|
|
27
|
-
export { PhonebookIcon } from './PhonebookIcon';
|
|
28
|
-
export { PrintIcon } from './PrintIcon';
|
|
29
|
-
export { Profiler2Icon } from './Profiler2Icon';
|
|
30
|
-
export { ProfilerIcon } from './ProfilerIcon';
|
|
31
|
-
export { SandBoxIcon } from './SandBoxIcon';
|
|
32
|
-
export { SearchIcon } from './SearchIcon';
|
|
33
|
-
export { StatisticIcon } from './StatisticIcon';
|
|
34
|
-
export { SunIcon } from './SunIcon';
|
|
35
|
-
export { UpRightArrowCircleIcon } from './UpRightArrowCircleIcon';
|
|
36
|
-
export { VectorIcon } from './VectorIcon';
|
|
37
|
-
export { BallsMenu } from './BallsMenu';
|
|
38
|
-
export { CheckIcon } from './Check';
|
|
39
|
-
export { ChevronDownIcon } from './ChevronDown';
|
|
40
|
-
export { ChevronUpIcon } from './ChevronUp';
|
|
41
|
-
export { PlusIcon } from './Plus';
|
|
42
|
-
export { UsersIcon } from './Users';
|
|
43
|
-
export { InfoCircleFilledIcon } from './InfoCircleFilled';
|
|
44
|
-
export { UnfoldIcon } from './Unfold';
|
|
45
|
-
export { CrossIcon } from './Cross';
|
|
46
|
-
export { MaximizeIcon } from './MaximizeIcon';
|
|
47
|
-
export { BusIcon } from './BusIcon';
|
|
48
|
-
export { CarIcon } from './CarIcon';
|
|
49
|
-
export { WayIcon } from './WayIcon';
|
|
50
|
-
export { PlaneIcon } from './PlaneIcon';
|
|
51
|
-
export { ShipIcon } from './ShipIcon';
|
|
52
|
-
export { FileIcon } from './FileIcon';
|
|
53
|
-
export { IosIcon } from './IosIcon';
|
|
54
|
-
export { AndroidIcon } from './AndroidIcon';
|
|
55
|
-
export { MicrosoftIcon } from './MicrosoftIcon';
|
|
56
|
-
export { FolderAlertIcon } from './FolderAlertIcon';
|
|
57
|
-
export { RelationIcon } from './RelationIcon';
|
|
58
|
-
export { RelationPointsIcon } from './RelationPointsIcon';
|
|
59
|
-
export { PassportIcon } from './PassportIcon';
|
|
60
|
-
export { PointIcon } from './PointIcon';
|
|
61
|
-
export { PencilIcon } from './PencilIcon';
|
|
62
|
-
export { UserInCircleIcon } from './UserInCircle';
|
|
63
|
-
export { FlashIcon } from './FlashIcon';
|
|
64
|
-
export { FolderInfoIcon } from './FolderInfoIcon';
|
|
65
|
-
export { RotateLeftIcon } from './RotateLeftIcon';
|
|
66
|
-
export { RotateRightIcon } from './RotateRightIcon';
|
package/src/Core/Input/Input.tsx
DELETED
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
import { InputSize, InputVariant, remToPx } from '../../Theme';
|
|
2
|
-
import { forwardRef, InputHTMLAttributes, Ref, TextareaHTMLAttributes, useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { styled, useTheme } from 'styled-components';
|
|
4
|
-
import { InfoCircleFilledIcon } from '../IconComponents';
|
|
5
|
-
|
|
6
|
-
type BaseInputProps = {
|
|
7
|
-
error?: boolean;
|
|
8
|
-
append?: any;
|
|
9
|
-
prepend?: any;
|
|
10
|
-
size?: InputSize;
|
|
11
|
-
variant?: InputVariant;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type InputElementProps = BaseInputProps &
|
|
15
|
-
InputHTMLAttributes<HTMLInputElement> & {
|
|
16
|
-
multiline?: false;
|
|
17
|
-
};
|
|
18
|
-
export type TextAreaElementProps = BaseInputProps &
|
|
19
|
-
TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
20
|
-
multiline: true;
|
|
21
|
-
autoResize?: boolean;
|
|
22
|
-
};
|
|
23
|
-
export type InputProps = InputElementProps | TextAreaElementProps;
|
|
24
|
-
|
|
25
|
-
type TextAreaInputProps = TextareaHTMLAttributes<HTMLTextAreaElement> & {
|
|
26
|
-
size?: InputSize;
|
|
27
|
-
autoResize?: boolean;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
type InputRefElement<T> = T extends true ? HTMLTextAreaElement : HTMLInputElement | null;
|
|
31
|
-
|
|
32
|
-
export const Input: any = forwardRef<InputRefElement<InputProps['multiline']>, InputProps>(function Input(
|
|
33
|
-
{ error, append, prepend, size = 'small', variant = 'outlined', multiline, disabled, className, ...props },
|
|
34
|
-
ref
|
|
35
|
-
) {
|
|
36
|
-
return (
|
|
37
|
-
<Group
|
|
38
|
-
$align={multiline ? 'flex-start' : 'center'}
|
|
39
|
-
className={className}
|
|
40
|
-
$error={error}
|
|
41
|
-
$size={size}
|
|
42
|
-
$variant={variant}
|
|
43
|
-
$disabled={!!disabled}
|
|
44
|
-
$multiline={multiline}
|
|
45
|
-
>
|
|
46
|
-
{!!prepend && prepend}
|
|
47
|
-
<InputGroup $size={size} $variant={variant}>
|
|
48
|
-
{multiline ? (
|
|
49
|
-
<TextAreaInput
|
|
50
|
-
size={size}
|
|
51
|
-
disabled={disabled}
|
|
52
|
-
{...(props as TextAreaElementProps)}
|
|
53
|
-
ref={ref as Ref<InputRefElement<true>>}
|
|
54
|
-
/>
|
|
55
|
-
) : (
|
|
56
|
-
<StyledInput disabled={disabled} {...(props as InputElementProps)} ref={ref as Ref<InputRefElement<false>>} />
|
|
57
|
-
)}
|
|
58
|
-
{!!error && (
|
|
59
|
-
<IconWrapper $variant={variant}>
|
|
60
|
-
<InfoCircleFilledIcon />
|
|
61
|
-
</IconWrapper>
|
|
62
|
-
)}
|
|
63
|
-
</InputGroup>
|
|
64
|
-
{!!append && append}
|
|
65
|
-
</Group>
|
|
66
|
-
);
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
const TextAreaInput = forwardRef<HTMLTextAreaElement, TextAreaInputProps>(function Input(
|
|
70
|
-
{ size = 'small', disabled, className, rows = '1', autoResize = false, ...props },
|
|
71
|
-
ref
|
|
72
|
-
) {
|
|
73
|
-
const [areaSize, setAreaSize] = useState(Number(rows));
|
|
74
|
-
const rowsRef = useRef(Number(rows));
|
|
75
|
-
const divRef = useRef<HTMLDivElement>(null);
|
|
76
|
-
const theme = useTheme();
|
|
77
|
-
const rowHeight = useRef(remToPx(theme.input.sizes[size].lineHeight, theme.baseSize) || theme.baseSize);
|
|
78
|
-
|
|
79
|
-
useEffect(() => {
|
|
80
|
-
if (divRef.current && autoResize) {
|
|
81
|
-
const height = divRef.current.getBoundingClientRect().height;
|
|
82
|
-
const areaSize = Math.round(height / rowHeight.current);
|
|
83
|
-
if (rowsRef.current !== areaSize) {
|
|
84
|
-
rowsRef.current = areaSize;
|
|
85
|
-
setAreaSize(areaSize);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, [props.value]);
|
|
89
|
-
|
|
90
|
-
return (
|
|
91
|
-
<div style={{ position: 'relative', width: '100%' }}>
|
|
92
|
-
<StyledTextarea disabled={disabled} $autoResize={autoResize} {...props} rows={areaSize} ref={ref} />
|
|
93
|
-
<SizeContainer
|
|
94
|
-
ref={divRef}
|
|
95
|
-
$size={size}
|
|
96
|
-
style={{
|
|
97
|
-
minHeight: rowHeight.current * Number(rows),
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
{(props.value || '') + '\u200B'}
|
|
101
|
-
</SizeContainer>
|
|
102
|
-
</div>
|
|
103
|
-
);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
type StyledInputProps = { $size: InputSize; $variant: InputVariant };
|
|
107
|
-
type StyledGroupProps = StyledInputProps & {
|
|
108
|
-
$align: 'flex-start' | 'center';
|
|
109
|
-
$disabled: boolean;
|
|
110
|
-
$error?: boolean;
|
|
111
|
-
$multiline?: boolean;
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
const StyledTextarea = styled.textarea<{ $autoResize: boolean }>(
|
|
115
|
-
({ $autoResize }) => `
|
|
116
|
-
resize: none;
|
|
117
|
-
margin: 0;
|
|
118
|
-
display: block;
|
|
119
|
-
${$autoResize ? 'overflow: hidden;' : ''}
|
|
120
|
-
`
|
|
121
|
-
);
|
|
122
|
-
|
|
123
|
-
const StyledInput = styled.input``;
|
|
124
|
-
|
|
125
|
-
const InputGroup = styled.div<StyledInputProps>(
|
|
126
|
-
({ theme, $size, $variant }) => `
|
|
127
|
-
display: inline-flex;
|
|
128
|
-
align-items: center;
|
|
129
|
-
width: 100%;
|
|
130
|
-
color: currentColor;
|
|
131
|
-
|
|
132
|
-
svg {
|
|
133
|
-
width: ${theme.input.sizes[$size].iconSize};
|
|
134
|
-
height: ${theme.input.sizes[$size].iconSize};
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
& ${StyledInput}, & ${StyledTextarea}{
|
|
138
|
-
font-size: ${theme.input.sizes[$size].fontSize};
|
|
139
|
-
color: inherit;
|
|
140
|
-
background: transparent;
|
|
141
|
-
padding-block: ${theme.input.sizes[$size].paddingBlock};
|
|
142
|
-
padding-inline: ${theme.input.sizes[$size].paddingInline};
|
|
143
|
-
position: relative;
|
|
144
|
-
width: 100%;
|
|
145
|
-
outline: none;
|
|
146
|
-
border: none;
|
|
147
|
-
|
|
148
|
-
&::placeholder {
|
|
149
|
-
color: ${theme.input[$variant].default.placeholder};
|
|
150
|
-
font-size: ${theme.input.sizes[$size].fontSize};
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
&:disabled {
|
|
154
|
-
cursor: not-allowed;
|
|
155
|
-
color: inherit;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
&:focus, &:focus-visible, &:focus:focus-visible {
|
|
159
|
-
outline: none;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
`
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
const SizeContainer = styled.div<{ $size: InputSize }>(
|
|
166
|
-
({ theme, $size }) => `
|
|
167
|
-
position: absolute;
|
|
168
|
-
top: 0;
|
|
169
|
-
left: 0;
|
|
170
|
-
right: 0;
|
|
171
|
-
height: auto;
|
|
172
|
-
opacity: 0;
|
|
173
|
-
z-index: -1;
|
|
174
|
-
pointer-events: none;
|
|
175
|
-
padding-inline: ${theme.input.sizes[$size].paddingInline};
|
|
176
|
-
font-size: ${theme.input.sizes[$size].fontSize};
|
|
177
|
-
line-height: ${theme.input.sizes[$size].lineHeight};
|
|
178
|
-
word-break: break-word;
|
|
179
|
-
white-space: pre-wrap;
|
|
180
|
-
`
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
const IconWrapper = styled.span<{ $variant: InputVariant }>(
|
|
184
|
-
({ theme, $variant }) => `
|
|
185
|
-
display: inline-flex;
|
|
186
|
-
flex: 0 0 auto;
|
|
187
|
-
align-items: center;
|
|
188
|
-
color: ${theme.input[$variant].error.icon};
|
|
189
|
-
margin-right: 10px;
|
|
190
|
-
|
|
191
|
-
`
|
|
192
|
-
);
|
|
193
|
-
|
|
194
|
-
const Group = styled.div<StyledGroupProps>(
|
|
195
|
-
({ theme, $align = 'center', $disabled, $error, $size, $variant, $multiline }) => `
|
|
196
|
-
display: inline-flex;
|
|
197
|
-
align-items: ${$align};
|
|
198
|
-
width: 100%;
|
|
199
|
-
border: 1px solid;
|
|
200
|
-
border-radius: ${theme.input.sizes[$size].borderRadius};
|
|
201
|
-
height: ${$multiline ? 'auto' : theme.input.sizes[$size].height};
|
|
202
|
-
overflow: hidden;
|
|
203
|
-
transition: all 0.2s ease;
|
|
204
|
-
|
|
205
|
-
${
|
|
206
|
-
$error
|
|
207
|
-
? `
|
|
208
|
-
border-color: ${theme.input[$variant].error.border};
|
|
209
|
-
color: ${theme.input[$variant].error.text};
|
|
210
|
-
background: ${theme.input[$variant].error.background};
|
|
211
|
-
`
|
|
212
|
-
: `
|
|
213
|
-
border-color: ${theme.input[$variant].default.border};
|
|
214
|
-
color: ${theme.input[$variant].default.text};
|
|
215
|
-
background: ${theme.input[$variant].default.background};
|
|
216
|
-
`
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
${
|
|
220
|
-
!$disabled &&
|
|
221
|
-
!$error &&
|
|
222
|
-
`
|
|
223
|
-
&:hover {
|
|
224
|
-
border-color: ${theme.input[$variant].focus.border};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
&:focus-within {
|
|
228
|
-
border-color: ${theme.input[$variant].focus.border};
|
|
229
|
-
color: ${theme.input[$variant].focus.text};
|
|
230
|
-
background: ${theme.input[$variant].focus.background};
|
|
231
|
-
}
|
|
232
|
-
`
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
${
|
|
236
|
-
$disabled &&
|
|
237
|
-
`
|
|
238
|
-
border-color: ${theme.input[$variant].disabled.border};
|
|
239
|
-
color: ${theme.input[$variant].disabled.text};
|
|
240
|
-
background: ${theme.input[$variant].disabled.background};
|
|
241
|
-
cursor: not-allowed;
|
|
242
|
-
`
|
|
243
|
-
}
|
|
244
|
-
`
|
|
245
|
-
);
|
package/src/Core/Input/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Input';
|
package/src/Core/Label/Label.tsx
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import styled from 'styled-components';
|
|
3
|
-
import {
|
|
4
|
-
FabricComponent,
|
|
5
|
-
LabelSize,
|
|
6
|
-
createComponent,
|
|
7
|
-
createStyledComponent,
|
|
8
|
-
generatePropertySpaceStyle,
|
|
9
|
-
propToRem,
|
|
10
|
-
} from '../../Theme';
|
|
11
|
-
|
|
12
|
-
type LabelProps = FabricComponent<{
|
|
13
|
-
label?: any;
|
|
14
|
-
helpText?: any;
|
|
15
|
-
errorText?: string;
|
|
16
|
-
size?: LabelSize;
|
|
17
|
-
children: any;
|
|
18
|
-
fullWidth?: boolean;
|
|
19
|
-
}> &
|
|
20
|
-
Omit<React.LabelHTMLAttributes<HTMLLabelElement>, 'children'> &
|
|
21
|
-
(LabelDirection | LabelDirectionRaw);
|
|
22
|
-
|
|
23
|
-
type LabelDirectionRaw = {
|
|
24
|
-
direction?: 'row' | 'row-reverse';
|
|
25
|
-
childrenWidth?: number | string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
type LabelDirection = {
|
|
29
|
-
direction?: Omit<React.CSSProperties['flexDirection'], 'row' | 'row-reverse'>;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Label = createComponent<LabelProps>(
|
|
33
|
-
({ label, helpText, children, direction = 'column', size = 'small', errorText, fullWidth, ...props }) => {
|
|
34
|
-
const $isRow = direction === 'row' || direction === 'row-reverse';
|
|
35
|
-
const $width = $isRow ? (props as LabelDirectionRaw).childrenWidth || '50%' : '100%';
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<StyledLabel $size={size} $direction={direction} $fullWidth={fullWidth} $isRow={$isRow} {...props}>
|
|
39
|
-
{Boolean(label || helpText) && (
|
|
40
|
-
<LabelWrapper $width={$width}>
|
|
41
|
-
{!!label && <LabelText $size={size}>{label}</LabelText>}
|
|
42
|
-
{!!helpText && <HelpText $size={size}>{helpText}</HelpText>}
|
|
43
|
-
</LabelWrapper>
|
|
44
|
-
)}
|
|
45
|
-
<Wrapper $width={$width}>
|
|
46
|
-
{children}
|
|
47
|
-
{!!errorText && <ErrorText $size={size}>{errorText}</ErrorText>}
|
|
48
|
-
</Wrapper>
|
|
49
|
-
</StyledLabel>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
type StyledProps = {
|
|
55
|
-
$size: LabelSize;
|
|
56
|
-
$direction?: LabelDirection['direction'] | LabelDirectionRaw['direction'];
|
|
57
|
-
$fullWidth?: boolean;
|
|
58
|
-
$isRow: boolean;
|
|
59
|
-
children?: any;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
type WrapperProps = { $width: number | string };
|
|
63
|
-
type TextProps = { $size: LabelSize };
|
|
64
|
-
|
|
65
|
-
const Wrapper = styled.div<WrapperProps>(
|
|
66
|
-
({ theme, $width }) => `
|
|
67
|
-
flex-basis: 100%;
|
|
68
|
-
@media (min-width: ${theme.breakpoints.m}px) {
|
|
69
|
-
flex-basis: ${propToRem($width, theme.baseSize)};
|
|
70
|
-
}
|
|
71
|
-
`
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const LabelWrapper = styled(Wrapper)<WrapperProps>`
|
|
75
|
-
align-self: flex-start;
|
|
76
|
-
`;
|
|
77
|
-
|
|
78
|
-
const LabelText = styled.div<TextProps>(
|
|
79
|
-
({ theme, $size }) => `
|
|
80
|
-
line-height: 1.2;
|
|
81
|
-
font-weight: 500;
|
|
82
|
-
font-size: ${theme.label.sizes[$size].fontSize};
|
|
83
|
-
color: ${theme.label.color};
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
:hover {
|
|
86
|
-
color: ${theme.colors.primary.main};
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
`
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
const HelpText = styled.div<TextProps>(
|
|
93
|
-
({ theme, $size }) => `
|
|
94
|
-
margin-top: ${theme.label.sizes[$size].helpText.marginTop};
|
|
95
|
-
word-break: break-word;
|
|
96
|
-
line-height: 1.2;
|
|
97
|
-
font-size: ${theme.label.sizes[$size].helpText.fontSize};
|
|
98
|
-
color: ${theme.label.helpTextColor};
|
|
99
|
-
`
|
|
100
|
-
);
|
|
101
|
-
const ErrorText = styled.div<TextProps>(
|
|
102
|
-
({ theme, $size }) => `
|
|
103
|
-
margin-top: ${theme.label.sizes[$size].helpText.marginTop};
|
|
104
|
-
word-break: break-word;
|
|
105
|
-
line-height: 1.2;
|
|
106
|
-
font-size: ${theme.label.sizes[$size].helpText.fontSize};
|
|
107
|
-
color: ${theme.colors.error};
|
|
108
|
-
`
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
const StyledLabel = createStyledComponent<FabricComponent<StyledProps>>(
|
|
112
|
-
styled.label(
|
|
113
|
-
({
|
|
114
|
-
theme,
|
|
115
|
-
$direction = 'column',
|
|
116
|
-
$isRow,
|
|
117
|
-
$size,
|
|
118
|
-
$fullWidth = false,
|
|
119
|
-
mb = theme.label.sizes[$size].marginBottom,
|
|
120
|
-
}) => {
|
|
121
|
-
return `
|
|
122
|
-
display: inline-flex;
|
|
123
|
-
justify-content: space-between;
|
|
124
|
-
${$fullWidth ? 'width: 100%;' : ''}
|
|
125
|
-
min-width: 0;
|
|
126
|
-
flex-direction: column;
|
|
127
|
-
|
|
128
|
-
@media (min-width: ${theme.breakpoints.m}px) {
|
|
129
|
-
flex-direction: ${$direction};
|
|
130
|
-
align-items: ${$isRow ? 'center' : 'stretch'};
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
gap: ${theme.label.sizes[$size].gap};
|
|
134
|
-
${generatePropertySpaceStyle(theme, 'margin-bottom', mb)};
|
|
135
|
-
`;
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
{ ignoreStyles: ['margin-bottom'] }
|
|
139
|
-
);
|
package/src/Core/Label/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Label';
|
package/src/Core/Line/Line.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { createComponent, createStyledComponent, FabricComponent, StyledFabricComponent } from '../../Theme';
|
|
2
|
-
import { styled } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
type LineProps = FabricComponent<
|
|
5
|
-
{
|
|
6
|
-
direction?: 'horizontal' | 'vertical';
|
|
7
|
-
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'children'>
|
|
8
|
-
>;
|
|
9
|
-
|
|
10
|
-
export const Line = createComponent<LineProps>(({ direction = 'horizontal', ...props }) => {
|
|
11
|
-
return <StyledLine {...props} $direction={direction} />;
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
interface StyledLineProps {
|
|
15
|
-
$direction: 'horizontal' | 'vertical';
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const StyledLine = createStyledComponent<StyledFabricComponent<StyledLineProps>>(
|
|
19
|
-
styled.div(
|
|
20
|
-
({ theme, $direction }) => `
|
|
21
|
-
width: ${$direction === 'horizontal' ? '100%' : theme.line.size};
|
|
22
|
-
height: ${$direction === 'vertical' ? '100%' : theme.line.size};
|
|
23
|
-
background-color: ${theme.line.color};
|
|
24
|
-
`
|
|
25
|
-
)
|
|
26
|
-
);
|
package/src/Core/Line/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './Line';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { createComponent, createStyledComponent, propToRem, pxToRem, StyledFabricComponent } from '../../Theme';
|
|
2
|
-
import { styled } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
type Direction = 'horizontal' | 'vertical';
|
|
5
|
-
|
|
6
|
-
type LinerProgressProps = {
|
|
7
|
-
height?: number;
|
|
8
|
-
width?: string | number;
|
|
9
|
-
direction?: Direction;
|
|
10
|
-
value: number;
|
|
11
|
-
} & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'children'>;
|
|
12
|
-
|
|
13
|
-
export const LinerProgress = createComponent<LinerProgressProps>(
|
|
14
|
-
({ height = 21, width = '100%', direction = 'horizontal', value, ...props }: LinerProgressProps) => {
|
|
15
|
-
return <StyledLine {...props} $height={height} $value={value} $width={width} $direction={direction} />;
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
interface StyledLineProps {
|
|
20
|
-
$height: number;
|
|
21
|
-
$value: number;
|
|
22
|
-
$width: string | number;
|
|
23
|
-
$direction: Direction;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const StyledLine = createStyledComponent<StyledFabricComponent<StyledLineProps>>(
|
|
27
|
-
styled.div(
|
|
28
|
-
({ theme, $height, $value, $width, $direction }) => `
|
|
29
|
-
width: ${propToRem($width, theme.baseSize)};
|
|
30
|
-
height: ${propToRem($height, theme.baseSize)};
|
|
31
|
-
background-color: ${theme.leanerProgress.background};
|
|
32
|
-
position: relative;
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
border-radius: ${pxToRem(2, theme.baseSize)};
|
|
35
|
-
&::after {
|
|
36
|
-
position: absolute;
|
|
37
|
-
content: '';
|
|
38
|
-
left: 0;
|
|
39
|
-
bottom: 0;
|
|
40
|
-
width: ${$direction === 'horizontal' ? `${$value}%` : propToRem($width, theme.baseSize)};
|
|
41
|
-
height: ${$direction === 'horizontal' ? '100%' : `${$value}%`};
|
|
42
|
-
background-color: ${theme.leanerProgress.progressColor};
|
|
43
|
-
border-radius: ${pxToRem(2, theme.baseSize)};
|
|
44
|
-
}
|
|
45
|
-
`
|
|
46
|
-
)
|
|
47
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './LinerProgress';
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { styled } from 'styled-components';
|
|
3
|
-
|
|
4
|
-
export interface ListMenuProps {
|
|
5
|
-
children: any;
|
|
6
|
-
width?: number;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
type StyledListProps = {
|
|
10
|
-
$width: number;
|
|
11
|
-
};
|
|
12
|
-
export const ListMenu = ({ children, width = 220 }: ListMenuProps) => {
|
|
13
|
-
return <StyledList $width={width}>{children}</StyledList>;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const StyledList = styled.ul<StyledListProps>(
|
|
17
|
-
({ theme, $width }) => `
|
|
18
|
-
margin: 0;
|
|
19
|
-
padding: 20px;
|
|
20
|
-
width: ${$width}px;
|
|
21
|
-
list-style: none;
|
|
22
|
-
height: 100%;
|
|
23
|
-
overflow-y: auto;
|
|
24
|
-
background-color: ${theme.colors.background};
|
|
25
|
-
border-right: 1px solid ${theme.colors.stroke.light};
|
|
26
|
-
display: flex;
|
|
27
|
-
flex-direction: column;
|
|
28
|
-
justify-content: flex-start;
|
|
29
|
-
gap: 40px;
|
|
30
|
-
`
|
|
31
|
-
);
|