@xaypay/tui 0.0.55 → 0.0.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +319 -184
- package/dist/index.js +318 -185
- package/package.json +5 -4
- package/rollup.config.js +2 -0
- package/src/assets/icons/arrow.svg +3 -0
- package/src/assets/icons/close-icon.svg +3 -0
- package/src/components/autocomplate/index.js +22 -17
- package/src/components/button/index.js +8 -8
- package/src/components/file/index.js +7 -0
- package/src/components/input/index.js +14 -18
- package/src/components/select/index.js +252 -103
- package/src/components/select/select.module.css +43 -80
- package/src/components/select/select.stories.js +1 -2
- package/src/components/table/index.js +1 -1
- package/src/components/tooltip/index.js +37 -34
- package/src/components/tooltip/tooltip.module.css +2 -2
- package/src/components/tooltip/tooltip.stories.js +3 -2
- package/src/components/typography/index.js +26 -35
- package/src/components/typography/typography.stories.js +1 -1
- package/src/stories/Introduction.stories.mdx +10 -0
- package/src/stories/configuration.stories.mdx +76 -11
- package/src/stories/static/button-usage.png +0 -0
- package/src/stories/static/input-tooltip-usage.png +0 -0
- package/src/stories/usage.stories.mdx +132 -0
- package/src/utils/index.js +1 -5
- package/tui.config.js +67 -13
- package/src/components/multiselect/index.js +0 -96
- package/src/components/multiselect/multiselect.module.css +0 -137
- package/src/components/multiselect/multiselect.stories.js +0 -20
|
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import classnames from 'classnames';
|
|
4
4
|
import { compereConfigs } from "./../../utils";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import ReactInfoIcon from './../../assets/icons/tooltip.svg';
|
|
7
7
|
|
|
8
8
|
import styles from "./tooltip.module.css";
|
|
9
9
|
|
|
@@ -12,19 +12,20 @@ export const Tooltip = ({
|
|
|
12
12
|
text,
|
|
13
13
|
width,
|
|
14
14
|
color,
|
|
15
|
-
tIcon,
|
|
16
15
|
height,
|
|
17
|
-
|
|
16
|
+
radius,
|
|
18
17
|
fontSize,
|
|
19
|
-
tBgColor,
|
|
20
18
|
className,
|
|
21
19
|
fontFamily,
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
tooltipIcon,
|
|
21
|
+
tooltipWidth,
|
|
22
|
+
tooltipRadius,
|
|
23
|
+
backgroundColor,
|
|
24
|
+
tooltipBackgroundColor
|
|
24
25
|
}) => {
|
|
25
26
|
const tooltipRef = createRef(null);
|
|
26
|
-
const [
|
|
27
|
-
const [
|
|
27
|
+
const [checkTooltipWidth, setCheckTooltipWidth] = useState(0);
|
|
28
|
+
const [checkTooltipHeight, setCheckTooltipHeight] = useState(0);
|
|
28
29
|
const [showTooltip, setShowTooltip] = useState(false);
|
|
29
30
|
|
|
30
31
|
const configStyles = compereConfigs();
|
|
@@ -33,29 +34,26 @@ export const Tooltip = ({
|
|
|
33
34
|
className
|
|
34
35
|
);
|
|
35
36
|
|
|
36
|
-
useEffect(_ => {
|
|
37
|
-
if (!type && !text) {
|
|
38
|
-
alert('Add type and text on tooltip');
|
|
39
|
-
} else if (!type) {
|
|
40
|
-
alert('Add type on tooltip');
|
|
41
|
-
} else if (!text) {
|
|
42
|
-
alert('Add text on tooltip');
|
|
43
|
-
}
|
|
44
|
-
tooltipRef.current && tooltipRef.current.clientWidth && tooltipRef.current.clientWidth > 0 && setTooltipWidth(tooltipRef.current.clientWidth);
|
|
45
|
-
tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setTooltipHeight(tooltipRef.current.clientHeight);
|
|
46
|
-
}, [type, text, tooltipWidth, tooltipRef]);
|
|
47
|
-
|
|
48
37
|
const handleShow = () => {
|
|
49
38
|
setShowTooltip(!showTooltip);
|
|
50
39
|
};
|
|
51
40
|
|
|
41
|
+
useEffect(_ => {
|
|
42
|
+
if (!text) {
|
|
43
|
+
alert('Add text on tooltip');
|
|
44
|
+
}
|
|
45
|
+
tooltipRef.current && tooltipRef.current.clientWidth && tooltipRef.current.clientWidth > 0 && setCheckTooltipWidth(tooltipRef.current.clientWidth);
|
|
46
|
+
tooltipRef.current && tooltipRef.current.clientHeight && tooltipRef.current.clientHeight > 0 && setCheckTooltipHeight(tooltipRef.current.clientHeight);
|
|
47
|
+
}, [text, tooltipRef, checkTooltipWidth, checkTooltipHeight]);
|
|
48
|
+
|
|
52
49
|
return (
|
|
53
50
|
<div
|
|
54
51
|
className={`${styles['tooltip-block']}`}
|
|
55
52
|
style={{
|
|
56
53
|
width: width ? width : configStyles.TOOLTIP.width,
|
|
57
54
|
height: height ? height : configStyles.TOOLTIP.height,
|
|
58
|
-
|
|
55
|
+
borderRadius: radius ? radius : configStyles.TOOLTIP.radius,
|
|
56
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.TOOLTIP.backgroundColor,
|
|
59
57
|
}}
|
|
60
58
|
>
|
|
61
59
|
{
|
|
@@ -64,10 +62,11 @@ export const Tooltip = ({
|
|
|
64
62
|
ref={tooltipRef}
|
|
65
63
|
className={classProps}
|
|
66
64
|
style={{
|
|
67
|
-
|
|
68
|
-
borderRadius:
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
width: tooltipWidth ? tooltipWidth : configStyles.TOOLTIP.tooltipWidth,
|
|
66
|
+
borderRadius: tooltipRadius ? tooltipRadius : configStyles.TOOLTIP.tooltipRadius,
|
|
67
|
+
backgroundColor: tooltipBackgroundColor ? tooltipBackgroundColor : configStyles.TOOLTIP.tooltipBackgroundColor,
|
|
68
|
+
top: type === 'top' ? `calc(-${checkTooltipHeight + 7}px)` : type === 'bottom' ? 'calc(100% + 7px)' : type === 'left' || type === 'right' ? `calc(50% - ${checkTooltipHeight / 2}px)` : '0px',
|
|
69
|
+
left: type === 'top' || type === 'bottom' ? `calc(50% - ${checkTooltipWidth / 2}px)` : type === 'left' ? `-${checkTooltipWidth + 7}px` : type === 'right' ? 'calc(100% + 7px)' : '0px'
|
|
71
70
|
}}
|
|
72
71
|
>
|
|
73
72
|
<div
|
|
@@ -76,7 +75,7 @@ export const Tooltip = ({
|
|
|
76
75
|
<div
|
|
77
76
|
className={`${styles['tooltip-decor']}`}
|
|
78
77
|
style={{
|
|
79
|
-
backgroundColor:
|
|
78
|
+
backgroundColor: tooltipBackgroundColor ? tooltipBackgroundColor : configStyles.TOOLTIP.tooltipBackgroundColor,
|
|
80
79
|
left: type === 'top' || type === 'bottom' ? 'calc(50% - 5px)' : type === 'right' ? '-15px' : type === 'left' ? 'calc(100% + 5px)' : '0px',
|
|
81
80
|
top: type === 'top' ? 'calc(100% + 5px)' : type === 'bottom' ? '-15px' : type === 'right' || type === 'left' ? 'calc(50% - 5px)' : '0px'
|
|
82
81
|
}}
|
|
@@ -85,7 +84,6 @@ export const Tooltip = ({
|
|
|
85
84
|
style={{
|
|
86
85
|
color: color ? color : configStyles.TOOLTIP.color,
|
|
87
86
|
fontSize: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
|
|
88
|
-
lineHeight: fontSize ? fontSize : configStyles.TOOLTIP.fontSize,
|
|
89
87
|
fontFamily: fontFamily ? fontFamily : configStyles.TOOLTIP.fontFamily
|
|
90
88
|
}}
|
|
91
89
|
>
|
|
@@ -97,24 +95,29 @@ export const Tooltip = ({
|
|
|
97
95
|
}
|
|
98
96
|
|
|
99
97
|
<div style={{cursor: 'pointer'}} onClick={handleShow}>
|
|
100
|
-
{
|
|
98
|
+
{tooltipIcon ? tooltipIcon : <img src={ReactInfoIcon} />}
|
|
101
99
|
</div>
|
|
102
100
|
</div>
|
|
103
101
|
);
|
|
104
102
|
};
|
|
105
103
|
|
|
106
104
|
Tooltip.propTypes = {
|
|
105
|
+
type: PropTypes.string,
|
|
107
106
|
width: PropTypes.string,
|
|
108
107
|
color: PropTypes.string,
|
|
109
|
-
tIcon: PropTypes.element,
|
|
110
108
|
height: PropTypes.string,
|
|
111
|
-
|
|
112
|
-
tBgColor: PropTypes.string,
|
|
109
|
+
radius: PropTypes.string,
|
|
113
110
|
fontSize: PropTypes.string,
|
|
114
111
|
className: PropTypes.string,
|
|
115
112
|
fontFamily: PropTypes.string,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
tooltipWidth: PropTypes.string,
|
|
114
|
+
tooltipIcon: PropTypes.element,
|
|
115
|
+
tooltipRadius: PropTypes.string,
|
|
119
116
|
text: PropTypes.string.isRequired,
|
|
117
|
+
backgroundColor: PropTypes.string,
|
|
118
|
+
tooltipBackgroundColor: PropTypes.string
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
Tooltip.defaultProps = {
|
|
122
|
+
type: 'top'
|
|
120
123
|
};
|
|
@@ -25,7 +25,6 @@ export const Typography = ({
|
|
|
25
25
|
margin,
|
|
26
26
|
padding,
|
|
27
27
|
variant,
|
|
28
|
-
bgColor,
|
|
29
28
|
onClick,
|
|
30
29
|
children,
|
|
31
30
|
textAlign,
|
|
@@ -37,6 +36,7 @@ export const Typography = ({
|
|
|
37
36
|
fontFamily,
|
|
38
37
|
textTransform,
|
|
39
38
|
textDecoration,
|
|
39
|
+
backgroundColor,
|
|
40
40
|
...props
|
|
41
41
|
}) => {
|
|
42
42
|
const configStyles = compereConfigs();
|
|
@@ -44,25 +44,6 @@ export const Typography = ({
|
|
|
44
44
|
|
|
45
45
|
const [isHover, setIsHover] = useState(false);
|
|
46
46
|
const [validVariant, setValidVariant] = useState(false);
|
|
47
|
-
const [style, setStyle] = useState({
|
|
48
|
-
border: border ? border : configStyles.TYPOGRAPHY.border,
|
|
49
|
-
cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
|
|
50
|
-
borderRadius: radius ? radius : configStyles.TYPOGRAPHY.radius,
|
|
51
|
-
fontSize: size ? size : configStyles.TYPOGRAPHY['size'+variant],
|
|
52
|
-
margin: margin ? margin : configStyles.TYPOGRAPHY['margin'+variant],
|
|
53
|
-
fontWeight: weight ? weight : configStyles.TYPOGRAPHY['weight'+variant],
|
|
54
|
-
padding: padding ? padding : configStyles.TYPOGRAPHY['padding'+variant],
|
|
55
|
-
textShadow: textShadow ? textShadow : configStyles.TYPOGRAPHY.textShadow,
|
|
56
|
-
textAlign: textAlign ? textAlign : configStyles.TYPOGRAPHY['textAlign'+variant],
|
|
57
|
-
backgroundColor: bgColor ? bgColor : configStyles.TYPOGRAPHY['bgColor'+variant],
|
|
58
|
-
fontStyle: fontStyle ? fontStyle : configStyles.TYPOGRAPHY['fontStyle'+variant],
|
|
59
|
-
lineHeight: lineHeight ? lineHeight : configStyles.TYPOGRAPHY['lineHeight'+variant],
|
|
60
|
-
fontFamily: fontFamily ? fontFamily : configStyles.TYPOGRAPHY['fontFamily'+variant],
|
|
61
|
-
textTransform: textTransform ? textTransform : configStyles.TYPOGRAPHY['textTransform'+variant],
|
|
62
|
-
textDecoration: textDecoration ? textDecoration : configStyles.TYPOGRAPHY['textDecoration'+variant],
|
|
63
|
-
color: isHover ? colorHover ? colorHover : configStyles.TYPOGRAPHY['colorHover'+variant] : color ? color : configStyles.TYPOGRAPHY['color'+variant],
|
|
64
|
-
|
|
65
|
-
});
|
|
66
47
|
|
|
67
48
|
useEffect(() => {
|
|
68
49
|
if (!Object.values(TypographyType).includes(variant)) {
|
|
@@ -70,17 +51,6 @@ export const Typography = ({
|
|
|
70
51
|
}
|
|
71
52
|
}, [variant]);
|
|
72
53
|
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
if (color) {
|
|
75
|
-
setStyle(prev => {
|
|
76
|
-
return {
|
|
77
|
-
...prev,
|
|
78
|
-
color: color
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
}
|
|
82
|
-
}, [color]);
|
|
83
|
-
|
|
84
54
|
const handleMouseEnter = () => {
|
|
85
55
|
setIsHover(true);
|
|
86
56
|
};
|
|
@@ -92,7 +62,24 @@ export const Typography = ({
|
|
|
92
62
|
const tagT = React.createElement(
|
|
93
63
|
variant,
|
|
94
64
|
{
|
|
95
|
-
style
|
|
65
|
+
style: {
|
|
66
|
+
border: border ? border : configStyles.TYPOGRAPHY.border,
|
|
67
|
+
cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
|
|
68
|
+
borderRadius: radius ? radius : configStyles.TYPOGRAPHY.radius,
|
|
69
|
+
fontSize: size ? size : configStyles.TYPOGRAPHY['size'+variant],
|
|
70
|
+
margin: margin ? margin : configStyles.TYPOGRAPHY['margin'+variant],
|
|
71
|
+
fontWeight: weight ? weight : configStyles.TYPOGRAPHY['weight'+variant],
|
|
72
|
+
padding: padding ? padding : configStyles.TYPOGRAPHY['padding'+variant],
|
|
73
|
+
textShadow: textShadow ? textShadow : configStyles.TYPOGRAPHY.textShadow,
|
|
74
|
+
textAlign: textAlign ? textAlign : configStyles.TYPOGRAPHY['textAlign'+variant],
|
|
75
|
+
fontStyle: fontStyle ? fontStyle : configStyles.TYPOGRAPHY['fontStyle'+variant],
|
|
76
|
+
lineHeight: lineHeight ? lineHeight : configStyles.TYPOGRAPHY['lineHeight'+variant],
|
|
77
|
+
fontFamily: fontFamily ? fontFamily : configStyles.TYPOGRAPHY['fontFamily'+variant],
|
|
78
|
+
textTransform: textTransform ? textTransform : configStyles.TYPOGRAPHY['textTransform'+variant],
|
|
79
|
+
textDecoration: textDecoration ? textDecoration : configStyles.TYPOGRAPHY['textDecoration'+variant],
|
|
80
|
+
backgroundColor: backgroundColor ? backgroundColor : configStyles.TYPOGRAPHY['backgroundColor'+variant],
|
|
81
|
+
color: isHover ? colorHover ? colorHover : configStyles.TYPOGRAPHY['colorHover'+variant] : color ? color : configStyles.TYPOGRAPHY['color'+variant],
|
|
82
|
+
},
|
|
96
83
|
...props,
|
|
97
84
|
className: classProps,
|
|
98
85
|
onClick: onClick ? onClick : _ => _,
|
|
@@ -117,7 +104,6 @@ Typography.propTypes = {
|
|
|
117
104
|
cursor: PropTypes.string,
|
|
118
105
|
margin: PropTypes.string,
|
|
119
106
|
radius: PropTypes.string,
|
|
120
|
-
bgColor: PropTypes.string,
|
|
121
107
|
padding: PropTypes.string,
|
|
122
108
|
textAlign: PropTypes.string,
|
|
123
109
|
className: PropTypes.string,
|
|
@@ -128,5 +114,10 @@ Typography.propTypes = {
|
|
|
128
114
|
colorHover: PropTypes.string,
|
|
129
115
|
textTransform: PropTypes.string,
|
|
130
116
|
textDecoration: PropTypes.string,
|
|
131
|
-
|
|
132
|
-
|
|
117
|
+
backgroundColor: PropTypes.string,
|
|
118
|
+
variant: PropTypes.oneOf(Object.values(TypographyType)),
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
Typography.defaultProps = {
|
|
122
|
+
variant: 'p'
|
|
123
|
+
};
|
|
@@ -9,7 +9,7 @@ export default {
|
|
|
9
9
|
const staticTag = ['h1','h2','h3','h4','h5','h6','span','p']
|
|
10
10
|
|
|
11
11
|
export const Template = (args) => <>
|
|
12
|
-
<Typography {...args}>Dynamic Typography</Typography>
|
|
12
|
+
<Typography {...args} >Dynamic Typography</Typography>
|
|
13
13
|
{
|
|
14
14
|
staticTag.map((tag,key) => {
|
|
15
15
|
return <Typography
|
|
@@ -159,6 +159,16 @@ TUI is fully configurable. You can change color, size, border and etc... Yes. Yo
|
|
|
159
159
|
</a>
|
|
160
160
|
</div>
|
|
161
161
|
|
|
162
|
+
<div className="link-list">
|
|
163
|
+
<a className="link-item" href="../?path=/docs/intro-usage--page">
|
|
164
|
+
<img src={Code} alt="code" />
|
|
165
|
+
<span>
|
|
166
|
+
<strong>TUI usage</strong>
|
|
167
|
+
Configure, customize, and extend
|
|
168
|
+
</span>
|
|
169
|
+
</a>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
162
172
|
<!--
|
|
163
173
|
<a className="link-item" href="https://storybook.js.org/tutorials/" target="_blank">
|
|
164
174
|
<img src={Direction} alt="direction" />
|
|
@@ -139,10 +139,10 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
139
139
|
padding: '12px 20px', // for padding
|
|
140
140
|
textTransform: 'none', // for text transform
|
|
141
141
|
boxSizing: 'border-box', // for box sizing
|
|
142
|
-
bgColor: 'rgba(0, 35, 106, 1)', // for background color
|
|
143
142
|
disabledColor: 'rgba(60, 57, 62, 1)', // for color in disabled mode
|
|
143
|
+
backgroundColor: 'rgba(0, 35, 106, 1)', // for background color
|
|
144
144
|
disabledLineColor: 'rgba(60, 57, 62, 1)', // for border color (outline) in disabled mode
|
|
145
|
-
|
|
145
|
+
disabledBackgroundColor: 'rgba(238, 238, 238, 1)', // for background color in disabled mode
|
|
146
146
|
transition: 'background-color 240ms, color 240ms', // for transition
|
|
147
147
|
},
|
|
148
148
|
```
|
|
@@ -157,7 +157,6 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
157
157
|
radius: '0px', // for input and also (if there exist left or right icons) icons block border-radius
|
|
158
158
|
className: '', // for input classname (you can set custom class for your custom css)
|
|
159
159
|
height: '46px', // for height
|
|
160
|
-
tooltip: false, // for tooltip
|
|
161
160
|
required: false, // for showing required mark on label (it meens input is required)
|
|
162
161
|
disabled: false, // for disabled
|
|
163
162
|
errorLeft: '0px', // for error message position from left (work when errorPosition prop is 'absolute')
|
|
@@ -188,6 +187,24 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
188
187
|
}
|
|
189
188
|
```
|
|
190
189
|
|
|
190
|
+
### Tooltip
|
|
191
|
+
```
|
|
192
|
+
{
|
|
193
|
+
type: 'top', // for tooltip type (top, right, bottom, left)
|
|
194
|
+
width: '46px', // for tooltip parent block width
|
|
195
|
+
radius: '0px', // for tooltip parent block border radius
|
|
196
|
+
className: '', // for tooltip className (maybe you want to add your custom class for your custom css)
|
|
197
|
+
color: 'white', // for tooltip color
|
|
198
|
+
height: '46px', // for tooltip parent block height
|
|
199
|
+
fontSize: '14px', // for tooltip font size
|
|
200
|
+
tooltipRadius: '3px', // for tooltip border radius
|
|
201
|
+
tooltipWidth: '100px', // for tooltip width
|
|
202
|
+
backgroundColor: 'transparent', // for tooltip parent block background color (maybe you want to see it)
|
|
203
|
+
fontFamily: 'Arial, sans-serif', // for tooltip font family
|
|
204
|
+
tooltipBackgroundColor: '#03a9f4' // for tooltip backgrond color
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
191
208
|
### Typography
|
|
192
209
|
|
|
193
210
|
```
|
|
@@ -260,14 +277,14 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
260
277
|
colorHoverh6: '#3C393E', // for variant h6 color in hover mode
|
|
261
278
|
colorHoverspan: '#3C393E', // for variant span color in hover mode
|
|
262
279
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
280
|
+
backgroundColorp: 'transparent', // for variant p background color
|
|
281
|
+
backgroundColorh1: 'transparent', // for variant h1 background color
|
|
282
|
+
backgroundColorh2: 'transparent', // for variant h2 background color
|
|
283
|
+
backgroundColorh3: 'transparent', // for variant h3 background color
|
|
284
|
+
backgroundColorh4: 'transparent', // for variant h4 background color
|
|
285
|
+
backgroundColorh5: 'transparent', // for variant h5 background color
|
|
286
|
+
backgroundColorh6: 'transparent', // for variant h6 background color
|
|
287
|
+
backgroundColorspan: 'transparent', // for variant span background color
|
|
271
288
|
|
|
272
289
|
textDecorationp: 'none', // for variant p text decoration
|
|
273
290
|
textDecorationh1: 'none', // for variant h1 text decoration
|
|
@@ -315,3 +332,51 @@ import StackAlt from './assets/stackalt.svg';
|
|
|
315
332
|
fontFamilyspan: 'Arial, sans-serif', // for variant span font family
|
|
316
333
|
}
|
|
317
334
|
```
|
|
335
|
+
|
|
336
|
+
### Select
|
|
337
|
+
|
|
338
|
+
```
|
|
339
|
+
{
|
|
340
|
+
labelWeight: '500', // for label font weight
|
|
341
|
+
labelColor: '#3C393E', // for label color
|
|
342
|
+
labelDisplay: 'block', // for label display
|
|
343
|
+
labelFontSize: '16px', // for label font size
|
|
344
|
+
labelLineHeight: '22px', // for label line height
|
|
345
|
+
labelMarginBottom: '6px', // for label margin bottom
|
|
346
|
+
labelTextTransform: 'none', // for label text transform
|
|
347
|
+
|
|
348
|
+
errorSize: '14px', // for error font size
|
|
349
|
+
errorColor: 'rgb(238, 0, 0)', // for error color
|
|
350
|
+
|
|
351
|
+
cursor: 'pointer', // for selected cursor
|
|
352
|
+
selectedRadius: '6px', // for selected border radius
|
|
353
|
+
selectedHeight: '46px', // for selected height
|
|
354
|
+
selectedColor: '#3C393E', // for selected color
|
|
355
|
+
selectedFontSize: '16px', // for selected font size
|
|
356
|
+
selectedFontWeight: '500', // for selected font weight
|
|
357
|
+
selectedLineHeight: '22px', // for selected line height
|
|
358
|
+
selectedPadding: '0px 15px', // for selected padding
|
|
359
|
+
selectedBorder: '2px solid', // for selected border
|
|
360
|
+
selectedHoverColor: '#373538', // for selected color ( when hover )
|
|
361
|
+
selectedBorderColor: '#D1D1D1', // for selected border color
|
|
362
|
+
selectedBoxSizing: 'border-box', // for selected box sizing
|
|
363
|
+
selectedTransition: 'border-color 240ms', // for selected transition
|
|
364
|
+
|
|
365
|
+
optionsBorderRadius: '6px', // for options block border radius
|
|
366
|
+
optionsBackgroundColor: '#FBFBFB', // for options block background color
|
|
367
|
+
optionsBoxShadow: '0 0 10px rgba(60, 57, 62, 0.08)', // for options block box shadow
|
|
368
|
+
|
|
369
|
+
optionItemColor: '#3C393E', // for option color
|
|
370
|
+
optionItemFontSize: '16px', // for option font size
|
|
371
|
+
optionItemCursor: 'pointer', // for option cursor
|
|
372
|
+
optionItemMinHeight: '46px', // for option min height
|
|
373
|
+
optionItemFontWeight: '500', // for option font weight
|
|
374
|
+
optionItemLineHeight: '22px', // for option line height
|
|
375
|
+
optionItemPadding: '0px 15px', // for option padding
|
|
376
|
+
optionItemMarginBottom: '2px', // for option margin bottom
|
|
377
|
+
optionItemColorHover: '#00236A', // for option color ( when hover )
|
|
378
|
+
optionItemBoxSizing: 'border-box', // for option box sizing
|
|
379
|
+
optionItemBackgroudColor: '#ffffff', // for option background color
|
|
380
|
+
optionItemBackgroudColorHover: 'unset', // for option background color ( when hover )
|
|
381
|
+
}
|
|
382
|
+
```
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { Meta } from '@storybook/addon-docs';
|
|
2
|
+
import Code from './assets/code-brackets.svg';
|
|
3
|
+
import Colors from './assets/colors.svg';
|
|
4
|
+
import Comments from './assets/comments.svg';
|
|
5
|
+
import Direction from './assets/direction.svg';
|
|
6
|
+
import Flow from './assets/flow.svg';
|
|
7
|
+
import Plugin from './assets/plugin.svg';
|
|
8
|
+
import Repo from './assets/repo.svg';
|
|
9
|
+
import StackAlt from './assets/stackalt.svg';
|
|
10
|
+
|
|
11
|
+
import buttonImage from './static/button-usage.png';
|
|
12
|
+
import inputTooltipImage from './static/input-tooltip-usage.png';
|
|
13
|
+
|
|
14
|
+
<Meta title="Intro/Usage" />
|
|
15
|
+
|
|
16
|
+
<style>
|
|
17
|
+
{`
|
|
18
|
+
.subheading {
|
|
19
|
+
--mediumdark: '#999999';
|
|
20
|
+
font-weight: 900;
|
|
21
|
+
font-size: 13px;
|
|
22
|
+
color: #999;
|
|
23
|
+
letter-spacing: 6px;
|
|
24
|
+
line-height: 24px;
|
|
25
|
+
text-transform: uppercase;
|
|
26
|
+
margin-bottom: 12px;
|
|
27
|
+
margin-top: 40px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.sbdocs-content {
|
|
31
|
+
max-width: 80% !important;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.link-list {
|
|
35
|
+
display: grid;
|
|
36
|
+
grid-template-columns: 1fr;
|
|
37
|
+
grid-template-rows: 1fr 1fr;
|
|
38
|
+
row-gap: 10px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (min-width: 620px) {
|
|
42
|
+
.link-list {
|
|
43
|
+
row-gap: 20px;
|
|
44
|
+
column-gap: 20px;
|
|
45
|
+
grid-template-columns: 1fr 1fr;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media all and (-ms-high-contrast:none) {
|
|
50
|
+
.link-list {
|
|
51
|
+
display: -ms-grid;
|
|
52
|
+
-ms-grid-columns: 1fr 1fr;
|
|
53
|
+
-ms-grid-rows: 1fr 1fr;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.link-item {
|
|
58
|
+
display: block;
|
|
59
|
+
padding: 20px 30px 20px 15px;
|
|
60
|
+
border: 1px solid #00000010;
|
|
61
|
+
border-radius: 5px;
|
|
62
|
+
transition: background 150ms ease-out, border 150ms ease-out, transform 150ms ease-out;
|
|
63
|
+
color: #333333;
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: flex-start;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.link-item:hover {
|
|
69
|
+
border-color: #1EA7FD50;
|
|
70
|
+
transform: translate3d(0, -3px, 0);
|
|
71
|
+
box-shadow: rgba(0, 0, 0, 0.08) 0 3px 10px 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.link-item:active {
|
|
75
|
+
border-color: #1EA7FD;
|
|
76
|
+
transform: translate3d(0, 0, 0);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.link-item strong {
|
|
80
|
+
font-weight: 700;
|
|
81
|
+
display: block;
|
|
82
|
+
margin-bottom: 2px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.link-item img {
|
|
86
|
+
height: 40px;
|
|
87
|
+
width: 40px;
|
|
88
|
+
margin-right: 15px;
|
|
89
|
+
flex: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.link-item span {
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
line-height: 20px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.tip {
|
|
98
|
+
display: inline-block;
|
|
99
|
+
border-radius: 1em;
|
|
100
|
+
font-size: 11px;
|
|
101
|
+
line-height: 12px;
|
|
102
|
+
font-weight: 700;
|
|
103
|
+
background: #E7FDD8;
|
|
104
|
+
color: #66BF3C;
|
|
105
|
+
padding: 4px 12px;
|
|
106
|
+
margin-right: 10px;
|
|
107
|
+
vertical-align: top;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.tip-wrapper {
|
|
111
|
+
font-size: 13px;
|
|
112
|
+
line-height: 20px;
|
|
113
|
+
margin-top: 40px;
|
|
114
|
+
margin-bottom: 40px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.tip-wrapper code {
|
|
118
|
+
font-size: 12px;
|
|
119
|
+
display: inline-block;
|
|
120
|
+
}
|
|
121
|
+
`}
|
|
122
|
+
</style>
|
|
123
|
+
|
|
124
|
+
# Usage
|
|
125
|
+
|
|
126
|
+
### Button
|
|
127
|
+
|
|
128
|
+
<img src={buttonImage} alt="button image" />
|
|
129
|
+
|
|
130
|
+
### Input / Tooltip
|
|
131
|
+
|
|
132
|
+
<img src={inputTooltipImage} alt="button image" />
|
package/src/utils/index.js
CHANGED
|
@@ -4,11 +4,7 @@ export const compereConfigs = () => {
|
|
|
4
4
|
let projectConfig = {};
|
|
5
5
|
let packageConfig = {};
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
packageConfig = require('../tui.config.js');
|
|
9
|
-
} catch (error) {
|
|
10
|
-
// console.log(error, 'Package: tui.config.js file is not define');
|
|
11
|
-
}
|
|
7
|
+
packageConfig = require(process.env.STORYBOOK_PATH);
|
|
12
8
|
|
|
13
9
|
try {
|
|
14
10
|
projectConfig = require('../../../../tui.config.js');
|