@xaypay/tui 0.0.54 → 0.0.55
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/.storybook/main.js +27 -20
- package/cli-command.js +3 -0
- package/dist/index.es.js +185 -45
- package/dist/index.js +186 -45
- package/package.json +7 -5
- package/src/components/button/index.js +29 -20
- package/src/components/input/index.js +134 -34
- package/src/components/input/input.module.css +17 -15
- package/src/components/typography/index.js +59 -4
- package/src/components/typography/typography.stories.js +8 -2
- package/src/stories/Introduction.stories.mdx +82 -93
- package/src/stories/changelog.stories.mdx +118 -0
- package/src/stories/configuration.stories.mdx +317 -0
- package/src/stories/documentation.stories.mdx +118 -0
- package/tui.config.js +178 -50
- package/storybook-static/favicon.ico +0 -0
package/dist/index.js
CHANGED
|
@@ -5,12 +5,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var PropTypes = require('prop-types');
|
|
7
7
|
var classnames = require('classnames');
|
|
8
|
+
var styled = require('styled-components');
|
|
8
9
|
|
|
9
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
11
|
|
|
11
12
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
13
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
13
14
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
15
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
14
16
|
|
|
15
17
|
function styleInject(css, ref) {
|
|
16
18
|
if ( ref === void 0 ) ref = {};
|
|
@@ -400,18 +402,47 @@ const Typography = ({
|
|
|
400
402
|
size,
|
|
401
403
|
color,
|
|
402
404
|
weight,
|
|
403
|
-
|
|
405
|
+
radius,
|
|
406
|
+
border,
|
|
407
|
+
cursor,
|
|
408
|
+
margin,
|
|
409
|
+
padding,
|
|
404
410
|
variant,
|
|
411
|
+
bgColor,
|
|
412
|
+
onClick,
|
|
405
413
|
children,
|
|
414
|
+
textAlign,
|
|
415
|
+
fontStyle,
|
|
406
416
|
className,
|
|
417
|
+
textShadow,
|
|
418
|
+
lineHeight,
|
|
419
|
+
colorHover,
|
|
420
|
+
fontFamily,
|
|
421
|
+
textTransform,
|
|
422
|
+
textDecoration,
|
|
407
423
|
...props
|
|
408
424
|
}) => {
|
|
409
425
|
const configStyles = compereConfigs();
|
|
410
426
|
const classProps = classnames__default["default"](className);
|
|
427
|
+
const [isHover, setIsHover] = React.useState(false);
|
|
411
428
|
const [validVariant, setValidVariant] = React.useState(false);
|
|
412
429
|
const [style, setStyle] = React.useState({
|
|
413
|
-
|
|
414
|
-
|
|
430
|
+
border: border ? border : configStyles.TYPOGRAPHY.border,
|
|
431
|
+
cursor: cursor ? cursor : configStyles.TYPOGRAPHY.cursor,
|
|
432
|
+
borderRadius: radius ? radius : configStyles.TYPOGRAPHY.radius,
|
|
433
|
+
fontSize: size ? size : configStyles.TYPOGRAPHY['size' + variant],
|
|
434
|
+
margin: margin ? margin : configStyles.TYPOGRAPHY['margin' + variant],
|
|
435
|
+
fontWeight: weight ? weight : configStyles.TYPOGRAPHY['weight' + variant],
|
|
436
|
+
padding: padding ? padding : configStyles.TYPOGRAPHY['padding' + variant],
|
|
437
|
+
textShadow: textShadow ? textShadow : configStyles.TYPOGRAPHY.textShadow,
|
|
438
|
+
textAlign: textAlign ? textAlign : configStyles.TYPOGRAPHY['textAlign' + variant],
|
|
439
|
+
backgroundColor: bgColor ? bgColor : configStyles.TYPOGRAPHY['bgColor' + variant],
|
|
440
|
+
fontStyle: fontStyle ? fontStyle : configStyles.TYPOGRAPHY['fontStyle' + variant],
|
|
441
|
+
lineHeight: lineHeight ? lineHeight : configStyles.TYPOGRAPHY['lineHeight' + variant],
|
|
442
|
+
fontFamily: fontFamily ? fontFamily : configStyles.TYPOGRAPHY['fontFamily' + variant],
|
|
443
|
+
textTransform: textTransform ? textTransform : configStyles.TYPOGRAPHY['textTransform' + variant],
|
|
444
|
+
textDecoration: textDecoration ? textDecoration : configStyles.TYPOGRAPHY['textDecoration' + variant],
|
|
445
|
+
color: isHover ? colorHover ? colorHover : configStyles.TYPOGRAPHY['colorHover' + variant] : color ? color : configStyles.TYPOGRAPHY['color' + variant]
|
|
415
446
|
});
|
|
416
447
|
React.useEffect(() => {
|
|
417
448
|
if (!Object.values(TypographyType).includes(variant)) {
|
|
@@ -428,20 +459,42 @@ const Typography = ({
|
|
|
428
459
|
});
|
|
429
460
|
}
|
|
430
461
|
}, [color]);
|
|
462
|
+
const handleMouseEnter = () => {
|
|
463
|
+
setIsHover(true);
|
|
464
|
+
};
|
|
465
|
+
const handleMouseLeave = () => {
|
|
466
|
+
setIsHover(false);
|
|
467
|
+
};
|
|
431
468
|
const tagT = /*#__PURE__*/React__default["default"].createElement(variant, {
|
|
432
469
|
style,
|
|
433
470
|
...props,
|
|
434
471
|
className: classProps,
|
|
435
|
-
onClick: onClick ? onClick : _ => _
|
|
472
|
+
onClick: onClick ? onClick : _ => _,
|
|
473
|
+
onMouseEnter: handleMouseEnter,
|
|
474
|
+
onMouseLeave: handleMouseLeave
|
|
436
475
|
}, [children]);
|
|
437
476
|
return validVariant ? 'Please set Typography valid variant' : tagT;
|
|
438
477
|
};
|
|
439
478
|
Typography.propTypes = {
|
|
440
479
|
size: PropTypes__default["default"].string,
|
|
441
480
|
color: PropTypes__default["default"].string,
|
|
442
|
-
weight: PropTypes__default["default"].string,
|
|
443
481
|
onClick: PropTypes__default["default"].func,
|
|
482
|
+
weight: PropTypes__default["default"].string,
|
|
483
|
+
border: PropTypes__default["default"].string,
|
|
484
|
+
cursor: PropTypes__default["default"].string,
|
|
485
|
+
margin: PropTypes__default["default"].string,
|
|
486
|
+
radius: PropTypes__default["default"].string,
|
|
487
|
+
bgColor: PropTypes__default["default"].string,
|
|
488
|
+
padding: PropTypes__default["default"].string,
|
|
489
|
+
textAlign: PropTypes__default["default"].string,
|
|
444
490
|
className: PropTypes__default["default"].string,
|
|
491
|
+
fontStyle: PropTypes__default["default"].string,
|
|
492
|
+
lineHeight: PropTypes__default["default"].string,
|
|
493
|
+
textShadow: PropTypes__default["default"].string,
|
|
494
|
+
fontFamily: PropTypes__default["default"].string,
|
|
495
|
+
colorHover: PropTypes__default["default"].string,
|
|
496
|
+
textTransform: PropTypes__default["default"].string,
|
|
497
|
+
textDecoration: PropTypes__default["default"].string,
|
|
445
498
|
variant: PropTypes__default["default"].oneOf(Object.values(TypographyType)).isRequired
|
|
446
499
|
};
|
|
447
500
|
|
|
@@ -515,16 +568,18 @@ Modal.propTypes = {
|
|
|
515
568
|
data: PropTypes__default["default"].array
|
|
516
569
|
};
|
|
517
570
|
|
|
518
|
-
var css_248z$7 = ".input-module_input-wrap__NunrE{width:100%}.input-module_input-content__kP7lZ{display:flex;width:100%}
|
|
519
|
-
var styles$7 = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","
|
|
571
|
+
var css_248z$7 = ".input-module_input-wrap__NunrE{position:relative;width:100%}.input-module_input-content__kP7lZ{display:flex;width:100%}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{background-color:inherit!important}.input-module_error-message-show__OrVSo{animation-fill-mode:forwards;animation-name:input-module_error-show__9MP6k}@keyframes input-module_error-show__9MP6k{to{bottom:-20px;transform:scaleX(1);-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);-o-transform:scaleX(1)}}";
|
|
572
|
+
var styles$7 = {"input-wrap":"input-module_input-wrap__NunrE","input-content":"input-module_input-content__kP7lZ","error-message-show":"input-module_error-message-show__OrVSo","error-show":"input-module_error-show__9MP6k"};
|
|
520
573
|
styleInject(css_248z$7);
|
|
521
574
|
|
|
522
575
|
const InputTypes = {
|
|
576
|
+
TEL: 'tel',
|
|
523
577
|
TEXT: "text",
|
|
524
578
|
PASSWORD: "password"
|
|
525
579
|
};
|
|
526
580
|
const Input = ({
|
|
527
581
|
type,
|
|
582
|
+
size,
|
|
528
583
|
name,
|
|
529
584
|
color,
|
|
530
585
|
label,
|
|
@@ -532,25 +587,39 @@ const Input = ({
|
|
|
532
587
|
width,
|
|
533
588
|
height,
|
|
534
589
|
radius,
|
|
535
|
-
border,
|
|
536
590
|
padding,
|
|
537
591
|
tooltip,
|
|
538
|
-
bgColor,
|
|
539
592
|
leftIcon,
|
|
540
|
-
fontSize,
|
|
541
593
|
required,
|
|
542
594
|
disabled,
|
|
543
595
|
onChange,
|
|
596
|
+
transform,
|
|
544
597
|
iconWidth,
|
|
545
598
|
rightIcon,
|
|
546
599
|
className,
|
|
547
600
|
boxSizing,
|
|
548
601
|
boxShadow,
|
|
549
|
-
|
|
550
|
-
|
|
602
|
+
errorLeft,
|
|
603
|
+
errorSize,
|
|
604
|
+
labelSize,
|
|
605
|
+
labelColor,
|
|
606
|
+
errorColor,
|
|
551
607
|
placeholder,
|
|
608
|
+
errorZindex,
|
|
609
|
+
errorBottom,
|
|
610
|
+
labelWeight,
|
|
611
|
+
errorMessage,
|
|
552
612
|
autoComplete,
|
|
613
|
+
labelDisplay,
|
|
614
|
+
errorPosition,
|
|
553
615
|
boxShadowHover,
|
|
616
|
+
errorClassName,
|
|
617
|
+
errorAnimation,
|
|
618
|
+
errorLineHeight,
|
|
619
|
+
labelLineHeight,
|
|
620
|
+
backgroundColor,
|
|
621
|
+
labelMarginBottom,
|
|
622
|
+
errorAnimationDuration,
|
|
554
623
|
...props
|
|
555
624
|
}) => {
|
|
556
625
|
const [show, setShow] = React.useState(false);
|
|
@@ -558,7 +627,7 @@ const Input = ({
|
|
|
558
627
|
const [tooltipStatus, setTooltipStatus] = React.useState(false);
|
|
559
628
|
const random = Math.floor(Math.random() * 1000 + 1);
|
|
560
629
|
const configStyles = compereConfigs();
|
|
561
|
-
const classProps = classnames__default["default"](className);
|
|
630
|
+
const classProps = classnames__default["default"](className ? className : configStyles.INPUT.className);
|
|
562
631
|
const handleChange = event => {
|
|
563
632
|
onChange ? onChange(event.target.value) : _ => _;
|
|
564
633
|
};
|
|
@@ -568,10 +637,34 @@ const Input = ({
|
|
|
568
637
|
const handleMouseLeave = () => {
|
|
569
638
|
setIsHover(false);
|
|
570
639
|
};
|
|
640
|
+
const errorShow = styled.keyframes`
|
|
641
|
+
100% {
|
|
642
|
+
bottom: '-20px';
|
|
643
|
+
transform: scale3d(1,1,1);
|
|
644
|
+
-webkit-transform: scale3d(1,1,1);
|
|
645
|
+
-moz-transform: scale3d(1,1,1);
|
|
646
|
+
-ms-transform: scale3d(1,1,1);
|
|
647
|
+
-o-transform: scale3d(1,1,1);
|
|
648
|
+
}
|
|
649
|
+
`;
|
|
650
|
+
const animation = _ => styled.css`
|
|
651
|
+
${errorShow} ${errorAnimationDuration ? errorAnimationDuration : configStyles.INPUT.errorAnimationDuration} forwards
|
|
652
|
+
`;
|
|
653
|
+
const P = styled__default["default"].p`
|
|
654
|
+
animation: ${errorAnimation ? animation : 'none'};
|
|
655
|
+
`;
|
|
571
656
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
572
657
|
className: `${styles$7["input-wrap"]}`
|
|
573
658
|
}, label ? /*#__PURE__*/React__default["default"].createElement("label", {
|
|
574
|
-
className: `${styles$7["input-title"]}
|
|
659
|
+
className: `${styles$7["input-title"]}`,
|
|
660
|
+
style: {
|
|
661
|
+
color: labelColor ? labelColor : configStyles.INPUT.labelColor,
|
|
662
|
+
fontSize: labelSize ? labelSize : configStyles.INPUT.labelSize,
|
|
663
|
+
display: labelDisplay ? labelDisplay : configStyles.INPUT.labelDisplay,
|
|
664
|
+
fontWeight: labelWeight ? labelWeight : configStyles.INPUT.labelWeight,
|
|
665
|
+
lineHeight: labelLineHeight ? labelLineHeight : configStyles.INPUT.labelLineHeight,
|
|
666
|
+
marginBottom: labelMarginBottom ? labelMarginBottom : configStyles.INPUT.labelMarginBottom
|
|
667
|
+
}
|
|
575
668
|
}, label, " ", required && /*#__PURE__*/React__default["default"].createElement("sup", {
|
|
576
669
|
style: {
|
|
577
670
|
color: "#ee0000"
|
|
@@ -580,11 +673,11 @@ const Input = ({
|
|
|
580
673
|
className: `${styles$7["input-content"]}`,
|
|
581
674
|
style: {
|
|
582
675
|
borderRadius: radius ? radius : configStyles.INPUT.radius,
|
|
583
|
-
boxShadow: isHover ? boxShadowHover ? boxShadowHover : configStyles.INPUT.boxShadowHover : boxShadow ? boxShadow : configStyles.INPUT.boxShadow
|
|
676
|
+
boxShadow: errorMessage ? errorColor ? `0 0 0 2px ${errorColor}` : `0 0 0 2px ${configStyles.INPUT.errorColor}` : isHover ? boxShadowHover ? boxShadowHover : configStyles.INPUT.boxShadowHover : boxShadow ? boxShadow : configStyles.INPUT.boxShadow
|
|
584
677
|
},
|
|
585
678
|
onMouseEnter: handleMouseEnter,
|
|
586
679
|
onMouseLeave: handleMouseLeave
|
|
587
|
-
}, leftIcon && leftIcon.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
680
|
+
}, leftIcon && leftIcon.length > 0 && type != 'tel' ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
588
681
|
onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
|
|
589
682
|
onMouseDown: type === 'password' ? _ => setShow(true) : _ => _,
|
|
590
683
|
onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
|
|
@@ -596,9 +689,21 @@ const Input = ({
|
|
|
596
689
|
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
597
690
|
borderTopLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
598
691
|
borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
599
|
-
backgroundColor: disabled ? '#FBFBFB' :
|
|
692
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
693
|
+
}
|
|
694
|
+
}, type === 'password' ? show ? leftIcon[1] : leftIcon[0] : leftIcon[0]) : '', type === 'tel' ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
695
|
+
style: {
|
|
696
|
+
pointerEvents: disabled ? 'none' : 'auto',
|
|
697
|
+
fontSize: size ? size : configStyles.INPUT.size,
|
|
698
|
+
height: height ? height : configStyles.INPUT.height,
|
|
699
|
+
padding: padding ? padding : configStyles.INPUT.padding,
|
|
700
|
+
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
701
|
+
borderTopLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
702
|
+
borderBottomLeftRadius: radius ? radius : configStyles.INPUT.radius,
|
|
703
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor,
|
|
704
|
+
color: errorMessage && errorColor ? errorColor : color ? color : configStyles.INPUT.color
|
|
600
705
|
}
|
|
601
|
-
},
|
|
706
|
+
}, "+374") : '', /*#__PURE__*/React__default["default"].createElement("input", _extends({}, props, {
|
|
602
707
|
value: value,
|
|
603
708
|
className: classProps,
|
|
604
709
|
onChange: handleChange,
|
|
@@ -612,13 +717,13 @@ const Input = ({
|
|
|
612
717
|
outline: 'none',
|
|
613
718
|
pointerEvents: disabled ? 'none' : 'auto',
|
|
614
719
|
width: width ? width : configStyles.INPUT.width,
|
|
720
|
+
fontSize: size ? size : configStyles.INPUT.size,
|
|
615
721
|
height: height ? height : configStyles.INPUT.height,
|
|
616
722
|
padding: padding ? padding : configStyles.INPUT.padding,
|
|
617
723
|
borderRadius: radius ? radius : configStyles.INPUT.radius,
|
|
618
|
-
fontSize: fontSize ? fontSize : configStyles.INPUT.fontSize,
|
|
619
724
|
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
620
|
-
|
|
621
|
-
|
|
725
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor,
|
|
726
|
+
color: errorMessage && errorColor ? errorColor : color ? color : configStyles.INPUT.color
|
|
622
727
|
}
|
|
623
728
|
})), rightIcon && rightIcon.length > 0 ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
624
729
|
onMouseUp: type === 'password' ? _ => setShow(false) : _ => _,
|
|
@@ -626,21 +731,30 @@ const Input = ({
|
|
|
626
731
|
onMouseOut: type === 'password' ? _ => setShow(false) : _ => _,
|
|
627
732
|
style: {
|
|
628
733
|
cursor: type === 'password' ? 'pointer' : 'default',
|
|
629
|
-
border: border ? border : configStyles.INPUT.border,
|
|
630
734
|
height: height ? height : configStyles.INPUT.height,
|
|
631
735
|
padding: padding ? padding : configStyles.INPUT.padding,
|
|
632
736
|
width: iconWidth ? iconWidth : configStyles.INPUT.iconWidth,
|
|
633
737
|
boxSizing: boxSizing ? boxSizing : configStyles.INPUT.boxSizing,
|
|
634
738
|
borderTopRightRadius: radius ? radius : configStyles.INPUT.radius,
|
|
635
739
|
borderBottomRightRadius: radius ? radius : configStyles.INPUT.radius,
|
|
636
|
-
backgroundColor: disabled ? '#FBFBFB' :
|
|
740
|
+
backgroundColor: disabled ? '#FBFBFB' : backgroundColor ? backgroundColor : configStyles.INPUT.backgroundColor
|
|
637
741
|
}
|
|
638
742
|
}, type === 'password' ? show ? rightIcon[1] : rightIcon[0] : rightIcon[0]) : ''), tooltip ? /*#__PURE__*/React__default["default"].createElement(Typography, {
|
|
639
743
|
variant: "p",
|
|
640
744
|
onClick: () => setTooltipStatus(!tooltipStatus)
|
|
641
|
-
}, "\u24D8") : null, tooltipStatus ? /*#__PURE__*/React__default["default"].createElement("p", null, tooltip) : null,
|
|
642
|
-
|
|
643
|
-
|
|
745
|
+
}, "\u24D8") : null, tooltipStatus ? /*#__PURE__*/React__default["default"].createElement("p", null, tooltip) : null, errorMessage ? /*#__PURE__*/React__default["default"].createElement(P, {
|
|
746
|
+
style: {
|
|
747
|
+
left: errorLeft ? errorLeft : configStyles.INPUT.errorLeft,
|
|
748
|
+
color: errorColor ? errorColor : configStyles.INPUT.errorColor,
|
|
749
|
+
fontSize: errorSize ? errorSize : configStyles.INPUT.errorSize,
|
|
750
|
+
bottom: errorBottom ? errorBottom : configStyles.INPUT.errorBottom,
|
|
751
|
+
zIndex: errorZindex ? errorZindex : configStyles.INPUT.errorZindex,
|
|
752
|
+
position: errorPosition ? errorPosition : configStyles.INPUT.errorPosition,
|
|
753
|
+
lineHeight: errorLineHeight ? errorLineHeight : configStyles.INPUT.errorLineHeight,
|
|
754
|
+
transform: !errorAnimation ? 'scale3d(1,1,1)' : transform ? transform : configStyles.INPUT.transform
|
|
755
|
+
},
|
|
756
|
+
className: errorClassName ? errorClassName : configStyles.INPUT.errorClassName
|
|
757
|
+
}, errorMessage) : '');
|
|
644
758
|
};
|
|
645
759
|
Input.propTypes = {
|
|
646
760
|
name: PropTypes__default["default"].string,
|
|
@@ -653,17 +767,35 @@ Input.propTypes = {
|
|
|
653
767
|
disabled: PropTypes__default["default"].bool,
|
|
654
768
|
height: PropTypes__default["default"].string,
|
|
655
769
|
radius: PropTypes__default["default"].string,
|
|
656
|
-
|
|
770
|
+
padding: PropTypes__default["default"].string,
|
|
657
771
|
fontSize: PropTypes__default["default"].string,
|
|
658
772
|
tooltip: PropTypes__default["default"].element,
|
|
773
|
+
transform: PropTypes__default["default"].string,
|
|
659
774
|
className: PropTypes__default["default"].string,
|
|
660
775
|
iconWidth: PropTypes__default["default"].string,
|
|
661
776
|
boxSizing: PropTypes__default["default"].string,
|
|
662
777
|
boxShadow: PropTypes__default["default"].string,
|
|
778
|
+
errorSize: PropTypes__default["default"].string,
|
|
779
|
+
errorLeft: PropTypes__default["default"].string,
|
|
780
|
+
labelSize: PropTypes__default["default"].string,
|
|
781
|
+
errorColor: PropTypes__default["default"].string,
|
|
782
|
+
labelColor: PropTypes__default["default"].string,
|
|
663
783
|
placeholder: PropTypes__default["default"].string,
|
|
664
|
-
|
|
784
|
+
errorZindex: PropTypes__default["default"].string,
|
|
785
|
+
errorBottom: PropTypes__default["default"].string,
|
|
786
|
+
labelWeight: PropTypes__default["default"].string,
|
|
787
|
+
errorMessage: PropTypes__default["default"].string,
|
|
665
788
|
autoComplete: PropTypes__default["default"].string,
|
|
789
|
+
errorAnimation: PropTypes__default["default"].bool,
|
|
790
|
+
labelDisplay: PropTypes__default["default"].string,
|
|
791
|
+
errorPosition: PropTypes__default["default"].string,
|
|
666
792
|
boxShadowHover: PropTypes__default["default"].string,
|
|
793
|
+
errorClassName: PropTypes__default["default"].string,
|
|
794
|
+
backgroundColor: PropTypes__default["default"].string,
|
|
795
|
+
errorLineHeight: PropTypes__default["default"].string,
|
|
796
|
+
labelLineHeight: PropTypes__default["default"].string,
|
|
797
|
+
labelMarginBottom: PropTypes__default["default"].string,
|
|
798
|
+
errorAnimationDuration: PropTypes__default["default"].string,
|
|
667
799
|
leftIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
|
|
668
800
|
rightIcon: PropTypes__default["default"].arrayOf(PropTypes__default["default"].element),
|
|
669
801
|
type: PropTypes__default["default"].oneOf(Object.values(InputTypes))
|
|
@@ -727,27 +859,30 @@ Radio.defaultProps = {
|
|
|
727
859
|
};
|
|
728
860
|
|
|
729
861
|
const Button = ({
|
|
862
|
+
size,
|
|
730
863
|
type,
|
|
864
|
+
font,
|
|
731
865
|
color,
|
|
732
866
|
label,
|
|
733
867
|
width,
|
|
734
868
|
height,
|
|
735
869
|
cursor,
|
|
870
|
+
weight,
|
|
736
871
|
border,
|
|
872
|
+
radius,
|
|
737
873
|
outline,
|
|
738
874
|
padding,
|
|
875
|
+
bgColor,
|
|
739
876
|
onClick,
|
|
740
|
-
fontSize,
|
|
741
877
|
disabled,
|
|
742
878
|
className,
|
|
743
879
|
boxSizing,
|
|
744
880
|
transition,
|
|
745
881
|
contentWidth,
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
disabledThemeLineColor,
|
|
882
|
+
disabledColor,
|
|
883
|
+
textTransform,
|
|
884
|
+
disabledBgColor,
|
|
885
|
+
disabledLineColor,
|
|
751
886
|
...props
|
|
752
887
|
}) => {
|
|
753
888
|
const [isHover, setIsHover] = React.useState(false);
|
|
@@ -766,18 +901,21 @@ const Button = ({
|
|
|
766
901
|
};
|
|
767
902
|
return /*#__PURE__*/React__default["default"].createElement("button", _extends({
|
|
768
903
|
style: {
|
|
904
|
+
fontSize: size ? size : configStyles.BUTTON.size,
|
|
905
|
+
fontFamily: font ? font : configStyles.BUTTON.font,
|
|
769
906
|
height: height ? height : configStyles.BUTTON.height,
|
|
907
|
+
fontWeight: weight ? weight : configStyles.BUTTON.weight,
|
|
770
908
|
padding: padding ? padding : configStyles.BUTTON.padding,
|
|
771
|
-
|
|
909
|
+
borderRadius: radius ? radius : configStyles.BUTTON.radius,
|
|
772
910
|
boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
|
|
773
911
|
transition: transition ? transition : configStyles.BUTTON.transition,
|
|
774
912
|
border: outline ? 'none' : border ? border : configStyles.BUTTON.border,
|
|
775
913
|
width: contentWidth ? 'auto' : width ? width : configStyles.BUTTON.width,
|
|
776
|
-
borderRadius: borderRadius ? borderRadius : configStyles.BUTTON.borderRadius,
|
|
777
914
|
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.BUTTON.cursor,
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
915
|
+
textTransform: textTransform ? textTransform : configStyles.BUTTON.textTransform,
|
|
916
|
+
backgroundColor: (outline || !outline) && disabled ? disabledBgColor ? disabledBgColor : configStyles.BUTTON.disabledBgColor : outline && !disabled ? isHover ? bgColor ? bgColor : configStyles.BUTTON.bgColor : '#ffffff' : bgColor ? bgColor : configStyles.BUTTON.bgColor,
|
|
917
|
+
boxShadow: outline ? disabled ? `inset 0 0 0 2px ${disabledLineColor ? disabledLineColor : configStyles.BUTTON.disabledLineColor}` : `inset 0 0 0 2px ${bgColor ? bgColor : configStyles.BUTTON.bgColor}` : 'none',
|
|
918
|
+
color: (outline || !outline) && disabled ? disabledColor ? disabledColor : configStyles.BUTTON.disabledColor : outline && !disabled ? isHover ? color ? color : configStyles.BUTTON.color : bgColor ? bgColor : configStyles.BUTTON.bgColor : color ? color : configStyles.BUTTON.color
|
|
781
919
|
},
|
|
782
920
|
type: type ? type : configStyles.BUTTON.type,
|
|
783
921
|
disabled: disabled ? disabled : configStyles.BUTTON.disabled,
|
|
@@ -789,26 +927,29 @@ const Button = ({
|
|
|
789
927
|
};
|
|
790
928
|
Button.propTypes = {
|
|
791
929
|
type: PropTypes__default["default"].string,
|
|
930
|
+
size: PropTypes__default["default"].string,
|
|
931
|
+
font: PropTypes__default["default"].string,
|
|
792
932
|
color: PropTypes__default["default"].string,
|
|
793
933
|
width: PropTypes__default["default"].string,
|
|
794
934
|
outline: PropTypes__default["default"].bool,
|
|
795
935
|
onClick: PropTypes__default["default"].func,
|
|
936
|
+
weight: PropTypes__default["default"].string,
|
|
796
937
|
height: PropTypes__default["default"].string,
|
|
797
938
|
cursor: PropTypes__default["default"].string,
|
|
798
939
|
border: PropTypes__default["default"].string,
|
|
799
940
|
disabled: PropTypes__default["default"].bool,
|
|
941
|
+
radius: PropTypes__default["default"].string,
|
|
800
942
|
padding: PropTypes__default["default"].string,
|
|
801
|
-
|
|
943
|
+
bgColor: PropTypes__default["default"].string,
|
|
802
944
|
boxSizing: PropTypes__default["default"].string,
|
|
803
945
|
className: PropTypes__default["default"].string,
|
|
804
946
|
transition: PropTypes__default["default"].string,
|
|
805
947
|
contentWidth: PropTypes__default["default"].bool,
|
|
806
|
-
|
|
807
|
-
|
|
948
|
+
textTransform: PropTypes__default["default"].string,
|
|
949
|
+
disabledColor: PropTypes__default["default"].string,
|
|
950
|
+
disabledBgColor: PropTypes__default["default"].string,
|
|
808
951
|
label: PropTypes__default["default"].string.isRequired,
|
|
809
|
-
|
|
810
|
-
disabledThemeBgColor: PropTypes__default["default"].string,
|
|
811
|
-
disabledThemeLineColor: PropTypes__default["default"].string
|
|
952
|
+
disabledLineColor: PropTypes__default["default"].string
|
|
812
953
|
};
|
|
813
954
|
|
|
814
955
|
var css_248z$5 = ".select-module_select-title__c8bR7{color:#3c393e;display:block;font-size:16px;font-weight:500;line-height:22px;margin-bottom:6px;text-transform:none}.select-module_select-content__GCMDX{display:flex;flex-direction:column;position:relative}.select-module_select-content-top__Aw-fB{border:2px solid #d1d1d1;border-radius:6px;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;flex-direction:row;font-size:16px;font-weight:500;height:46px;line-height:22px;max-width:400px;padding:0 15px;transition:border-color .24s}.select-module_select-content-top__Aw-fB.select-module_active__v2Dce{border-color:#00236a}.select-module_select-content-top__Aw-fB:hover{border-color:#3c393e}.select-module_select-content-bottom__ueZCR{animation:select-module_select-show__391hQ .64s linear forwards;background:#fbfbfb;border-radius:6px;box-shadow:0 0 10px rgba(60,57,62,.08);left:0;max-height:0;max-width:400px;overflow:hidden;position:absolute;top:52px;width:100%;z-index:1}.select-module_select-content-bottom-inner__NWy2X{display:flex;flex-direction:column;max-height:234px;overflow-x:hidden;overflow-y:auto}@keyframes select-module_select-show__391hQ{to{max-height:400px}}.select-module_select-content-top-text__euajq{align-items:center;display:flex;flex:1;flex-direction:row;flex-wrap:nowrap}.select-module_select-content-top-icon__MBrGK{align-items:center;box-sizing:border-box;display:flex;flex:0 0 auto;padding:0 5px 0 20px}.select-module_select-content-top-icon__MBrGK>i{color:#3c393e;font-size:12px!important}.select-module_select-content-top-icon__MBrGK>i:not(:last-child){align-items:center;border-right:1px solid #eee;display:flex;height:22px;margin-right:8px;padding:0 8px}.select-module_select-content-bottom-row__eKq5L{align-items:center;background:#fff;box-sizing:border-box;color:#3c393e;cursor:pointer;display:flex;font-size:16px;font-weight:500;line-height:22px;margin-bottom:2px;min-height:46px;padding:0 15px;transition:background .24s,color .24s}.select-module_select-content-bottom-row__eKq5L:last-child{margin-bottom:0}.select-module_select-content-bottom-row__eKq5L:hover{background:unset;color:#00236a}.select-module_error-message__-ac6X{border:2px solid #e00!important}.select-module_eMessage__Mm-F7{color:#e00}";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xaypay/tui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.55",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es.js",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
9
|
"storybook": "start-storybook -p 6006",
|
|
10
10
|
"build-storybook": "build-storybook",
|
|
11
|
-
"build-lib": "rollup
|
|
11
|
+
"build-lib": "rollup --config rollup.config.js",
|
|
12
12
|
"svgr": "svgr --icon --title-prop --replace-attr-values '#1D1D1D=currentColor' -d src/components/icon -- src/assets"
|
|
13
13
|
},
|
|
14
14
|
"author": "",
|
|
@@ -21,8 +21,9 @@
|
|
|
21
21
|
"@storybook/addon-essentials": "^6.5.10",
|
|
22
22
|
"@storybook/addon-interactions": "^6.5.10",
|
|
23
23
|
"@storybook/addon-links": "^6.5.10",
|
|
24
|
-
"@storybook/builder-
|
|
25
|
-
"@storybook/manager-
|
|
24
|
+
"@storybook/builder-webpack5": "^6.5.16",
|
|
25
|
+
"@storybook/manager-webpack5": "^6.5.16",
|
|
26
|
+
"@storybook/preset-create-react-app": "^4.1.2",
|
|
26
27
|
"@storybook/preset-scss": "^1.0.3",
|
|
27
28
|
"@storybook/react": "^6.5.10",
|
|
28
29
|
"@storybook/testing-library": "^0.0.13",
|
|
@@ -57,5 +58,6 @@
|
|
|
57
58
|
"dependencies": {
|
|
58
59
|
"lodash": "^4.17.21",
|
|
59
60
|
"react-icons": "^4.7.1"
|
|
60
|
-
}
|
|
61
|
+
},
|
|
62
|
+
"bin": "./cli-command.js"
|
|
61
63
|
}
|
|
@@ -4,27 +4,30 @@ import classnames from 'classnames';
|
|
|
4
4
|
import { compereConfigs } from './../../utils';
|
|
5
5
|
|
|
6
6
|
export const Button = ({
|
|
7
|
+
size,
|
|
7
8
|
type,
|
|
9
|
+
font,
|
|
8
10
|
color,
|
|
9
11
|
label,
|
|
10
12
|
width,
|
|
11
13
|
height,
|
|
12
14
|
cursor,
|
|
15
|
+
weight,
|
|
13
16
|
border,
|
|
17
|
+
radius,
|
|
14
18
|
outline,
|
|
15
19
|
padding,
|
|
20
|
+
bgColor,
|
|
16
21
|
onClick,
|
|
17
|
-
fontSize,
|
|
18
22
|
disabled,
|
|
19
23
|
className,
|
|
20
24
|
boxSizing,
|
|
21
25
|
transition,
|
|
22
26
|
contentWidth,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
disabledThemeLineColor,
|
|
27
|
+
disabledColor,
|
|
28
|
+
textTransform,
|
|
29
|
+
disabledBgColor,
|
|
30
|
+
disabledLineColor,
|
|
28
31
|
...props
|
|
29
32
|
}) => {
|
|
30
33
|
|
|
@@ -52,27 +55,30 @@ export const Button = ({
|
|
|
52
55
|
return (
|
|
53
56
|
<button
|
|
54
57
|
style={{
|
|
58
|
+
fontSize: size ? size : configStyles.BUTTON.size,
|
|
59
|
+
fontFamily: font ? font : configStyles.BUTTON.font,
|
|
55
60
|
height: height ? height : configStyles.BUTTON.height,
|
|
61
|
+
fontWeight: weight ? weight : configStyles.BUTTON.weight,
|
|
56
62
|
padding: padding ? padding : configStyles.BUTTON.padding,
|
|
57
|
-
|
|
63
|
+
borderRadius: radius ? radius : configStyles.BUTTON.radius,
|
|
58
64
|
boxSizing: boxSizing ? boxSizing : configStyles.BUTTON.boxSizing,
|
|
59
65
|
transition: transition ? transition : configStyles.BUTTON.transition,
|
|
60
66
|
border: outline ? 'none' : border ? border : configStyles.BUTTON.border,
|
|
61
67
|
width: contentWidth ? 'auto' : width ? width : configStyles.BUTTON.width,
|
|
62
|
-
borderRadius: borderRadius ? borderRadius : configStyles.BUTTON.borderRadius,
|
|
63
68
|
cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.BUTTON.cursor,
|
|
69
|
+
textTransform: textTransform ? textTransform : configStyles.BUTTON.textTransform,
|
|
64
70
|
backgroundColor:
|
|
65
|
-
(outline || !outline) && disabled ?
|
|
66
|
-
outline && !disabled ? isHover ?
|
|
71
|
+
(outline || !outline) && disabled ? disabledBgColor ? disabledBgColor : configStyles.BUTTON.disabledBgColor :
|
|
72
|
+
outline && !disabled ? isHover ? bgColor ? bgColor : configStyles.BUTTON.bgColor : '#ffffff' : bgColor ? bgColor : configStyles.BUTTON.bgColor,
|
|
67
73
|
boxShadow:
|
|
68
74
|
outline ?
|
|
69
75
|
disabled ?
|
|
70
|
-
`inset 0 0 0 2px ${
|
|
71
|
-
`inset 0 0 0 2px ${
|
|
76
|
+
`inset 0 0 0 2px ${disabledLineColor ? disabledLineColor : configStyles.BUTTON.disabledLineColor}` :
|
|
77
|
+
`inset 0 0 0 2px ${bgColor ? bgColor : configStyles.BUTTON.bgColor}` :
|
|
72
78
|
'none',
|
|
73
79
|
color:
|
|
74
|
-
(outline || !outline) && disabled ?
|
|
75
|
-
outline && !disabled ? isHover ? color ? color : configStyles.BUTTON.color :
|
|
80
|
+
(outline || !outline) && disabled ? disabledColor ? disabledColor : configStyles.BUTTON.disabledColor :
|
|
81
|
+
outline && !disabled ? isHover ? color ? color : configStyles.BUTTON.color : bgColor ? bgColor : configStyles.BUTTON.bgColor : color ? color : configStyles.BUTTON.color
|
|
76
82
|
}}
|
|
77
83
|
type={type ? type : configStyles.BUTTON.type}
|
|
78
84
|
disabled={disabled ? disabled : configStyles.BUTTON.disabled}
|
|
@@ -89,24 +95,27 @@ export const Button = ({
|
|
|
89
95
|
|
|
90
96
|
Button.propTypes = {
|
|
91
97
|
type: PropTypes.string,
|
|
98
|
+
size: PropTypes.string,
|
|
99
|
+
font: PropTypes.string,
|
|
92
100
|
color: PropTypes.string,
|
|
93
101
|
width: PropTypes.string,
|
|
94
102
|
outline: PropTypes.bool,
|
|
95
103
|
onClick: PropTypes.func,
|
|
104
|
+
weight: PropTypes.string,
|
|
96
105
|
height: PropTypes.string,
|
|
97
106
|
cursor: PropTypes.string,
|
|
98
107
|
border: PropTypes.string,
|
|
99
108
|
disabled: PropTypes.bool,
|
|
109
|
+
radius: PropTypes.string,
|
|
100
110
|
padding: PropTypes.string,
|
|
101
|
-
|
|
111
|
+
bgColor: PropTypes.string,
|
|
102
112
|
boxSizing: PropTypes.string,
|
|
103
113
|
className: PropTypes.string,
|
|
104
114
|
transition: PropTypes.string,
|
|
105
115
|
contentWidth: PropTypes.bool,
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
textTransform: PropTypes.string,
|
|
117
|
+
disabledColor: PropTypes.string,
|
|
118
|
+
disabledBgColor: PropTypes.string,
|
|
108
119
|
label: PropTypes.string.isRequired,
|
|
109
|
-
|
|
110
|
-
disabledThemeBgColor: PropTypes.string,
|
|
111
|
-
disabledThemeLineColor: PropTypes.string,
|
|
120
|
+
disabledLineColor: PropTypes.string,
|
|
112
121
|
};
|