@luminati-io/uikit 1.5.0 → 1.6.1
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/uikit.umd.js +1 -1
- package/dist/uikit.umd.js.LICENSE.txt +9 -0
- package/package.json +4 -5
- package/assets/fonts/Inter-Regular.ttf +0 -0
- package/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/assets/icons/account.svg +0 -1
- package/assets/icons/adapt.svg +0 -1
- package/assets/icons/add.svg +0 -1
- package/assets/icons/add_circle.svg +0 -1
- package/assets/icons/add_funds.svg +0 -1
- package/assets/icons/attach.svg +0 -1
- package/assets/icons/book_help.svg +0 -1
- package/assets/icons/building.svg +0 -1
- package/assets/icons/calendar.svg +0 -1
- package/assets/icons/calendar_graph.svg +0 -1
- package/assets/icons/call.svg +0 -1
- package/assets/icons/camera.svg +0 -1
- package/assets/icons/cart.svg +0 -1
- package/assets/icons/close.svg +0 -1
- package/assets/icons/close_circle.svg +0 -1
- package/assets/icons/close_small.svg +0 -1
- package/assets/icons/collapse.svg +0 -1
- package/assets/icons/column.svg +0 -1
- package/assets/icons/columns.svg +0 -1
- package/assets/icons/connect.svg +0 -1
- package/assets/icons/contact_support.svg +0 -1
- package/assets/icons/copy.svg +0 -1
- package/assets/icons/copy_small.svg +0 -1
- package/assets/icons/customize.svg +0 -1
- package/assets/icons/dataset.svg +0 -3
- package/assets/icons/delete.svg +0 -6
- package/assets/icons/desktop.svg +0 -3
- package/assets/icons/dislike.svg +0 -3
- package/assets/icons/doc_new.svg +0 -8
- package/assets/icons/document.svg +0 -3
- package/assets/icons/dots_horizontal.svg +0 -3
- package/assets/icons/dots_vertical.svg +0 -3
- package/assets/icons/download.svg +0 -3
- package/assets/icons/drag_and_drop.svg +0 -3
- package/assets/icons/edit.svg +0 -3
- package/assets/icons/edit_small.svg +0 -3
- package/assets/icons/envelope.svg +0 -4
- package/assets/icons/file_csv.svg +0 -7
- package/assets/icons/file_json.svg +0 -8
- package/assets/icons/filter.svg +0 -3
- package/assets/icons/folder.svg +0 -3
- package/assets/icons/forward.svg +0 -3
- package/assets/icons/index.js +0 -165
- package/assets/icons/info.svg +0 -3
- package/assets/icons/invite.svg +0 -3
- package/assets/icons/lightning.svg +0 -3
- package/assets/icons/like.svg +0 -3
- package/assets/icons/link_ext.svg +0 -4
- package/assets/icons/lock.svg +0 -4
- package/assets/icons/login.svg +0 -12
- package/assets/icons/logout.svg +0 -4
- package/assets/icons/maximize.svg +0 -4
- package/assets/icons/mention.svg +0 -3
- package/assets/icons/menu_close.svg +0 -3
- package/assets/icons/menu_expand.svg +0 -3
- package/assets/icons/message.svg +0 -3
- package/assets/icons/minimize.svg +0 -4
- package/assets/icons/minus.svg +0 -3
- package/assets/icons/monitor.svg +0 -3
- package/assets/icons/on_off.svg +0 -8
- package/assets/icons/pause.svg +0 -3
- package/assets/icons/pin.svg +0 -3
- package/assets/icons/play.svg +0 -3
- package/assets/icons/publish.svg +0 -9
- package/assets/icons/question.svg +0 -3
- package/assets/icons/queue.svg +0 -8
- package/assets/icons/referal.svg +0 -4
- package/assets/icons/refresh.svg +0 -3
- package/assets/icons/reset.svg +0 -4
- package/assets/icons/search.svg +0 -10
- package/assets/icons/seo.svg +0 -17
- package/assets/icons/settings.svg +0 -3
- package/assets/icons/smartphone.svg +0 -4
- package/assets/icons/sort.svg +0 -4
- package/assets/icons/sum.svg +0 -3
- package/assets/icons/trash.svg +0 -3
- package/assets/icons/unpin.svg +0 -4
- package/assets/icons/upgrade.svg +0 -11
- package/assets/icons/upload.svg +0 -4
- package/assets/icons/upload_cloud.svg +0 -4
- package/assets/icons/verify.svg +0 -4
- package/src/Typography/header.js +0 -25
- package/src/Typography/hyperlink.js +0 -27
- package/src/Typography/index.js +0 -11
- package/src/Typography/label.js +0 -26
- package/src/Typography/paragraph.js +0 -26
- package/src/Typography/typography.js +0 -22
- package/src/button/button.js +0 -121
- package/src/button/index.js +0 -6
- package/src/button/loading_icon.js +0 -46
- package/src/icon.js +0 -58
- package/src/icon_button.js +0 -79
- package/src/index.js +0 -44
- package/src/infochip.js +0 -57
- package/src/input/index.js +0 -6
- package/src/input/toggle.js +0 -105
- package/src/layout/box.js +0 -36
- package/src/layout/flex.js +0 -41
- package/src/layout/index.js +0 -6
- package/src/link/index.js +0 -6
- package/src/link/link.js +0 -84
- package/src/progress/index.js +0 -7
- package/src/progress/progess.js +0 -45
- package/src/progress/progress_bar.js +0 -37
- package/src/tooltip.js +0 -99
- package/src/utils.js +0 -270
- package/webpack.common.js +0 -25
- package/webpack.config.js +0 -28
- package/webpack.shared.js +0 -11
package/src/icon.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import styled, {css} from 'styled-components';
|
|
6
|
-
import PT from 'prop-types';
|
|
7
|
-
|
|
8
|
-
import {theme, toPixel, colorNames, iconNames} from './utils';
|
|
9
|
-
import icons from '@icons';
|
|
10
|
-
|
|
11
|
-
const toIconSize = size=>{
|
|
12
|
-
const toSize = value=>css`
|
|
13
|
-
width: ${toPixel(value)};
|
|
14
|
-
height: ${toPixel(value)};
|
|
15
|
-
`;
|
|
16
|
-
if (size=='xl')
|
|
17
|
-
return toSize(48);
|
|
18
|
-
if (size=='lg')
|
|
19
|
-
return toSize(32);
|
|
20
|
-
if (size=='sm')
|
|
21
|
-
return toSize(20);
|
|
22
|
-
if (size=='xs')
|
|
23
|
-
return toSize(16);
|
|
24
|
-
if (size=='xxs')
|
|
25
|
-
return toSize(12);
|
|
26
|
-
return toSize(24);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const Icon = React.forwardRef((props, ref)=>{
|
|
30
|
-
const {name, size, color} = props;
|
|
31
|
-
const ic = icons[name];
|
|
32
|
-
if (!ic)
|
|
33
|
-
return null;
|
|
34
|
-
return <StyledSvg
|
|
35
|
-
ref={ref}
|
|
36
|
-
size={size}
|
|
37
|
-
viewBox={ic.viewBox}
|
|
38
|
-
color={theme.color[color]}
|
|
39
|
-
data-icon={name}
|
|
40
|
-
>
|
|
41
|
-
<use href={`#${ic.id}`}/>
|
|
42
|
-
</StyledSvg>;
|
|
43
|
-
});
|
|
44
|
-
Icon.displayName = 'Icon';
|
|
45
|
-
Icon.defaultProps = {size: 'md'};
|
|
46
|
-
Icon.propTypes = {
|
|
47
|
-
name: PT.oneOf(iconNames).isRequired,
|
|
48
|
-
color: PT.oneOf(colorNames),
|
|
49
|
-
size: PT.oneOf(['xxs', 'xs', 'sm', 'md', 'lg', 'xl']),
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const StyledSvg = styled.svg`
|
|
53
|
-
color: ${props=>props.color};
|
|
54
|
-
${props=>toIconSize(props.size)}
|
|
55
|
-
`;
|
|
56
|
-
StyledSvg.displayName = 'StyledSvg';
|
|
57
|
-
|
|
58
|
-
export default Icon;
|
package/src/icon_button.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import styled, {css} from 'styled-components';
|
|
6
|
-
import PT from 'prop-types';
|
|
7
|
-
import utils from './utils';
|
|
8
|
-
import Icon from './icon';
|
|
9
|
-
import Tooltip from './tooltip';
|
|
10
|
-
|
|
11
|
-
const {theme, toPixel, getCommonProps, iconNames, tooltipPlacements} = utils;
|
|
12
|
-
|
|
13
|
-
const IconButton = React.forwardRef((props, ref)=>{
|
|
14
|
-
const {variant, disabled, icon, tooltip, tooltipPlacement} = props;
|
|
15
|
-
return <Tooltip tooltip={tooltip} placement={tooltipPlacement}>
|
|
16
|
-
<StyledIconButton
|
|
17
|
-
ref={ref}
|
|
18
|
-
{...getCommonProps(props)}
|
|
19
|
-
variant={variant}
|
|
20
|
-
disabled={disabled}
|
|
21
|
-
data-testid="icon_button"
|
|
22
|
-
>
|
|
23
|
-
<Icon name={icon} size="sm" />
|
|
24
|
-
</StyledIconButton>
|
|
25
|
-
</Tooltip>;
|
|
26
|
-
});
|
|
27
|
-
IconButton.displayName = 'IconButton';
|
|
28
|
-
IconButton.defaultProps = {variant: 'icon-button'};
|
|
29
|
-
IconButton.propTypes = {
|
|
30
|
-
variant: PT.oneOf(['icon', 'icon-button']),
|
|
31
|
-
icon: PT.oneOf(iconNames).isRequired,
|
|
32
|
-
disabled: PT.bool,
|
|
33
|
-
tooltip: PT.node,
|
|
34
|
-
tooltipPlacement: PT.oneOf(tooltipPlacements),
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const StyledIconButton = styled.button`
|
|
38
|
-
display: flex;
|
|
39
|
-
align-items: center;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
border-radius: 4px;
|
|
42
|
-
padding: 0;
|
|
43
|
-
cursor: pointer;
|
|
44
|
-
${props=>{
|
|
45
|
-
return css`
|
|
46
|
-
background-color: ${theme.color.white};
|
|
47
|
-
border: ${props.variant=='icon'?'0 none;':
|
|
48
|
-
`1px solid ${theme.color.gray_6}`};
|
|
49
|
-
[data-icon] { color: ${theme.color.gray_9}; }
|
|
50
|
-
`;
|
|
51
|
-
}}
|
|
52
|
-
&:hover:not(:disabled) {
|
|
53
|
-
background-color: ${theme.color.gray_2};
|
|
54
|
-
border: ${props=>props.variant=='icon'?'0 none;':
|
|
55
|
-
`1px solid ${theme.color.gray_8}`};
|
|
56
|
-
}
|
|
57
|
-
&:active:not(:disabled) {
|
|
58
|
-
background-color: ${theme.color.blue_4};
|
|
59
|
-
border: ${props=>props.variant=='icon'?'0 none;':
|
|
60
|
-
`1px solid ${theme.color.blue_4}`};
|
|
61
|
-
[data-icon] { color: ${theme.color.blue_11}; }
|
|
62
|
-
}
|
|
63
|
-
&:disabled {
|
|
64
|
-
border: ${props=>props.variant=='icon'?'0 none;':
|
|
65
|
-
`1px solid ${theme.color.gray_7}`};
|
|
66
|
-
[data-icon] { color: ${theme.color.gray_7}; }
|
|
67
|
-
cursor: not-allowed;
|
|
68
|
-
}
|
|
69
|
-
${props=>{
|
|
70
|
-
let w = props.variant=='icon'?24:36;
|
|
71
|
-
return css`
|
|
72
|
-
width: ${toPixel(w)};
|
|
73
|
-
height: ${toPixel(w)};
|
|
74
|
-
`;
|
|
75
|
-
}}
|
|
76
|
-
`;
|
|
77
|
-
StyledIconButton.displayName = 'StyledIconButton';
|
|
78
|
-
|
|
79
|
-
export default IconButton;
|
package/src/index.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
import {Button} from './button';
|
|
4
|
-
import Input from './input';
|
|
5
|
-
import Typography from './Typography';
|
|
6
|
-
import InfoChip from './infochip';
|
|
7
|
-
import Layout from './layout';
|
|
8
|
-
import {Link} from './link';
|
|
9
|
-
import {Progress, ProgressBar} from './progress';
|
|
10
|
-
import Icon from './icon';
|
|
11
|
-
import IconButton from './icon_button';
|
|
12
|
-
import Tooltip, {withTooltip} from './tooltip';
|
|
13
|
-
|
|
14
|
-
export {
|
|
15
|
-
Layout,
|
|
16
|
-
Link,
|
|
17
|
-
Typography,
|
|
18
|
-
Button,
|
|
19
|
-
Input,
|
|
20
|
-
InfoChip,
|
|
21
|
-
Progress,
|
|
22
|
-
ProgressBar,
|
|
23
|
-
Icon,
|
|
24
|
-
IconButton,
|
|
25
|
-
Tooltip,
|
|
26
|
-
withTooltip,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const UIKit = {
|
|
30
|
-
Layout,
|
|
31
|
-
Link,
|
|
32
|
-
Typography,
|
|
33
|
-
Button,
|
|
34
|
-
Input,
|
|
35
|
-
InfoChip,
|
|
36
|
-
Progress,
|
|
37
|
-
ProgressBar,
|
|
38
|
-
Icon,
|
|
39
|
-
IconButton,
|
|
40
|
-
Tooltip,
|
|
41
|
-
withTooltip,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default UIKit;
|
package/src/infochip.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import PT from 'prop-types';
|
|
7
|
-
|
|
8
|
-
import {theme, iconNames, getCommonProps} from './utils';
|
|
9
|
-
import Flex from './layout/flex';
|
|
10
|
-
import typography from './Typography';
|
|
11
|
-
import Icon from './icon';
|
|
12
|
-
|
|
13
|
-
const {Label} = typography;
|
|
14
|
-
|
|
15
|
-
const InfoChipWrapper = styled(Flex).attrs({
|
|
16
|
-
align_items: 'center',
|
|
17
|
-
gap: theme.spacing['02'],
|
|
18
|
-
padding: `${theme.spacing['02']} ${theme.spacing['04']}`,
|
|
19
|
-
})`
|
|
20
|
-
background-color: ${props=>props.color&&theme.color[props.color]};
|
|
21
|
-
border-radius: 24px;
|
|
22
|
-
width: fit-content;
|
|
23
|
-
`;
|
|
24
|
-
|
|
25
|
-
const InfoChip = props=>{
|
|
26
|
-
const {variant, text, icon} = props;
|
|
27
|
-
const bgColors = {
|
|
28
|
-
default: 'gray_3',
|
|
29
|
-
success: 'green_3',
|
|
30
|
-
alert: 'red_3',
|
|
31
|
-
warning: 'yellow_3',
|
|
32
|
-
info: 'blue_3',
|
|
33
|
-
};
|
|
34
|
-
const bgColor = bgColors[variant] || bgColors.default;
|
|
35
|
-
const colors = {
|
|
36
|
-
default: 'gray_11_50',
|
|
37
|
-
success: 'green_11',
|
|
38
|
-
alert: 'red_11',
|
|
39
|
-
warning: 'yellow_11',
|
|
40
|
-
info: 'blue_11',
|
|
41
|
-
};
|
|
42
|
-
const color = colors[variant] || colors.default;
|
|
43
|
-
const commonProps = getCommonProps(props);
|
|
44
|
-
return <InfoChipWrapper color={bgColor} {...commonProps}>
|
|
45
|
-
{icon && <Icon size="xxs" color={color} name={icon}/>}
|
|
46
|
-
<Label variant="xs" color={color}>{text}</Label>
|
|
47
|
-
</InfoChipWrapper>;
|
|
48
|
-
};
|
|
49
|
-
InfoChip.displayName = 'InfoChip';
|
|
50
|
-
InfoChip.defaultProps = {variant: 'default'};
|
|
51
|
-
InfoChip.propTypes = {
|
|
52
|
-
variant: PT.oneOf(['default', 'success', 'alert', 'warning', 'info']),
|
|
53
|
-
text: PT.string,
|
|
54
|
-
icon: PT.oneOf(iconNames),
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default InfoChip;
|
package/src/input/index.js
DELETED
package/src/input/toggle.js
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React, {useCallback} from 'react';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import PT from 'prop-types';
|
|
7
|
-
import {theme, toPixel, getCommonProps} from '../utils';
|
|
8
|
-
import typography from '../Typography';
|
|
9
|
-
|
|
10
|
-
const {Label} = typography;
|
|
11
|
-
|
|
12
|
-
const Toggle = props=>{
|
|
13
|
-
const {value, label, disabled, size, onChange} = props;
|
|
14
|
-
const handleChange = useCallback(evt=>{
|
|
15
|
-
const {checked} = evt.target;
|
|
16
|
-
onChange?.(checked, evt);
|
|
17
|
-
}, [onChange]);
|
|
18
|
-
const color = disabled?value?'gray-11':'gray-9':
|
|
19
|
-
value?'gray-11-50':'gray-11';
|
|
20
|
-
return <ToggleLabel {...getCommonProps(props)} $size={size}>
|
|
21
|
-
<ToggleInput $size={size} checked={value} onChange={handleChange}
|
|
22
|
-
disabled={disabled} />
|
|
23
|
-
{label&&<Label variant="sm" tag="span" color={color} no_wrap>
|
|
24
|
-
{label}
|
|
25
|
-
</Label>}
|
|
26
|
-
</ToggleLabel>;
|
|
27
|
-
};
|
|
28
|
-
Toggle.displayName = 'Toggle';
|
|
29
|
-
Toggle.defaultProps = {size: 'sm'};
|
|
30
|
-
Toggle.propTypes = {
|
|
31
|
-
value: PT.bool,
|
|
32
|
-
label: PT.string,
|
|
33
|
-
disabled: PT.bool,
|
|
34
|
-
size: PT.oneOf(['xs', 'sm']),
|
|
35
|
-
onChange: PT.func,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const ToggleLabel = styled.label`
|
|
39
|
-
cursor: pointer;
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
gap: 4px;
|
|
43
|
-
margin: 0;
|
|
44
|
-
`;
|
|
45
|
-
ToggleLabel.displayName = 'ToggleLabel';
|
|
46
|
-
|
|
47
|
-
const ToggleInput = styled.input.attrs({type: 'checkbox'})`
|
|
48
|
-
&& {
|
|
49
|
-
box-sizing: border-box;
|
|
50
|
-
width: ${props=>toPixel(props.$size=='xs'?32:44)};
|
|
51
|
-
height: ${props=>toPixel(props.$size=='xs'?16:20)};
|
|
52
|
-
display: flex;
|
|
53
|
-
align-items: center;
|
|
54
|
-
margin: 0;
|
|
55
|
-
padding: 0 1px;
|
|
56
|
-
vertical-align: top;
|
|
57
|
-
background-color: ${theme.color.gray_5};
|
|
58
|
-
border: 1px solid ${theme.color.gray_7};
|
|
59
|
-
border-radius: 25px;
|
|
60
|
-
outline: none;
|
|
61
|
-
outline-offset: 0;
|
|
62
|
-
cursor: pointer;
|
|
63
|
-
appearance: none;
|
|
64
|
-
transition: all 0.3s cubic-bezier(0.2, 0.85, 0.32, 1.2);
|
|
65
|
-
&:hover {
|
|
66
|
-
background-color: ${theme.color.gray_7};
|
|
67
|
-
border-color: ${theme.color.gray_8};
|
|
68
|
-
}
|
|
69
|
-
&:focus {
|
|
70
|
-
outline: none;
|
|
71
|
-
outline-offset: 0;
|
|
72
|
-
background-color: ${theme.color.gray_9};
|
|
73
|
-
border-color: ${theme.color.gray_9};
|
|
74
|
-
}
|
|
75
|
-
&:checked {
|
|
76
|
-
background-color: ${theme.color.blue_11};
|
|
77
|
-
border-color: ${theme.color.blue_11};
|
|
78
|
-
&:hover {
|
|
79
|
-
background-color: ${theme.color.blue_10};
|
|
80
|
-
border-color: ${theme.color.blue_10};
|
|
81
|
-
}
|
|
82
|
-
&:focus {
|
|
83
|
-
background-color: ${theme.color.blue_11};
|
|
84
|
-
border-color: ${theme.color.blue_11};
|
|
85
|
-
outline: 3px solid ${theme.color.blue_5};
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
&::after {
|
|
90
|
-
content: "";
|
|
91
|
-
display: block;
|
|
92
|
-
width: ${props=>toPixel(props.$size=='xs'?12:16)};
|
|
93
|
-
height: ${props=>toPixel(props.$size=='xs'?12:16)};
|
|
94
|
-
border-radius: 50%;
|
|
95
|
-
background-color: ${theme.color.white};
|
|
96
|
-
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);
|
|
97
|
-
transition: all 0.3s cubic-bezier(0.2, 0.85, 0.32, 1.2);
|
|
98
|
-
}
|
|
99
|
-
&:checked::after {
|
|
100
|
-
transform: translateX(${props=>toPixel(props.$size=='xs'?15:23)});
|
|
101
|
-
}
|
|
102
|
-
`;
|
|
103
|
-
ToggleInput.displayName = 'ToggleInput';
|
|
104
|
-
|
|
105
|
-
export default Toggle;
|
package/src/layout/box.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import styled from 'styled-components';
|
|
5
|
-
|
|
6
|
-
import {fromTheme} from '../utils';
|
|
7
|
-
|
|
8
|
-
const Box = styled.div`
|
|
9
|
-
height: ${props=>props.height};
|
|
10
|
-
max-height: ${props=>props.max_height};
|
|
11
|
-
min-height: ${props=>props.min_height};
|
|
12
|
-
width: ${props=>props.width};
|
|
13
|
-
max-width: ${props=>props.max_width};
|
|
14
|
-
min-width: ${props=>props.min_width};
|
|
15
|
-
padding: ${fromTheme('padding')};
|
|
16
|
-
padding-top: ${fromTheme('padding_top')};
|
|
17
|
-
padding-right: ${fromTheme('padding_right')};
|
|
18
|
-
padding-bottom: ${fromTheme('padding_bottom')};
|
|
19
|
-
padding-left: ${fromTheme('padding_left')};
|
|
20
|
-
margin: ${fromTheme('margin')};
|
|
21
|
-
margin-top: ${fromTheme('margin_top')};
|
|
22
|
-
margin-right: ${fromTheme('margin_right')};
|
|
23
|
-
margin-bottom: ${fromTheme('margin_bottom')};
|
|
24
|
-
margin-left: ${fromTheme('margin_left')};
|
|
25
|
-
flex: ${props=>props.flex};
|
|
26
|
-
flex-grow: ${props=>props.flex_grow};
|
|
27
|
-
flex-shrink: ${props=>props.flex_shrink};
|
|
28
|
-
flex-basis: ${props=>props.flex_basis};
|
|
29
|
-
justify-self: ${props=>props.justify_self};
|
|
30
|
-
align-self: ${props=>props.align_self};
|
|
31
|
-
order: ${props=>props.order};
|
|
32
|
-
box-shadow: ${fromTheme('box_shadow')};
|
|
33
|
-
`;
|
|
34
|
-
Box.displayName = 'Box';
|
|
35
|
-
|
|
36
|
-
export default Box;
|
package/src/layout/flex.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import PT from 'prop-types';
|
|
7
|
-
|
|
8
|
-
import Box from './box';
|
|
9
|
-
|
|
10
|
-
const StyledFlex = styled(Box)`
|
|
11
|
-
display: ${props=>props.inline ? 'inline-flex' : 'flex'};
|
|
12
|
-
align-items: ${props=>props.align_items};
|
|
13
|
-
align-content: ${props=>props.align_content};
|
|
14
|
-
justify-items: ${props=>props.justify_items};
|
|
15
|
-
justify-content: ${props=>props.justify_content};
|
|
16
|
-
flex-wrap: ${props=>props.flex_wrap};
|
|
17
|
-
flex-direction: ${props=>props.flex_direction};
|
|
18
|
-
gap: ${props=>props.gap};
|
|
19
|
-
row-gap: ${props=>props.row_gap};
|
|
20
|
-
column-gap: ${props=>props.column_gap};
|
|
21
|
-
`;
|
|
22
|
-
const Flex = props=>{
|
|
23
|
-
return <StyledFlex {...props}/>;
|
|
24
|
-
};
|
|
25
|
-
Flex.displayName = 'Flex';
|
|
26
|
-
Flex.defaultProps = {flex_direction: 'row'};
|
|
27
|
-
Flex.propTypes = {
|
|
28
|
-
inline: PT.bool,
|
|
29
|
-
align_items: PT.oneOf(['flex-start', 'center']),
|
|
30
|
-
align_content: PT.string,
|
|
31
|
-
justify_items: PT.string,
|
|
32
|
-
justify_content: PT.string,
|
|
33
|
-
flex_wrap: PT.string,
|
|
34
|
-
flex_direction: PT.oneOf(['row', 'row-reverse', 'column',
|
|
35
|
-
'column-reverse']),
|
|
36
|
-
gap: PT.string,
|
|
37
|
-
row_gap: PT.string,
|
|
38
|
-
column_gap: PT.string,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default Flex;
|
package/src/layout/index.js
DELETED
package/src/link/index.js
DELETED
package/src/link/link.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import PT from 'prop-types';
|
|
7
|
-
import {
|
|
8
|
-
theme,
|
|
9
|
-
iconNames,
|
|
10
|
-
toPixel,
|
|
11
|
-
getCommonProps,
|
|
12
|
-
getIconProps,
|
|
13
|
-
getLinkProps,
|
|
14
|
-
} from '../utils';
|
|
15
|
-
import typography from '../Typography';
|
|
16
|
-
import Icon from '../icon';
|
|
17
|
-
|
|
18
|
-
const {Typography, Label} = typography;
|
|
19
|
-
|
|
20
|
-
const Link = React.forwardRef((props, ref)=>{
|
|
21
|
-
const {text, variant, size, icon} = props;
|
|
22
|
-
const {isLeft, isRight, ...iconProps} = getIconProps('Link', props);
|
|
23
|
-
const labelVariant = {lg: 'lg', sm: 'xs'}[size]||'base';
|
|
24
|
-
return <StyledLink
|
|
25
|
-
ref={ref}
|
|
26
|
-
{...getCommonProps(props)}
|
|
27
|
-
{...getLinkProps(props)}
|
|
28
|
-
variant={variant}
|
|
29
|
-
size={size}
|
|
30
|
-
noIcon={!icon}
|
|
31
|
-
>
|
|
32
|
-
{isLeft&&<Icon {...iconProps}/>}
|
|
33
|
-
<Label variant={labelVariant} no_wrap>{text}</Label>
|
|
34
|
-
{isRight&&<Icon {...iconProps}/>}
|
|
35
|
-
</StyledLink>;
|
|
36
|
-
});
|
|
37
|
-
Link.displayName = 'Link';
|
|
38
|
-
Link.defaultProps = {
|
|
39
|
-
variant: 'primary',
|
|
40
|
-
size: 'md',
|
|
41
|
-
iconPlacement: 'left',
|
|
42
|
-
};
|
|
43
|
-
Link.propTypes = {
|
|
44
|
-
text: PT.string.isRequired,
|
|
45
|
-
variant: PT.oneOf(['primary', 'secondary']),
|
|
46
|
-
size: PT.oneOf(['sm', 'md', 'lg']),
|
|
47
|
-
icon: PT.oneOf(iconNames),
|
|
48
|
-
iconPlacement: PT.oneOf(['left', 'right']),
|
|
49
|
-
href: PT.string,
|
|
50
|
-
newTab: PT.bool,
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const StyledLink = styled.a`
|
|
54
|
-
display: inline-flex;
|
|
55
|
-
align-items: center;
|
|
56
|
-
justify-content: center;
|
|
57
|
-
text-decoration: none;
|
|
58
|
-
background: 0 none;
|
|
59
|
-
border: 0 none;
|
|
60
|
-
padding: 0;
|
|
61
|
-
gap: ${props=>toPixel(props.size=='lg'?8:4)};
|
|
62
|
-
${Typography} {
|
|
63
|
-
color: ${props=>props.variant=='primary'?
|
|
64
|
-
theme.color.blue_11:theme.color.gray_11_50};
|
|
65
|
-
text-decoration: ${props=>props.variant=='secondary'&&
|
|
66
|
-
props.noIcon?'underline':'none'};
|
|
67
|
-
}
|
|
68
|
-
[data-icon] {
|
|
69
|
-
color: ${props=>props.variant=='primary'?
|
|
70
|
-
theme.color.blue_11:theme.color.gray_11_50};
|
|
71
|
-
}
|
|
72
|
-
&:hover {
|
|
73
|
-
${Typography} {
|
|
74
|
-
color: ${theme.color.blue_11};
|
|
75
|
-
text-decoration: ${props=>props.variant=='secondary'&&
|
|
76
|
-
props.noIcon?'underline':'none'};
|
|
77
|
-
}
|
|
78
|
-
[data-icon] { color: ${theme.color.blue_11}; }
|
|
79
|
-
}
|
|
80
|
-
&:hover, :visited, :focus { text-decoration: none; }
|
|
81
|
-
`;
|
|
82
|
-
StyledLink.displayName = 'StyledLink';
|
|
83
|
-
|
|
84
|
-
export default Link;
|
package/src/progress/index.js
DELETED
package/src/progress/progess.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import PT from 'prop-types';
|
|
6
|
-
|
|
7
|
-
import typography from '../Typography';
|
|
8
|
-
import layout from '../layout';
|
|
9
|
-
import {theme} from '../utils';
|
|
10
|
-
import ProgressBar from './progress_bar';
|
|
11
|
-
|
|
12
|
-
const {Label} = typography;
|
|
13
|
-
const {Flex} = layout;
|
|
14
|
-
|
|
15
|
-
const ProgressFraction = props=>{
|
|
16
|
-
const {amount, capacity} = props;
|
|
17
|
-
// XXX davidg: implement number formatting by $, bytes, etc.
|
|
18
|
-
return <Flex align_items="center">
|
|
19
|
-
<Label color="gray_11_50">{amount}</Label>
|
|
20
|
-
<Label color="gray_11">/{capacity}</Label>
|
|
21
|
-
</Flex>;
|
|
22
|
-
};
|
|
23
|
-
ProgressFraction.propTypes = {
|
|
24
|
-
amount: PT.number.isRequired,
|
|
25
|
-
capacity: PT.number.isRequired,
|
|
26
|
-
// unit: PT.string,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const Progress = props=>{
|
|
30
|
-
const {amount, capacity, label} = props;
|
|
31
|
-
return <Flex flex_direction="column" gap={theme.spacing['03']}>
|
|
32
|
-
<Flex align_items="flex-end" justify_content="space-between">
|
|
33
|
-
<Label color="gray_11_50">{label}</Label>
|
|
34
|
-
<ProgressFraction amount={amount} capacity={capacity}/>
|
|
35
|
-
</Flex>
|
|
36
|
-
<ProgressBar amount={amount} capacity={capacity}/>
|
|
37
|
-
</Flex>;
|
|
38
|
-
};
|
|
39
|
-
Progress.propTypes = {
|
|
40
|
-
amount: PT.number.isRequired,
|
|
41
|
-
capacity: PT.number.isRequired,
|
|
42
|
-
label: PT.string,
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export default Progress;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import PT from 'prop-types';
|
|
7
|
-
import _ from 'lodash';
|
|
8
|
-
|
|
9
|
-
import {theme} from '../utils';
|
|
10
|
-
|
|
11
|
-
const ProgressBarWrapper = styled.div`
|
|
12
|
-
background-color: ${theme.color.gray_4};
|
|
13
|
-
border-radius: 30px;
|
|
14
|
-
height: 6px;
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
const ProgressBarFill = styled.div`
|
|
18
|
-
background-color: ${theme.color.blue_11};
|
|
19
|
-
border-radius: 30px;
|
|
20
|
-
width: ${props=>props.width}%;
|
|
21
|
-
height: 100%;
|
|
22
|
-
`;
|
|
23
|
-
|
|
24
|
-
const ProgressBar = props=>{
|
|
25
|
-
const {amount, capacity} = props;
|
|
26
|
-
const percentage = _.clamp(amount/capacity * 100, 0, 100);
|
|
27
|
-
const percentageFmt = percentage.toFixed(2);
|
|
28
|
-
return <ProgressBarWrapper>
|
|
29
|
-
<ProgressBarFill width={percentageFmt}/>
|
|
30
|
-
</ProgressBarWrapper>;
|
|
31
|
-
};
|
|
32
|
-
ProgressBar.propTypes = {
|
|
33
|
-
amount: PT.number.isRequired,
|
|
34
|
-
capacity: PT.number.isRequired,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default ProgressBar;
|