@luminati-io/uikit 1.3.0 → 1.5.0
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/assets/fonts/Inter-Regular.ttf +0 -0
- package/assets/fonts/Inter-SemiBold.ttf +0 -0
- package/assets/icons/account.svg +1 -8
- package/assets/icons/adapt.svg +1 -4
- package/assets/icons/add.svg +1 -3
- package/assets/icons/add_circle.svg +1 -5
- package/assets/icons/add_funds.svg +1 -7
- package/assets/icons/attach.svg +1 -3
- package/assets/icons/book_help.svg +1 -4
- package/assets/icons/building.svg +1 -3
- package/assets/icons/calendar.svg +1 -13
- package/assets/icons/calendar_graph.svg +1 -14
- package/assets/icons/call.svg +1 -5
- package/assets/icons/camera.svg +1 -5
- package/assets/icons/cart.svg +1 -3
- package/assets/icons/close.svg +1 -3
- package/assets/icons/close_circle.svg +1 -3
- package/assets/icons/close_small.svg +1 -5
- package/assets/icons/collapse.svg +1 -4
- package/assets/icons/column.svg +1 -22
- package/assets/icons/columns.svg +1 -10
- package/assets/icons/connect.svg +1 -3
- package/assets/icons/contact_support.svg +1 -3
- package/assets/icons/copy.svg +1 -3
- package/assets/icons/copy_small.svg +1 -3
- package/assets/icons/customize.svg +1 -6
- package/assets/icons/maximize.svg +1 -1
- package/dist/uikit.umd.js +1 -1
- package/package.json +6 -3
- package/src/button/button.js +121 -0
- package/src/button/index.js +6 -0
- package/src/button/loading_icon.js +46 -0
- package/src/icon.js +1 -5
- package/src/icon_button.js +25 -21
- package/src/index.js +32 -10
- package/src/input/index.js +6 -0
- package/src/input/toggle.js +105 -0
- package/src/layout/flex.js +19 -1
- package/src/link/index.js +6 -0
- package/src/link/link.js +84 -0
- package/src/progress/index.js +1 -1
- package/src/tooltip.js +99 -0
- package/src/utils.js +135 -1
- package/webpack.common.js +2 -4
- package/webpack.shared.js +11 -0
- package/src/button.js +0 -180
package/src/tooltip.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
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
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import icons from '@icons';
|
|
6
|
+
import {css} from 'styled-components';
|
|
6
7
|
|
|
7
8
|
export const theme = {
|
|
8
9
|
color: {
|
|
@@ -132,5 +133,138 @@ export function fromTheme(propName, defaultValue){
|
|
|
132
133
|
};
|
|
133
134
|
}
|
|
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
|
+
})();
|
|
135
268
|
|
|
136
|
-
export default {theme, toPixel, getCommonProps, getTypographyProps, fromTheme
|
|
269
|
+
export default {theme, toPixel, getCommonProps, getTypographyProps, fromTheme,
|
|
270
|
+
colorNames, iconNames, tooltipPlacements};
|
package/webpack.common.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
'use strict'; /*jslint node:true*/
|
|
3
3
|
|
|
4
4
|
const path = require('path');
|
|
5
|
+
const {svgRule} = require('./webpack.shared.js');
|
|
5
6
|
|
|
6
7
|
const alias = {
|
|
7
8
|
'@icons': path.resolve(__dirname, 'assets/icons'),
|
|
@@ -15,10 +16,7 @@ const common = {
|
|
|
15
16
|
exclude: /node_modules/,
|
|
16
17
|
use: ['babel-loader'],
|
|
17
18
|
},
|
|
18
|
-
|
|
19
|
-
test: /\.svg$/,
|
|
20
|
-
loader: 'svg-sprite-loader',
|
|
21
|
-
}
|
|
19
|
+
svgRule,
|
|
22
20
|
]
|
|
23
21
|
},
|
|
24
22
|
resolve: {alias},
|
package/src/button.js
DELETED
|
@@ -1,180 +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 typography from './Typography';
|
|
9
|
-
|
|
10
|
-
const {Typography, Label} = typography;
|
|
11
|
-
const {theme, toPixel, getCommonProps} = utils;
|
|
12
|
-
|
|
13
|
-
const Button = React.forwardRef((props, ref)=>{
|
|
14
|
-
const {text, variant, size, icon, iconPlacement, disabled} = props;
|
|
15
|
-
const iconLeft = !!icon&&iconPlacement=='left';
|
|
16
|
-
const iconRight = !!icon&&iconPlacement=='right';
|
|
17
|
-
const iconName = `ic_${icon}.svg`;
|
|
18
|
-
const iconSize = {sm: 'xs', xs: 'xxs'}[size]||'sm';
|
|
19
|
-
return <StyledButton ref={ref} {...getCommonProps(props)} variant={variant}
|
|
20
|
-
size={size} disabled={disabled} $inline={!icon}>
|
|
21
|
-
{/* {iconLeft&&<Icon name={iconName} size={iconSize}/>} */}
|
|
22
|
-
<Label variant={size=='xs'?'sm':'lg'} no_wrap>{text}</Label>
|
|
23
|
-
{/* {iconRight&&<Icon name={iconName} size={iconSize}/>} */}
|
|
24
|
-
</StyledButton>;
|
|
25
|
-
});
|
|
26
|
-
Button.displayName = 'Button';
|
|
27
|
-
Button.defaultProps = {size: 'md', iconPlacement: 'left'};
|
|
28
|
-
Button.propTypes = {
|
|
29
|
-
text: PT.string.isRequired,
|
|
30
|
-
variant: PT.oneOf(['primary', 'secondary', 'negative',
|
|
31
|
-
'negative_secondary', 'positive', 'white']).isRequired,
|
|
32
|
-
size: PT.oneOf(['xs', 'sm', 'md', 'lg']),
|
|
33
|
-
icon: PT.string,
|
|
34
|
-
iconPlacement: PT.oneOf(['left', 'right']),
|
|
35
|
-
disabled: PT.bool,
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const StyledButton = styled.button`
|
|
39
|
-
display: flex;
|
|
40
|
-
align-items: center;
|
|
41
|
-
justify-content: center;
|
|
42
|
-
border-radius: 4px;
|
|
43
|
-
${props=>{
|
|
44
|
-
let gap = 4;
|
|
45
|
-
let paddingLeft = 12;
|
|
46
|
-
let paddingRight = 16;
|
|
47
|
-
if (props.$inline)
|
|
48
|
-
paddingLeft = paddingRight;
|
|
49
|
-
if (props.size=='xs')
|
|
50
|
-
{
|
|
51
|
-
gap = 2;
|
|
52
|
-
paddingLeft = paddingRight = 8;
|
|
53
|
-
}
|
|
54
|
-
return css`
|
|
55
|
-
gap: ${toPixel(gap)};
|
|
56
|
-
padding-left: ${toPixel(paddingLeft)};
|
|
57
|
-
padding-right: ${toPixel(paddingRight)};
|
|
58
|
-
`;
|
|
59
|
-
}}
|
|
60
|
-
${props=>{
|
|
61
|
-
const getColors = ()=>{
|
|
62
|
-
const {variant, disabled} = props;
|
|
63
|
-
if (disabled)
|
|
64
|
-
{
|
|
65
|
-
return {
|
|
66
|
-
color: theme.color.gray_9,
|
|
67
|
-
backColor: theme.color.gray_2,
|
|
68
|
-
borderColor: theme.color.gray_6,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
const styles = {
|
|
72
|
-
primary: {
|
|
73
|
-
color: theme.color.white,
|
|
74
|
-
backColor: theme.color.blue_11,
|
|
75
|
-
borderColor: theme.color.blue_11,
|
|
76
|
-
hover: {
|
|
77
|
-
backColor: theme.color.blue_10,
|
|
78
|
-
borderColor: theme.color.blue_10,
|
|
79
|
-
},
|
|
80
|
-
active: {
|
|
81
|
-
backColor: theme.color.blue_11,
|
|
82
|
-
borderColor: theme.color.blue_11,
|
|
83
|
-
boxShadow: '0 0 0 2px rgba(0, 106, 220, 0.4)',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
secondary: {
|
|
87
|
-
color: theme.color.blue_11,
|
|
88
|
-
backColor: theme.color.white,
|
|
89
|
-
borderColor: theme.color.blue_11,
|
|
90
|
-
hover: {backColor: theme.color.blue_2},
|
|
91
|
-
active: {
|
|
92
|
-
backColor: theme.color.white,
|
|
93
|
-
boxShadow: '0 0 0 2px rgba(0, 106, 220, 0.4)',
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
negative: {
|
|
97
|
-
color: theme.color.white,
|
|
98
|
-
backColor: theme.color.red_11,
|
|
99
|
-
borderColor: theme.color.red_11,
|
|
100
|
-
hover: {
|
|
101
|
-
backColor: theme.color.red_10,
|
|
102
|
-
borderColor: theme.color.red_10,
|
|
103
|
-
},
|
|
104
|
-
active: {
|
|
105
|
-
backColor: theme.color.red_11,
|
|
106
|
-
borderColor: theme.color.red_11,
|
|
107
|
-
boxShadow: '0 0 0 2px rgba(205, 43, 49, 0.4)',
|
|
108
|
-
},
|
|
109
|
-
},
|
|
110
|
-
negative_secondary: {
|
|
111
|
-
color: theme.color.red_11,
|
|
112
|
-
backColor: theme.color.white,
|
|
113
|
-
borderColor: theme.color.red_11,
|
|
114
|
-
hover: {backColor: theme.color.red_2},
|
|
115
|
-
active: {
|
|
116
|
-
backColor: theme.color.white,
|
|
117
|
-
boxShadow: '0 0 0 2px rgba(205, 43, 49, 0.4)',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
positive: {
|
|
121
|
-
color: theme.color.green_11,
|
|
122
|
-
backColor: theme.color.white,
|
|
123
|
-
borderColor: theme.color.green_11,
|
|
124
|
-
hover: {backColor: theme.color.green_2},
|
|
125
|
-
active: {
|
|
126
|
-
backColor: theme.color.white,
|
|
127
|
-
boxShadow: '0 0 0 2px rgba(6, 122, 111, 0.4)',
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
white: {
|
|
131
|
-
color: theme.color.gray_11_50,
|
|
132
|
-
iconColor: theme.color.gray_10,
|
|
133
|
-
backColor: theme.color.white,
|
|
134
|
-
borderColor: theme.color.gray_8,
|
|
135
|
-
hover: {backColor: theme.color.gray_2},
|
|
136
|
-
active: {
|
|
137
|
-
backColor: theme.color.gray_3,
|
|
138
|
-
borderColor: theme.color.gray_9,
|
|
139
|
-
iconColor: theme.color.gray_11_50,
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
return styles[variant]||styles.primary;
|
|
144
|
-
};
|
|
145
|
-
const colors = getColors();
|
|
146
|
-
return css`
|
|
147
|
-
background-color: ${colors.backColor};
|
|
148
|
-
border: 1px solid ${colors.borderColor};
|
|
149
|
-
${Typography} { color: ${colors.color}; }
|
|
150
|
-
${'' /* ${IconContainer} {
|
|
151
|
-
background-color: ${colors.iconColor||colors.color};
|
|
152
|
-
} */}
|
|
153
|
-
${colors.hover&&`&:hover {
|
|
154
|
-
background-color: ${colors.hover.backColor};
|
|
155
|
-
border: 1px solid ${colors.hover.borderColor};
|
|
156
|
-
}`}
|
|
157
|
-
${colors.active&&`&:active {
|
|
158
|
-
background-color: ${colors.active.backColor};
|
|
159
|
-
border: 1px solid ${colors.active.borderColor};
|
|
160
|
-
box-shadow: ${colors.active.boxShadow};
|
|
161
|
-
${'' /* ${colors.active.iconColor&&`${IconContainer} {
|
|
162
|
-
background-color: ${colors.active.iconColor};
|
|
163
|
-
}`} */}
|
|
164
|
-
}`}
|
|
165
|
-
`;
|
|
166
|
-
}}
|
|
167
|
-
${props=>{
|
|
168
|
-
let w = 40; // md
|
|
169
|
-
if (props.size=='lg')
|
|
170
|
-
w = 48;
|
|
171
|
-
if (props.size=='sm')
|
|
172
|
-
w = 36;
|
|
173
|
-
if (props.size=='xs')
|
|
174
|
-
w = 28;
|
|
175
|
-
return css`height: ${toPixel(w)};`;
|
|
176
|
-
}}
|
|
177
|
-
`;
|
|
178
|
-
StyledButton.displayName = 'StyledButton';
|
|
179
|
-
|
|
180
|
-
export default Button;
|