@luminati-io/uikit 1.6.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/package.json +2 -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/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/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;
|
package/src/tooltip.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import React, {useCallback, useState} from 'react';
|
|
5
|
-
import {usePopper} from 'react-popper';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
import PT from 'prop-types';
|
|
8
|
-
import {theme, tooltipPlacements} from './utils';
|
|
9
|
-
import typography from './Typography';
|
|
10
|
-
|
|
11
|
-
const {Label} = typography;
|
|
12
|
-
|
|
13
|
-
const Tooltip = props=>{
|
|
14
|
-
const {children, tooltip, placement} = props;
|
|
15
|
-
const [referenceElement, setReferenceElement] = useState(null);
|
|
16
|
-
const [popperElement, setPopperElement] = useState(null);
|
|
17
|
-
const [arrowElement, setArrowElement] = useState(null);
|
|
18
|
-
const [visible, setVisible] = useState(false);
|
|
19
|
-
const show = useCallback(()=>setVisible(true), []);
|
|
20
|
-
const hide = useCallback(()=>setVisible(false), []);
|
|
21
|
-
const {styles, attributes} = usePopper(referenceElement,
|
|
22
|
-
popperElement, {
|
|
23
|
-
placement,
|
|
24
|
-
modifiers: [
|
|
25
|
-
{name: 'arrow', options: {element: arrowElement}},
|
|
26
|
-
{name: 'offset', options: {offset: [0, 8]}},
|
|
27
|
-
],
|
|
28
|
-
});
|
|
29
|
-
if (!tooltip)
|
|
30
|
-
return children;
|
|
31
|
-
return <>
|
|
32
|
-
<StyledTooltipReference ref={setReferenceElement}
|
|
33
|
-
onMouseEnter={show} onMouseLeave={hide}>
|
|
34
|
-
{children}
|
|
35
|
-
</StyledTooltipReference>
|
|
36
|
-
<StyledTooltipBody ref={setPopperElement} style={styles.popper}
|
|
37
|
-
{...attributes.popper} visible={visible}>
|
|
38
|
-
<Label variant="sm" color="white">{tooltip}</Label>
|
|
39
|
-
<StyledTooltipArrow ref={setArrowElement} style={styles.arrow}
|
|
40
|
-
{...attributes.arrow} visible={visible}/>
|
|
41
|
-
</StyledTooltipBody>
|
|
42
|
-
</>;
|
|
43
|
-
};
|
|
44
|
-
Tooltip.defaultProps = {placement: 'top'};
|
|
45
|
-
Tooltip.propTypes = {
|
|
46
|
-
tooltip: PT.node,
|
|
47
|
-
placement: PT.oneOf(tooltipPlacements),
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export const withTooltip = (Comp, tooltipProps)=>function WithTooltip(props){
|
|
51
|
-
return <Tooltip {...tooltipProps}>
|
|
52
|
-
<Comp {...props}/>
|
|
53
|
-
</Tooltip>;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
const StyledTooltipBody = styled.div`
|
|
57
|
-
background-color: ${theme.color.gray_11_50};
|
|
58
|
-
padding: ${theme.spacing['03']};
|
|
59
|
-
width: fit-content;
|
|
60
|
-
max-width: 500px;
|
|
61
|
-
border-radius: ${theme.spacing['02']};
|
|
62
|
-
visibility: ${props=>props.visible ? 'visible': 'hidden'};
|
|
63
|
-
opacity: ${props=>props.visible ? 1 : 0};
|
|
64
|
-
transition: opacity 200ms;
|
|
65
|
-
`;
|
|
66
|
-
|
|
67
|
-
const StyledTooltipArrow = styled.div`
|
|
68
|
-
&, &::before {
|
|
69
|
-
position: absolute;
|
|
70
|
-
width: ${theme.spacing['04']};
|
|
71
|
-
height: ${theme.spacing['04']};
|
|
72
|
-
background: inherit;
|
|
73
|
-
border-radius: ${theme.spacing['01']};
|
|
74
|
-
}
|
|
75
|
-
visibility: hidden;
|
|
76
|
-
&::before {
|
|
77
|
-
visibility: ${props=>props.visible ? 'visible': 'hidden'};
|
|
78
|
-
content: '';
|
|
79
|
-
transform: rotate(45deg);
|
|
80
|
-
}
|
|
81
|
-
[data-popper-placement^='top'] > & {
|
|
82
|
-
bottom: -${theme.spacing['02']};
|
|
83
|
-
}
|
|
84
|
-
[data-popper-placement^='right'] > & {
|
|
85
|
-
left: -${theme.spacing['02']};
|
|
86
|
-
}
|
|
87
|
-
[data-popper-placement^='bottom'] > & {
|
|
88
|
-
top: -${theme.spacing['02']};
|
|
89
|
-
}
|
|
90
|
-
[data-popper-placement^='left'] > & {
|
|
91
|
-
right: -${theme.spacing['02']};
|
|
92
|
-
}
|
|
93
|
-
`;
|
|
94
|
-
|
|
95
|
-
const StyledTooltipReference = styled.div`
|
|
96
|
-
width: fit-content;
|
|
97
|
-
`;
|
|
98
|
-
|
|
99
|
-
export default Tooltip;
|
package/src/utils.js
DELETED
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint react:true*/
|
|
3
|
-
|
|
4
|
-
import _ from 'lodash';
|
|
5
|
-
import icons from '@icons';
|
|
6
|
-
import {css} from 'styled-components';
|
|
7
|
-
|
|
8
|
-
export const theme = {
|
|
9
|
-
color: {
|
|
10
|
-
blue_1: '#FBFDFF',
|
|
11
|
-
blue_2: '#F5FAFF',
|
|
12
|
-
blue_3: '#EDF6FF',
|
|
13
|
-
blue_4: '#E1F0FF',
|
|
14
|
-
blue_5: '#CEE7FE',
|
|
15
|
-
blue_6: '#B7D9F8',
|
|
16
|
-
blue_7: '#96C7F2',
|
|
17
|
-
blue_8: '#5EB0EF',
|
|
18
|
-
blue_9: '#0091FF',
|
|
19
|
-
blue_10: '#0081F1',
|
|
20
|
-
blue_11: '#006ADC',
|
|
21
|
-
blue_12: '#00254D',
|
|
22
|
-
red_1: '#FFFCFC',
|
|
23
|
-
red_2: '#FFF8F8',
|
|
24
|
-
red_3: '#FFEFEF',
|
|
25
|
-
red_4: '#FFE5E5',
|
|
26
|
-
red_5: '#FDD8D8',
|
|
27
|
-
red_6: '#F9C6C6',
|
|
28
|
-
red_7: '#F3AEAF',
|
|
29
|
-
red_8: '#EB9091',
|
|
30
|
-
red_9: '#E5484D',
|
|
31
|
-
red_10: '#DC3D43',
|
|
32
|
-
red_11: '#CD2B31',
|
|
33
|
-
red_12: '#381316',
|
|
34
|
-
green_1: '#FAFEFD',
|
|
35
|
-
green_2: '#F1FCFA',
|
|
36
|
-
green_3: '#E7F9F5',
|
|
37
|
-
green_4: '#D9F3EE',
|
|
38
|
-
green_5: '#C7EBE5',
|
|
39
|
-
green_6: '#AFDFD7',
|
|
40
|
-
green_7: '#8DCEC3',
|
|
41
|
-
green_8: '#53B9AB',
|
|
42
|
-
green_9: '#12A594',
|
|
43
|
-
green_10: '#0E9888',
|
|
44
|
-
green_11: '#067A6F',
|
|
45
|
-
green_12: '#10302B',
|
|
46
|
-
yellow_1: '#FEFDFB',
|
|
47
|
-
yellow_2: '#FFF9ED',
|
|
48
|
-
yellow_3: '#FFF4D5',
|
|
49
|
-
yellow_4: '#FFECBC',
|
|
50
|
-
yellow_5: '#FFE3A2',
|
|
51
|
-
yellow_6: '#FFD386',
|
|
52
|
-
yellow_7: '#F3BA63',
|
|
53
|
-
yellow_8: '#EE9D2B',
|
|
54
|
-
yellow_9: '#FFB224',
|
|
55
|
-
yellow_10: '#FFA01C',
|
|
56
|
-
yellow_11: '#AD5700',
|
|
57
|
-
yellow_12: '#4E2009',
|
|
58
|
-
white: '#FFFFFF',
|
|
59
|
-
gray_1: '#FBFCFD',
|
|
60
|
-
gray_2: '#F8F9FA',
|
|
61
|
-
gray_3: '#F1F3F5',
|
|
62
|
-
gray_4: '#ECEEF0',
|
|
63
|
-
gray_5: '#E6E8EB',
|
|
64
|
-
gray_6: '#DFE3E6',
|
|
65
|
-
gray_7: '#D7DBDF',
|
|
66
|
-
gray_8: '#C1C8CD',
|
|
67
|
-
gray_9: '#889096',
|
|
68
|
-
gray_10: '#7E868C',
|
|
69
|
-
gray_11: '#687076',
|
|
70
|
-
gray_11_25: '#3A3F42',
|
|
71
|
-
gray_11_50: '#2B2F31',
|
|
72
|
-
gray_11_75: '#202425',
|
|
73
|
-
gray_12: '#151718',
|
|
74
|
-
black: '#000000',
|
|
75
|
-
black_1: '#303B45',
|
|
76
|
-
},
|
|
77
|
-
font_family: {
|
|
78
|
-
sans: `'Inter', sans-serif`,
|
|
79
|
-
mono: `'Monaco', sans-serif`,
|
|
80
|
-
},
|
|
81
|
-
font_size: {xs: '12px', sm: '13px', md: '14px', lg: '18px', xl: '28px'},
|
|
82
|
-
font_weight: {regular: '400', semibold: '600'},
|
|
83
|
-
letter_spacing: {normal: '0em', wide: '0.02em'},
|
|
84
|
-
line_height: {none: '100%', snug: '125%', loose: '150%'},
|
|
85
|
-
spacing: {'00': '0px', '01': '2px', '02': '4px', '03': '8px', '04': '12px',
|
|
86
|
-
'05': '16px', '06': '24px', '07': '32px', '08': '40px',
|
|
87
|
-
'09': '48px', '10': '64px', '11': '72px'},
|
|
88
|
-
box_shadow: {
|
|
89
|
-
sm: '0px 0px 2px rgba(0, 0, 0, 0.04),'+
|
|
90
|
-
'0px 4px 24px rgba(0, 0, 0, 0.04)',
|
|
91
|
-
md: '0px 0px 2px rgba(0, 0, 0, 0.08),'
|
|
92
|
-
+'0px 8px 24px rgba(0, 0, 0, 0.08)',
|
|
93
|
-
lg: '0px 0px 2px rgba(0, 0, 0, 0.12),'
|
|
94
|
-
+'0px 0px 96px rgba(0, 0, 0, 0.16)',
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const colorNames = Object.keys(theme.color);
|
|
99
|
-
|
|
100
|
-
export const iconNames = Object.keys(icons);
|
|
101
|
-
|
|
102
|
-
export const toPixel = value=>`${value}px`;
|
|
103
|
-
|
|
104
|
-
export const getCommonProps = props=>_.pickBy(props, (v, k)=>{
|
|
105
|
-
const inc = ['id', 'className', 'onClick'];
|
|
106
|
-
const starts = ['onMouse', 'aria-', 'data-'];
|
|
107
|
-
return inc.includes(k)||starts.some(s=>k.indexOf(s)==0);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
export const getTypographyProps = props=>{
|
|
111
|
-
const {tag: as, font_family='sans', font_weight='regular', font_size,
|
|
112
|
-
line_height='none', letter_spacing='normal', italic, color,
|
|
113
|
-
no_wrap, underline} = props;
|
|
114
|
-
return {as, font_family, font_weight, font_size, line_height,
|
|
115
|
-
letter_spacing, italic, color, no_wrap, underline,
|
|
116
|
-
...getCommonProps(props)};
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
export function fromTheme(propName, defaultValue){
|
|
120
|
-
return function(props){
|
|
121
|
-
let value = props[propName]??defaultValue;
|
|
122
|
-
if (value!=null)
|
|
123
|
-
{
|
|
124
|
-
if (propName.indexOf('padding')==0||propName.indexOf('margin')==0)
|
|
125
|
-
return theme.spacing[value]??value;
|
|
126
|
-
if (['font_weight', 'font_size', 'line_height', 'letter_spacing',
|
|
127
|
-
'color', 'box_shadow'].includes(propName))
|
|
128
|
-
{
|
|
129
|
-
return theme[propName][value];
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return value;
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export const getIconProps = (comp, opt)=>{
|
|
137
|
-
const {size, icon, iconPlacement='left'} = opt;
|
|
138
|
-
const isLeft = !!icon&&iconPlacement=='left';
|
|
139
|
-
const isRight = !!icon&&iconPlacement=='right';
|
|
140
|
-
const iconSize = ()=>{
|
|
141
|
-
if (comp=='Link')
|
|
142
|
-
return {lg: 'sm', sm: 'xxs'}[size]||'xs';
|
|
143
|
-
if (comp=='Button')
|
|
144
|
-
return {sm: 'xs', xs: 'xxs'}[size]||'sm';
|
|
145
|
-
if (comp=='MenuItem')
|
|
146
|
-
return size=='sm'?'xs':'sm';
|
|
147
|
-
};
|
|
148
|
-
return {isLeft, isRight, name: icon, size: iconSize()};
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export const getLinkProps = opt=>{
|
|
152
|
-
const {as, href, newTab} = opt;
|
|
153
|
-
let p = {as, href};
|
|
154
|
-
if (newTab)
|
|
155
|
-
p = {...p, target: '_blank', rel: 'noopener noreferrer'};
|
|
156
|
-
return p;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export const getButtonColors = props=>{
|
|
160
|
-
const {variant, disabled} = props;
|
|
161
|
-
if (disabled)
|
|
162
|
-
{
|
|
163
|
-
return {
|
|
164
|
-
color: theme.color.gray_9,
|
|
165
|
-
backColor: theme.color.gray_2,
|
|
166
|
-
border: `1px solid ${theme.color.gray_6}`,
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
const styles = {
|
|
170
|
-
primary: {
|
|
171
|
-
color: theme.color.white,
|
|
172
|
-
backColor: theme.color.blue_11,
|
|
173
|
-
hover: {backColor: theme.color.blue_10},
|
|
174
|
-
active: {
|
|
175
|
-
backColor: theme.color.blue_11,
|
|
176
|
-
boxShadow: '0 0 0 2px rgba(0, 106, 220, 0.4)',
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
secondary: {
|
|
180
|
-
color: theme.color.blue_11,
|
|
181
|
-
backColor: theme.color.white,
|
|
182
|
-
border: `1px solid ${theme.color.blue_11}`,
|
|
183
|
-
hover: {backColor: theme.color.blue_2},
|
|
184
|
-
active: {
|
|
185
|
-
backColor: theme.color.white,
|
|
186
|
-
boxShadow: '0 0 0 2px rgba(0, 106, 220, 0.4)',
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
negative: {
|
|
190
|
-
color: theme.color.white,
|
|
191
|
-
backColor: theme.color.red_11,
|
|
192
|
-
hover: {backColor: theme.color.red_10},
|
|
193
|
-
active: {
|
|
194
|
-
backColor: theme.color.red_11,
|
|
195
|
-
boxShadow: '0 0 0 2px rgba(205, 43, 49, 0.4)',
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
negative_secondary: {
|
|
199
|
-
color: theme.color.red_11,
|
|
200
|
-
backColor: theme.color.white,
|
|
201
|
-
border: `1px solid ${theme.color.red_11}`,
|
|
202
|
-
hover: {backColor: theme.color.red_2},
|
|
203
|
-
active: {
|
|
204
|
-
backColor: theme.color.white,
|
|
205
|
-
boxShadow: '0 0 0 2px rgba(205, 43, 49, 0.4)',
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
positive: {
|
|
209
|
-
color: theme.color.green_11,
|
|
210
|
-
backColor: theme.color.white,
|
|
211
|
-
border: `1px solid ${theme.color.green_11}`,
|
|
212
|
-
hover: {backColor: theme.color.green_2},
|
|
213
|
-
active: {
|
|
214
|
-
backColor: theme.color.white,
|
|
215
|
-
boxShadow: '0 0 0 2px rgba(6, 122, 111, 0.4)',
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
white: {
|
|
219
|
-
color: theme.color.gray_11_50,
|
|
220
|
-
iconColor: theme.color.gray_10,
|
|
221
|
-
backColor: theme.color.white,
|
|
222
|
-
border: `1px solid ${theme.color.gray_8}`,
|
|
223
|
-
hover: {backColor: theme.color.gray_2},
|
|
224
|
-
active: {
|
|
225
|
-
backColor: theme.color.gray_3,
|
|
226
|
-
border: `1px solid ${theme.color.gray_9}`,
|
|
227
|
-
iconColor: theme.color.gray_11_50,
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
};
|
|
231
|
-
return styles[variant]||styles.primary;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
export const toIconSize = size=>{
|
|
235
|
-
const toSize = value=>css`
|
|
236
|
-
width: ${toPixel(value)};
|
|
237
|
-
height: ${toPixel(value)};
|
|
238
|
-
`;
|
|
239
|
-
if (size=='xl')
|
|
240
|
-
return toSize(48);
|
|
241
|
-
if (size=='lg')
|
|
242
|
-
return toSize(32);
|
|
243
|
-
if (size=='sm')
|
|
244
|
-
return toSize(20);
|
|
245
|
-
if (size=='xs')
|
|
246
|
-
return toSize(16);
|
|
247
|
-
if (size=='xxs')
|
|
248
|
-
return toSize(12);
|
|
249
|
-
return toSize(24);
|
|
250
|
-
};
|
|
251
|
-
|
|
252
|
-
export const toButtonSize = size=>{
|
|
253
|
-
let w = 40; // md
|
|
254
|
-
if (size=='lg')
|
|
255
|
-
w = 48;
|
|
256
|
-
if (size=='sm')
|
|
257
|
-
w = 36;
|
|
258
|
-
if (size=='xs')
|
|
259
|
-
w = 28;
|
|
260
|
-
return css`height: ${toPixel(w)};`;
|
|
261
|
-
};
|
|
262
|
-
|
|
263
|
-
export const tooltipPlacements = (()=>{
|
|
264
|
-
const positions = ['auto', 'top', 'right', 'bottom', 'left'];
|
|
265
|
-
const variants = ['', '-start', '-end'];
|
|
266
|
-
return positions.flatMap(p=>variants.map(v=>p+v));
|
|
267
|
-
})();
|
|
268
|
-
|
|
269
|
-
export default {theme, toPixel, getCommonProps, getTypographyProps, fromTheme,
|
|
270
|
-
colorNames, iconNames, tooltipPlacements};
|
package/webpack.common.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint node:true*/
|
|
3
|
-
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const {svgRule} = require('./webpack.shared.js');
|
|
6
|
-
|
|
7
|
-
const alias = {
|
|
8
|
-
'@icons': path.resolve(__dirname, 'assets/icons'),
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const common = {
|
|
12
|
-
module: {
|
|
13
|
-
rules: [
|
|
14
|
-
{
|
|
15
|
-
test: /src[\\/].+\.js$/,
|
|
16
|
-
exclude: /node_modules/,
|
|
17
|
-
use: ['babel-loader'],
|
|
18
|
-
},
|
|
19
|
-
svgRule,
|
|
20
|
-
]
|
|
21
|
-
},
|
|
22
|
-
resolve: {alias},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
module.exports = common;
|
package/webpack.config.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// LICENSE_CODE ZON
|
|
2
|
-
'use strict'; /*jslint node:true*/
|
|
3
|
-
|
|
4
|
-
const {merge} = require('webpack-merge');
|
|
5
|
-
const common = require('./webpack.common.js');
|
|
6
|
-
|
|
7
|
-
const production = {
|
|
8
|
-
entry: './src/index.js',
|
|
9
|
-
mode: 'production',
|
|
10
|
-
output: {
|
|
11
|
-
filename: 'uikit.umd.js',
|
|
12
|
-
library: {
|
|
13
|
-
name: 'uikit',
|
|
14
|
-
type: 'umd',
|
|
15
|
-
export: 'default',
|
|
16
|
-
umdNamedDefine: true,
|
|
17
|
-
},
|
|
18
|
-
globalObject: 'this',
|
|
19
|
-
},
|
|
20
|
-
externals: {
|
|
21
|
-
'react': 'react',
|
|
22
|
-
'react-dom': 'react-dom',
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
module.exports = ()=>{
|
|
27
|
-
return merge(common, production);
|
|
28
|
-
};
|