@luminati-io/uikit 1.6.0 → 1.6.2
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/package.json +5 -6
- 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/code/code.js +0 -127
- package/src/code/index.js +0 -8
- package/src/icon.js +0 -58
- package/src/icon_button.js +0 -79
- package/src/index.js +0 -47
- 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 -77
- 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/code/code.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React, {useEffect} from 'react';
|
|
5
|
-
import styled from 'styled-components';
|
|
6
|
-
import Prism from 'prismjs';
|
|
7
|
-
import PT from 'prop-types';
|
|
8
|
-
import {theme} from '../utils';
|
|
9
|
-
|
|
10
|
-
const Code = props=>{
|
|
11
|
-
const {text, lang} = props;
|
|
12
|
-
useEffect(()=>{
|
|
13
|
-
Prism.highlightAll();
|
|
14
|
-
}, [text, lang]);
|
|
15
|
-
return <CodeWrapper>
|
|
16
|
-
<code className={`language-${lang} content`}>{text}</code>
|
|
17
|
-
</CodeWrapper>;
|
|
18
|
-
};
|
|
19
|
-
Code.displayName = 'Code';
|
|
20
|
-
Code.propTypes = {
|
|
21
|
-
text: PT.string,
|
|
22
|
-
// XXX davidg: config langs
|
|
23
|
-
lang: PT.string,
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export default Code;
|
|
27
|
-
|
|
28
|
-
const CodeWrapper = styled.pre`
|
|
29
|
-
&&& {
|
|
30
|
-
padding: 0;
|
|
31
|
-
font-family: ${theme.font_family.mono};
|
|
32
|
-
margin: 0;
|
|
33
|
-
border: none;
|
|
34
|
-
background-color: transparent;
|
|
35
|
-
width: 100%;
|
|
36
|
-
white-space: pre-wrap;
|
|
37
|
-
line-height: 1.5;
|
|
38
|
-
tab-size: 4;
|
|
39
|
-
text-align: left;
|
|
40
|
-
word-spacing: normal;
|
|
41
|
-
word-break: normal;
|
|
42
|
-
word-wrap: normal;
|
|
43
|
-
hyphens: none;
|
|
44
|
-
max-height: none;
|
|
45
|
-
code.content {
|
|
46
|
-
all: inherit;
|
|
47
|
-
color: ${theme.color.gray_8};
|
|
48
|
-
margin: 0;
|
|
49
|
-
padding: 0;
|
|
50
|
-
border: none;
|
|
51
|
-
background-color: transparent;
|
|
52
|
-
text-shadow: none;
|
|
53
|
-
}
|
|
54
|
-
${'' /* prism selectors below */}
|
|
55
|
-
.token.comment,
|
|
56
|
-
.token.prolog,
|
|
57
|
-
.token.doctype,
|
|
58
|
-
.token.cdata {
|
|
59
|
-
color: slategray;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.token.punctuation {
|
|
63
|
-
color: #999;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
.token.namespace {
|
|
67
|
-
opacity: .7;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
.token.property,
|
|
71
|
-
.token.tag,
|
|
72
|
-
.token.boolean,
|
|
73
|
-
.token.constant,
|
|
74
|
-
.token.symbol,
|
|
75
|
-
.token.deleted {
|
|
76
|
-
color: #f8c555;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
.token.selector,
|
|
80
|
-
.token.attr-name,
|
|
81
|
-
.token.string,
|
|
82
|
-
.token.char,
|
|
83
|
-
.token.builtin,
|
|
84
|
-
.token.inserted {
|
|
85
|
-
color: #7ec699;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.token.operator,
|
|
89
|
-
.token.entity,
|
|
90
|
-
.token.url,
|
|
91
|
-
.language-css .token.string,
|
|
92
|
-
.style .token.string {
|
|
93
|
-
color: #67cdcc;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.token.atrule,
|
|
97
|
-
.token.attr-value,
|
|
98
|
-
.token.keyword {
|
|
99
|
-
color: #cc99cd;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
.token.function,
|
|
103
|
-
.token.number,
|
|
104
|
-
.token.class-name {
|
|
105
|
-
color: #f08d49;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.token.regex,
|
|
109
|
-
.token.important,
|
|
110
|
-
.token.variable {
|
|
111
|
-
color: #e90;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
.token.important,
|
|
115
|
-
.token.bold {
|
|
116
|
-
font-weight: bold;
|
|
117
|
-
}
|
|
118
|
-
.token.italic {
|
|
119
|
-
font-style: italic;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.token.entity {
|
|
123
|
-
cursor: help;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
`;
|
|
127
|
-
CodeWrapper.displayName = 'CodeWrapper';
|
package/src/code/index.js
DELETED
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,47 +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
|
-
import {Code} from './code';
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
Layout,
|
|
17
|
-
Link,
|
|
18
|
-
Typography,
|
|
19
|
-
Button,
|
|
20
|
-
Input,
|
|
21
|
-
InfoChip,
|
|
22
|
-
Progress,
|
|
23
|
-
ProgressBar,
|
|
24
|
-
Icon,
|
|
25
|
-
IconButton,
|
|
26
|
-
Tooltip,
|
|
27
|
-
withTooltip,
|
|
28
|
-
Code,
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const UIKit = {
|
|
32
|
-
Layout,
|
|
33
|
-
Link,
|
|
34
|
-
Typography,
|
|
35
|
-
Button,
|
|
36
|
-
Input,
|
|
37
|
-
InfoChip,
|
|
38
|
-
Progress,
|
|
39
|
-
ProgressBar,
|
|
40
|
-
Icon,
|
|
41
|
-
IconButton,
|
|
42
|
-
Tooltip,
|
|
43
|
-
withTooltip,
|
|
44
|
-
Code,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
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,77 +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 {theme, iconNames, toPixel, getIconProps, getLinkProps} from '../utils';
|
|
8
|
-
import typography from '../Typography';
|
|
9
|
-
import Icon from '../icon';
|
|
10
|
-
|
|
11
|
-
const {Typography, Label} = typography;
|
|
12
|
-
|
|
13
|
-
const Link = React.forwardRef((props, ref)=>{
|
|
14
|
-
const {text, variant, size, icon, ...rest} = props;
|
|
15
|
-
const {isLeft, isRight, ...iconProps} = getIconProps('Link', props);
|
|
16
|
-
const labelVariant = {lg: 'lg', sm: 'xs'}[size]||'base';
|
|
17
|
-
return <StyledLink
|
|
18
|
-
ref={ref}
|
|
19
|
-
{...rest}
|
|
20
|
-
{...getLinkProps(props)}
|
|
21
|
-
variant={variant}
|
|
22
|
-
size={size}
|
|
23
|
-
noIcon={!icon}
|
|
24
|
-
>
|
|
25
|
-
{isLeft&&<Icon {...iconProps}/>}
|
|
26
|
-
<Label variant={labelVariant} no_wrap>{text}</Label>
|
|
27
|
-
{isRight&&<Icon {...iconProps}/>}
|
|
28
|
-
</StyledLink>;
|
|
29
|
-
});
|
|
30
|
-
Link.displayName = 'Link';
|
|
31
|
-
Link.defaultProps = {
|
|
32
|
-
variant: 'primary',
|
|
33
|
-
size: 'md',
|
|
34
|
-
iconPlacement: 'left',
|
|
35
|
-
};
|
|
36
|
-
Link.propTypes = {
|
|
37
|
-
text: PT.string.isRequired,
|
|
38
|
-
variant: PT.oneOf(['primary', 'secondary']),
|
|
39
|
-
size: PT.oneOf(['sm', 'md', 'lg']),
|
|
40
|
-
icon: PT.oneOf(iconNames),
|
|
41
|
-
iconPlacement: PT.oneOf(['left', 'right']),
|
|
42
|
-
href: PT.string,
|
|
43
|
-
newTab: PT.bool,
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const StyledLink = styled.a`
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
text-decoration: none;
|
|
51
|
-
background: 0 none;
|
|
52
|
-
border: 0 none;
|
|
53
|
-
padding: 0;
|
|
54
|
-
gap: ${props=>toPixel(props.size=='lg'?8:4)};
|
|
55
|
-
${Typography} {
|
|
56
|
-
color: ${props=>props.variant=='primary'?
|
|
57
|
-
theme.color.blue_11:theme.color.gray_11_50};
|
|
58
|
-
text-decoration: ${props=>props.variant=='secondary'&&
|
|
59
|
-
props.noIcon?'underline':'none'};
|
|
60
|
-
}
|
|
61
|
-
[data-icon] {
|
|
62
|
-
color: ${props=>props.variant=='primary'?
|
|
63
|
-
theme.color.blue_11:theme.color.gray_11_50};
|
|
64
|
-
}
|
|
65
|
-
&:hover {
|
|
66
|
-
${Typography} {
|
|
67
|
-
color: ${theme.color.blue_11};
|
|
68
|
-
text-decoration: ${props=>props.variant=='secondary'&&
|
|
69
|
-
props.noIcon?'underline':'none'};
|
|
70
|
-
}
|
|
71
|
-
[data-icon] { color: ${theme.color.blue_11}; }
|
|
72
|
-
}
|
|
73
|
-
&:hover, :visited, :focus { text-decoration: none; }
|
|
74
|
-
`;
|
|
75
|
-
StyledLink.displayName = 'StyledLink';
|
|
76
|
-
|
|
77
|
-
export default Link;
|