@cyber-harbour/ui 1.0.59 → 1.0.61
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 +513 -43
- package/dist/index.d.ts +513 -43
- package/dist/index.js +343 -310
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +276 -243
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/Core/Alert/Alert.tsx +11 -5
- package/src/Core/Box/Box.tsx +19 -17
- package/src/Core/Button/Button.tsx +59 -55
- package/src/Core/Checkbox/Checkbox.tsx +6 -7
- package/src/Core/ContentLoader/ContentLoader.tsx +13 -0
- package/src/Core/ContentLoader/index.ts +1 -0
- package/src/Core/Drawer/Drawer.tsx +29 -14
- package/src/Core/Flex/FlexContainer.tsx +47 -45
- package/src/Core/Flex/FlexItem.tsx +19 -26
- package/src/Core/IconComponents/PencilIcon.tsx +16 -0
- package/src/Core/IconComponents/PointIcon.tsx +16 -0
- package/src/Core/IconComponents/index.ts +2 -0
- package/src/Core/Label/Label.tsx +31 -30
- package/src/Core/Line/Line.tsx +5 -5
- package/src/Core/LinerProgress/LinerProgress.tsx +14 -20
- package/src/Core/Switch/Switch.tsx +4 -4
- package/src/Core/Tag/Tag.tsx +29 -36
- package/src/Core/Tooltip/Tooltip.tsx +93 -0
- package/src/Core/Tooltip/index.ts +1 -0
- package/src/Core/Typography/Typography.tsx +31 -33
- package/src/Core/index.ts +2 -0
- package/src/Layouts/Container/Container.tsx +13 -7
- package/src/Theme/Breakpoint.tsx +50 -0
- package/src/Theme/ThemeProvider.tsx +5 -2
- package/src/Theme/{componentFabric.ts → componentFabric.tsx} +90 -36
- package/src/Theme/index.ts +1 -0
- package/src/Theme/themes/dark.ts +11 -0
- package/src/Theme/themes/light.ts +11 -0
- package/src/Theme/types.ts +11 -0
package/package.json
CHANGED
package/src/Core/Alert/Alert.tsx
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
FabricComponent,
|
|
5
|
+
StyledFabricComponent,
|
|
6
|
+
createComponent,
|
|
7
|
+
createStyledComponent,
|
|
8
|
+
generatePropertySpaceStyle,
|
|
9
|
+
} from '../../Theme';
|
|
4
10
|
import { AlertIcon } from '../IconComponents';
|
|
5
11
|
|
|
6
12
|
type AlertProps = FabricComponent<{
|
|
@@ -9,7 +15,7 @@ type AlertProps = FabricComponent<{
|
|
|
9
15
|
}> &
|
|
10
16
|
Omit<React.HTMLAttributes<HTMLDivElement>, 'children'>;
|
|
11
17
|
|
|
12
|
-
export const Alert = ({ title, note, ...props }
|
|
18
|
+
export const Alert = createComponent<AlertProps>(({ title, note, ...props }) => {
|
|
13
19
|
return (
|
|
14
20
|
<StyledContainer {...props}>
|
|
15
21
|
<IconWrapper>
|
|
@@ -21,7 +27,7 @@ export const Alert = ({ title, note, ...props }: AlertProps) => {
|
|
|
21
27
|
</div>
|
|
22
28
|
</StyledContainer>
|
|
23
29
|
);
|
|
24
|
-
};
|
|
30
|
+
});
|
|
25
31
|
|
|
26
32
|
const IconWrapper = styled.div(
|
|
27
33
|
({ theme: { alert } }) => `
|
|
@@ -60,8 +66,8 @@ const Note = styled.p(
|
|
|
60
66
|
`
|
|
61
67
|
);
|
|
62
68
|
|
|
63
|
-
const StyledContainer =
|
|
64
|
-
styled.div<
|
|
69
|
+
const StyledContainer = createStyledComponent(
|
|
70
|
+
styled.div<StyledFabricComponent>(
|
|
65
71
|
({ theme, py = theme.alert.paddingBlock, pl = theme.alert.paddingLeft, pr = theme.alert.paddingRight }) => {
|
|
66
72
|
return `
|
|
67
73
|
display: flex;
|
package/src/Core/Box/Box.tsx
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ColorVariant,
|
|
3
3
|
createComponent,
|
|
4
|
+
createStyledComponent,
|
|
4
5
|
FabricComponent,
|
|
5
6
|
generatePropertySpaceStyle,
|
|
6
7
|
resolveThemeColor,
|
|
8
|
+
StyledFabricComponent,
|
|
7
9
|
} from '../../Theme';
|
|
8
10
|
import { styled } from 'styled-components';
|
|
9
11
|
|
|
10
|
-
type BoxProps =
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
|
|
17
|
-
>;
|
|
12
|
+
type BoxProps = {
|
|
13
|
+
children?: any;
|
|
14
|
+
element?: 'div' | 'section';
|
|
15
|
+
hasBorder?: boolean;
|
|
16
|
+
color?: ColorVariant | string;
|
|
17
|
+
} & React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
18
18
|
|
|
19
|
-
export const Box = (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
export const Box = createComponent<BoxProps>(
|
|
20
|
+
({ children, element = 'div', hasBorder = true, color, ...props }): any => {
|
|
21
|
+
return (
|
|
22
|
+
<StyledBox as={element} $hasBorder={hasBorder} $color={color} {...props}>
|
|
23
|
+
{children}
|
|
24
|
+
</StyledBox>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
);
|
|
26
28
|
|
|
27
29
|
type StyledProps = { $hasBorder: boolean; $color?: string };
|
|
28
30
|
|
|
29
|
-
const StyledBox =
|
|
30
|
-
styled('div')<
|
|
31
|
+
const StyledBox = createStyledComponent(
|
|
32
|
+
styled('div')<StyledFabricComponent<StyledProps>>(
|
|
31
33
|
({ theme, $hasBorder, $color, px = theme.box.padding, py = theme.box.padding }) => `
|
|
32
34
|
${generatePropertySpaceStyle(theme, 'padding-inline', px)}
|
|
33
35
|
${generatePropertySpaceStyle(theme, 'padding-block', py)}
|
|
@@ -8,11 +8,12 @@ import {
|
|
|
8
8
|
getButtonSizeStyles,
|
|
9
9
|
ButtonElementStyle,
|
|
10
10
|
createComponent,
|
|
11
|
-
FabricComponent,
|
|
12
11
|
generatePropertySpaceStyle,
|
|
12
|
+
createStyledComponent,
|
|
13
|
+
StyledFabricComponent,
|
|
13
14
|
} from '../../Theme';
|
|
14
15
|
|
|
15
|
-
type BaseButtonProps =
|
|
16
|
+
type BaseButtonProps = {
|
|
16
17
|
children?: any;
|
|
17
18
|
variant?: ButtonVariant;
|
|
18
19
|
color?: ButtonColor;
|
|
@@ -23,11 +24,10 @@ type BaseButtonProps = FabricComponent<{
|
|
|
23
24
|
icon?: any;
|
|
24
25
|
iconPosition?: 'left' | 'right';
|
|
25
26
|
iconVariant?: 'filled' | 'empty';
|
|
26
|
-
}
|
|
27
|
-
|
|
27
|
+
};
|
|
28
28
|
export type ButtonProps = (
|
|
29
|
-
| Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'>
|
|
30
|
-
| Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'>
|
|
29
|
+
| Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children' | 'media'>
|
|
30
|
+
| Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children' | 'media'>
|
|
31
31
|
) &
|
|
32
32
|
BaseButtonProps;
|
|
33
33
|
|
|
@@ -70,21 +70,22 @@ type StyledButtonProps = {
|
|
|
70
70
|
$iconVariant: 'filled' | 'empty';
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const
|
|
74
|
-
(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
73
|
+
const StyledButton = createStyledComponent(
|
|
74
|
+
styled.button<StyledFabricComponent<StyledButtonProps>>(
|
|
75
|
+
({
|
|
76
|
+
$variant,
|
|
77
|
+
$color,
|
|
78
|
+
$size,
|
|
79
|
+
$disabled,
|
|
80
|
+
$fullWidth,
|
|
81
|
+
$iconPosition,
|
|
82
|
+
$iconVariant,
|
|
83
|
+
theme,
|
|
84
|
+
px = $variant !== 'empty' ? theme.button.sizes[$size].paddingInline : 0,
|
|
85
|
+
py = $variant !== 'empty' ? theme.button.sizes[$size].paddingBlock : 0,
|
|
86
|
+
}) => {
|
|
87
|
+
const sizes = getButtonSizeStyles(theme, $size);
|
|
88
|
+
return `
|
|
88
89
|
${getCss(getButtonStyles(theme, $variant, $color, 'default'))}
|
|
89
90
|
font-size: ${sizes.fontSize};
|
|
90
91
|
gap: ${sizes.gap};
|
|
@@ -155,39 +156,42 @@ const Btn = styled.button<FabricComponent<StyledButtonProps>>(
|
|
|
155
156
|
: ``
|
|
156
157
|
}
|
|
157
158
|
`;
|
|
159
|
+
}
|
|
160
|
+
)
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
export const Button = createComponent<ButtonProps>(
|
|
164
|
+
({
|
|
165
|
+
children,
|
|
166
|
+
variant = 'fill',
|
|
167
|
+
color = 'primary',
|
|
168
|
+
size = 'medium',
|
|
169
|
+
disabled = false,
|
|
170
|
+
fullWidth = false,
|
|
171
|
+
className,
|
|
172
|
+
icon,
|
|
173
|
+
iconPosition = 'left',
|
|
174
|
+
iconVariant = 'empty',
|
|
175
|
+
...props
|
|
176
|
+
}) => {
|
|
177
|
+
return (
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
<StyledButton
|
|
180
|
+
as={'href' in props ? 'a' : 'button'}
|
|
181
|
+
$variant={variant}
|
|
182
|
+
$color={color}
|
|
183
|
+
$size={size}
|
|
184
|
+
$disabled={disabled}
|
|
185
|
+
$fullWidth={fullWidth}
|
|
186
|
+
$iconPosition={iconPosition}
|
|
187
|
+
$iconVariant={iconVariant}
|
|
188
|
+
disabled={disabled}
|
|
189
|
+
className={className}
|
|
190
|
+
{...props}
|
|
191
|
+
>
|
|
192
|
+
{!!icon && <StyledIconWrapper>{icon}</StyledIconWrapper>}
|
|
193
|
+
{!!children && <ButtonTextContainer>{children}</ButtonTextContainer>}
|
|
194
|
+
</StyledButton>
|
|
195
|
+
);
|
|
158
196
|
}
|
|
159
197
|
);
|
|
160
|
-
const StyledButton = createComponent(Btn);
|
|
161
|
-
|
|
162
|
-
export const Button = ({
|
|
163
|
-
children,
|
|
164
|
-
variant = 'fill',
|
|
165
|
-
color = 'primary',
|
|
166
|
-
size = 'medium',
|
|
167
|
-
disabled = false,
|
|
168
|
-
fullWidth = false,
|
|
169
|
-
className,
|
|
170
|
-
icon,
|
|
171
|
-
iconPosition = 'left',
|
|
172
|
-
iconVariant = 'empty',
|
|
173
|
-
...props
|
|
174
|
-
}: ButtonProps) => {
|
|
175
|
-
return (
|
|
176
|
-
<StyledButton
|
|
177
|
-
as={'href' in props ? 'a' : 'button'}
|
|
178
|
-
$variant={variant}
|
|
179
|
-
$color={color}
|
|
180
|
-
$size={size}
|
|
181
|
-
$disabled={disabled}
|
|
182
|
-
$fullWidth={fullWidth}
|
|
183
|
-
$iconPosition={iconPosition}
|
|
184
|
-
$iconVariant={iconVariant}
|
|
185
|
-
disabled={disabled}
|
|
186
|
-
className={className}
|
|
187
|
-
{...props}
|
|
188
|
-
>
|
|
189
|
-
{!!icon && <StyledIconWrapper>{icon}</StyledIconWrapper>}
|
|
190
|
-
{!!children && <ButtonTextContainer>{children}</ButtonTextContainer>}
|
|
191
|
-
</StyledButton>
|
|
192
|
-
);
|
|
193
|
-
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
|
-
import {
|
|
3
|
+
import { createComponent, createStyledComponent, destructSpaceProps, pxToRem } from '../../Theme';
|
|
4
4
|
|
|
5
|
-
type CheckboxProps =
|
|
5
|
+
type CheckboxProps = {
|
|
6
6
|
label?: any;
|
|
7
|
-
}
|
|
8
|
-
Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
7
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
9
8
|
|
|
10
|
-
export const Checkbox = ({ label, className, disabled, ...props }
|
|
9
|
+
export const Checkbox = createComponent<CheckboxProps>(({ label, className, disabled, ...props }) => {
|
|
11
10
|
const spaceProps = destructSpaceProps(props);
|
|
12
11
|
return (
|
|
13
12
|
<StyledCheckbox className={className} $disabled={disabled} {...spaceProps}>
|
|
@@ -16,7 +15,7 @@ export const Checkbox = ({ label, className, disabled, ...props }: CheckboxProps
|
|
|
16
15
|
{!!label && <LabelText>{label}</LabelText>}
|
|
17
16
|
</StyledCheckbox>
|
|
18
17
|
);
|
|
19
|
-
};
|
|
18
|
+
});
|
|
20
19
|
|
|
21
20
|
const CustomCheckbox = styled.div(
|
|
22
21
|
({ theme }) => `
|
|
@@ -48,7 +47,7 @@ const HiddenInput = styled.input`
|
|
|
48
47
|
position: absolute;
|
|
49
48
|
`;
|
|
50
49
|
|
|
51
|
-
const StyledCheckbox =
|
|
50
|
+
const StyledCheckbox = createStyledComponent(
|
|
52
51
|
styled.label<{ $disabled?: boolean }>(({ theme, $disabled }) => {
|
|
53
52
|
return `
|
|
54
53
|
position: relative;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import ReactContentLoader, { IContentLoaderProps } from 'react-content-loader';
|
|
2
|
+
import { useTheme } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
export interface ContentLoaderProps extends Omit<IContentLoaderProps, 'backgroundColor' | 'foregroundColor'> {
|
|
5
|
+
children?: any;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const ContentLoader = (props: ContentLoaderProps) => {
|
|
9
|
+
const {
|
|
10
|
+
contentLoader: { foreground, background },
|
|
11
|
+
} = useTheme();
|
|
12
|
+
return <ReactContentLoader {...props} backgroundColor={background} foregroundColor={foreground} />;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ContentLoader';
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { createPortal } from 'react-dom';
|
|
2
2
|
import { styled } from 'styled-components';
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
createComponent,
|
|
5
|
+
createStyledComponent,
|
|
6
|
+
FabricComponent,
|
|
7
|
+
generatePropertySpaceStyle,
|
|
8
|
+
propToRem,
|
|
9
|
+
pxToRem,
|
|
10
|
+
StyledFabricComponent,
|
|
11
|
+
} from '../../Theme';
|
|
4
12
|
import { useBodyScrollLock } from '../../utils';
|
|
5
13
|
import { useEffect, useRef } from 'react';
|
|
6
14
|
|
|
@@ -12,12 +20,12 @@ type DrawerProps = {
|
|
|
12
20
|
width?: string | number;
|
|
13
21
|
};
|
|
14
22
|
|
|
15
|
-
export const Drawer = (props
|
|
23
|
+
export const Drawer = createComponent<DrawerProps>((props) => {
|
|
16
24
|
useBodyScrollLock(props.isOpen);
|
|
17
25
|
|
|
18
26
|
if (!props.isOpen) return null;
|
|
19
27
|
return createPortal(<DrawerWithOutclick {...props} />, document.body);
|
|
20
|
-
};
|
|
28
|
+
});
|
|
21
29
|
|
|
22
30
|
const DrawerWithOutclick = ({ onClose, children, width, header }: DrawerProps) => {
|
|
23
31
|
const drawerRef = useRef<HTMLDivElement>(null);
|
|
@@ -45,8 +53,8 @@ type DrawerHeaderProps = FabricComponent<{
|
|
|
45
53
|
children?: any;
|
|
46
54
|
}>;
|
|
47
55
|
|
|
48
|
-
export const DrawerHeader: any =
|
|
49
|
-
styled.div
|
|
56
|
+
export const DrawerHeader: any = createStyledComponent<DrawerHeaderProps>(
|
|
57
|
+
styled.div(
|
|
50
58
|
({ theme, p = theme.drawer.padding }) => `
|
|
51
59
|
grid-area: drawer-header;
|
|
52
60
|
${generatePropertySpaceStyle(theme, 'padding', p)};
|
|
@@ -57,26 +65,33 @@ export const DrawerHeader: any = createComponent<DrawerHeaderProps>(
|
|
|
57
65
|
}
|
|
58
66
|
);
|
|
59
67
|
|
|
60
|
-
type DrawerBodyProps =
|
|
68
|
+
type DrawerBodyProps = StyledFabricComponent<{
|
|
61
69
|
children?: any;
|
|
62
70
|
}>;
|
|
63
71
|
|
|
64
|
-
export const DrawerBody: any = createComponent(
|
|
65
|
-
|
|
66
|
-
(
|
|
72
|
+
export const DrawerBody: any = createComponent<DrawerBodyProps>(
|
|
73
|
+
createStyledComponent<DrawerBodyProps>(
|
|
74
|
+
styled.div(
|
|
75
|
+
({ theme, px = theme.drawer.padding, pb = theme.drawer.padding }) => `
|
|
67
76
|
grid-area: drawer-body;
|
|
68
77
|
max-height: 100%;
|
|
69
78
|
overflow-y: auto;
|
|
70
79
|
${generatePropertySpaceStyle(theme, 'padding-inline', px)};
|
|
71
80
|
${generatePropertySpaceStyle(theme, 'padding-bottom', pb)};
|
|
72
81
|
`
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
82
|
+
),
|
|
83
|
+
{
|
|
84
|
+
ignoreStyles: ['padding', 'padding-bottom'],
|
|
85
|
+
}
|
|
86
|
+
)
|
|
77
87
|
);
|
|
78
88
|
|
|
79
|
-
|
|
89
|
+
type StyledDrawerProps = {
|
|
90
|
+
$header?: number;
|
|
91
|
+
$width?: string | number;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const StyledDrawer = styled.div<StyledDrawerProps>(
|
|
80
95
|
({ theme, $header, $width }) => `
|
|
81
96
|
position: fixed;
|
|
82
97
|
display: grid;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, forwardRef } from 'react';
|
|
2
|
-
import { createComponent, FabricComponent } from '../../Theme';
|
|
2
|
+
import { createComponent, createStyledComponent, FabricComponent, StyledFabricComponent } from '../../Theme';
|
|
3
3
|
import styled from 'styled-components';
|
|
4
4
|
|
|
5
5
|
export type FlexDirection = 'row' | 'column' | 'row-reverse' | 'column-reverse';
|
|
@@ -23,46 +23,50 @@ export interface FlexContainerProps extends FabricComponent<Omit<React.HTMLAttri
|
|
|
23
23
|
as?: any; // TODO: fix type to styled component or intrinsic element
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export const FlexContainer
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
26
|
+
export const FlexContainer = createComponent<FlexContainerProps, HTMLDivElement>(
|
|
27
|
+
forwardRef<HTMLDivElement, FlexContainerProps>(
|
|
28
|
+
(
|
|
29
|
+
{
|
|
30
|
+
children,
|
|
31
|
+
direction = 'row',
|
|
32
|
+
wrap = 'nowrap',
|
|
33
|
+
justify = 'flex-start',
|
|
34
|
+
align = 'stretch',
|
|
35
|
+
alignContent,
|
|
36
|
+
gap,
|
|
37
|
+
rowGap,
|
|
38
|
+
columnGap,
|
|
39
|
+
className,
|
|
40
|
+
style,
|
|
41
|
+
as = 'div',
|
|
42
|
+
...props
|
|
43
|
+
},
|
|
44
|
+
ref
|
|
45
|
+
) => {
|
|
46
|
+
return (
|
|
47
|
+
<StyledContainer
|
|
48
|
+
as={as}
|
|
49
|
+
$direction={direction}
|
|
50
|
+
$wrap={wrap}
|
|
51
|
+
$justify={justify}
|
|
52
|
+
$align={align}
|
|
53
|
+
$alignContent={alignContent}
|
|
54
|
+
$gap={gap}
|
|
55
|
+
$rowGap={rowGap}
|
|
56
|
+
$columnGap={columnGap}
|
|
57
|
+
className={className}
|
|
58
|
+
style={style}
|
|
59
|
+
ref={ref}
|
|
60
|
+
{...props}
|
|
61
|
+
>
|
|
62
|
+
{children}
|
|
63
|
+
</StyledContainer>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
);
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
type StyledFlexContainerProps = StyledFabricComponent<{
|
|
66
70
|
$direction: FlexDirection;
|
|
67
71
|
$wrap: FlexWrap;
|
|
68
72
|
$justify: FlexJustify;
|
|
@@ -71,9 +75,9 @@ interface StyledFlexContainerProps {
|
|
|
71
75
|
$gap?: FlexGap;
|
|
72
76
|
$rowGap?: FlexGap;
|
|
73
77
|
$columnGap?: FlexGap;
|
|
74
|
-
}
|
|
78
|
+
}>;
|
|
75
79
|
|
|
76
|
-
const StyledContainer = styled.div
|
|
80
|
+
const StyledContainer = createStyledComponent<StyledFlexContainerProps>(styled.div`
|
|
77
81
|
${({ $direction, $wrap, $justify, $align, $alignContent, $gap, $rowGap, $columnGap }) => `
|
|
78
82
|
display: flex;
|
|
79
83
|
width: 100%;
|
|
@@ -87,6 +91,4 @@ const StyledContainer = styled.div<StyledFlexContainerProps>`
|
|
|
87
91
|
${$rowGap !== undefined ? `row-gap: ${typeof $rowGap === 'number' ? `${$rowGap}px` : $rowGap};` : ''}
|
|
88
92
|
${$columnGap !== undefined ? `column-gap: ${typeof $columnGap === 'number' ? `${$columnGap}px` : $columnGap};` : ''}
|
|
89
93
|
`}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const StyledFlexContainer = createComponent(StyledContainer);
|
|
94
|
+
`);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { styled } from 'styled-components';
|
|
3
|
+
import { createComponent } from '../../Theme';
|
|
3
4
|
|
|
4
5
|
export type FlexItemGrow = number;
|
|
5
6
|
export type FlexItemShrink = number;
|
|
@@ -18,32 +19,24 @@ export interface FlexItemProps {
|
|
|
18
19
|
as?: any; //TODO: fix type to styled component or intrinsic element
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
export const FlexItem = (
|
|
22
|
-
children,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
$order={order}
|
|
40
|
-
className={className}
|
|
41
|
-
style={style}
|
|
42
|
-
>
|
|
43
|
-
{children}
|
|
44
|
-
</StyledFlexItem>
|
|
45
|
-
);
|
|
46
|
-
};
|
|
22
|
+
export const FlexItem = createComponent<FlexItemProps>(
|
|
23
|
+
({ children, grow, shrink, basis, align, order, className, style, as = 'div' }) => {
|
|
24
|
+
return (
|
|
25
|
+
<StyledFlexItem
|
|
26
|
+
as={as}
|
|
27
|
+
$grow={grow}
|
|
28
|
+
$shrink={shrink}
|
|
29
|
+
$basis={basis}
|
|
30
|
+
$align={align}
|
|
31
|
+
$order={order}
|
|
32
|
+
className={className}
|
|
33
|
+
style={style}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</StyledFlexItem>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
);
|
|
47
40
|
|
|
48
41
|
interface StyledFlexItemProps {
|
|
49
42
|
$grow?: FlexItemGrow;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PencilIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
fill?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const PencilIcon = ({ fill = 'currentColor', ...props }: PencilIconProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg viewBox="0 0 18 17" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M2.35001 13.0753L1.14265 16.0938C1.10786 16.1808 1.09934 16.276 1.11816 16.3677C1.13697 16.4595 1.18229 16.5437 1.2485 16.6099C1.31471 16.6761 1.3989 16.7214 1.49063 16.7402C1.58235 16.7591 1.67758 16.7505 1.76451 16.7157L4.7829 15.5083C5.26418 15.3157 5.7013 15.0273 6.06775 14.6606L16.514 4.21473C16.8946 3.83411 17.1084 3.31787 17.1084 2.77959C17.1084 2.24131 16.8946 1.72508 16.514 1.34445C16.1334 0.963831 15.6172 0.75 15.0789 0.75C14.5407 0.75 14.0245 0.963831 13.6439 1.34445L3.19669 11.7903C2.83038 12.1569 2.54233 12.5941 2.35001 13.0753Z"
|
|
12
|
+
fill={fill}
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SVGProps } from 'react';
|
|
2
|
+
|
|
3
|
+
interface PointIconProps extends SVGProps<SVGSVGElement> {
|
|
4
|
+
fill?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const PointIcon = ({ fill = 'currentColor', ...props }: PointIconProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<svg viewBox="0 0 61 32" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
10
|
+
<path
|
|
11
|
+
d="M28.928 0.067c-2.381 0.235-4.176 0.755-6.115 1.776-2.601 1.422-4.71 3.453-6.186 5.908l-0.041 0.073c-1.272 2.189-2.072 4.794-2.199 7.574l-0.001 0.037-0.024 0.563-14.363 0.053v2.555h14.568l0.187 0.843c0.533 2.37 1.51 4.453 2.845 6.255l-0.032-0.045c0.741 1.011 2.421 2.664 3.453 3.4 4.011 2.851 9.149 3.661 13.709 2.157 1.337-0.488 2.474-1.026 3.552-1.653l-0.104 0.056c1.138-0.744 2.128-1.568 3.013-2.493l0.006-0.006c2.011-2.12 3.264-4.432 3.987-7.341l0.28-1.123 15.869-0.053v-2.555h-15.613l-0.064-0.317c-0.041-0.24-0.064-0.517-0.064-0.8 0-0.009 0-0.017 0-0.026v0.001c0-1.613-0.709-4.248-1.661-6.168-1.366-2.619-3.317-4.766-5.689-6.324l-0.063-0.039c-0.975-0.572-2.112-1.11-3.298-1.546l-0.15-0.048c-1.789-0.592-4.123-0.877-5.803-0.715zM32.557 2.912c5.315 1.128 9.392 5.459 10.293 10.931 0.155 0.933 0.155 3.379 0 4.309-0.654 3.884-2.877 7.151-5.983 9.181l-0.052 0.032c-4.117 2.645-9.627 2.605-13.739-0.101-4.149-2.733-6.389-7.357-5.995-12.371 0.483-6.133 4.989-11.109 10.939-12.085 1.109-0.181 3.445-0.128 4.536 0.104z"
|
|
12
|
+
fill={fill}
|
|
13
|
+
/>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -57,3 +57,5 @@ export { FolderAlertIcon } from './FolderAlertIcon';
|
|
|
57
57
|
export { RelationIcon } from './RelationIcon';
|
|
58
58
|
export { RelationPointsIcon } from './RelationPointsIcon';
|
|
59
59
|
export { PassportIcon } from './PassportIcon';
|
|
60
|
+
export { PointIcon } from './PointIcon';
|
|
61
|
+
export { PencilIcon } from './PencilIcon';
|