@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/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@xaypay/tui",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
7
7
  "scripts": {
8
8
  "test": "echo \"Error: no test specified\" && exit 1",
9
- "storybook": "start-storybook -p 6006",
10
- "build-storybook": "build-storybook",
11
- "build-lib": "rollup --config rollup.config.js",
9
+ "storybook": "STORYBOOK_PATH=../../tui.config.js start-storybook -p 6006",
10
+ "build-storybook": "STORYBOOK_PATH=../../tui.config.js build-storybook",
11
+ "build-lib": "STORYBOOK_PATH=../tui.config.js 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": "",
@@ -41,6 +41,7 @@
41
41
  "rollup-plugin-babel": "^4.4.0",
42
42
  "rollup-plugin-peer-deps-external": "^2.2.4",
43
43
  "rollup-plugin-postcss": "^4.0.2",
44
+ "rollup-plugin-svg": "^2.0.0",
44
45
  "sass": "^1.54.9",
45
46
  "sass-loader": "^13.0.2",
46
47
  "style-loader": "^3.3.1",
package/rollup.config.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // import {babel} from '@rollup/plugin-babel';
2
+ import svg from 'rollup-plugin-svg';
2
3
  import babel from 'rollup-plugin-babel';
3
4
  import resolve from '@rollup/plugin-node-resolve';
4
5
  import external from 'rollup-plugin-peer-deps-external';
@@ -28,6 +29,7 @@ export default [
28
29
  exclude: 'node_modules/**',
29
30
  presets: ['@babel/preset-react'],
30
31
  }),
32
+ svg(),
31
33
  external(),
32
34
  resolve()
33
35
  ]
@@ -0,0 +1,3 @@
1
+ <svg width="15" height="9" viewBox="0 0 15 9" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M7.9878 8.00003C7.75456 8.00049 7.52851 7.91911 7.34892 7.77003L1.3594 2.77003C1.15554 2.60029 1.02734 2.35638 1.003 2.09196C0.978666 1.82753 1.06019 1.56425 1.22963 1.36003C1.39907 1.15581 1.64255 1.02739 1.90652 1.00301C2.17048 0.978631 2.4333 1.06029 2.63716 1.23003L7.9878 5.71003L13.3384 1.39003C13.4405 1.30697 13.558 1.24493 13.6842 1.2075C13.8103 1.17007 13.9425 1.15798 14.0733 1.17192C14.2041 1.18586 14.3309 1.22555 14.4463 1.28873C14.5618 1.3519 14.6636 1.4373 14.746 1.54003C14.8374 1.64285 14.9066 1.76348 14.9493 1.89435C14.9921 2.02523 15.0073 2.16353 14.9942 2.30059C14.9811 2.43765 14.9399 2.57053 14.8731 2.69088C14.8063 2.81124 14.7155 2.91649 14.6062 3.00003L8.6167 7.83003C8.43194 7.95555 8.21051 8.0154 7.9878 8.00003Z" fill="#3C393E"/>
3
+ </svg>
@@ -0,0 +1,3 @@
1
+ <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M12.4253 0.241029L12.431 0.236144C12.6129 0.0804082 12.8468 -0.00097097 13.0861 0.00827014C13.3253 0.0175112 13.5523 0.116692 13.7216 0.285992C13.8909 0.455292 13.9901 0.682241 13.9993 0.921488C14.0085 1.16074 13.9272 1.39466 13.7714 1.57651L13.7665 1.58222L8.38622 6.96254L13.7665 12.3429L13.7714 12.3486C13.9272 12.5304 14.0085 12.7643 13.9993 13.0036C13.9901 13.2428 13.8909 13.4698 13.7216 13.6391C13.5523 13.8084 13.3253 13.9076 13.0861 13.9168C12.8468 13.926 12.6129 13.8447 12.431 13.6889L12.4253 13.684L7.04493 8.30363L1.66742 13.6738C1.58315 13.7705 1.48016 13.8492 1.36462 13.9051C1.24669 13.9622 1.11823 13.9942 0.987309 13.9993C0.85639 14.0043 0.72584 13.9823 0.603852 13.9345C0.481865 13.8867 0.371073 13.8142 0.27843 13.7216C0.185788 13.6289 0.113295 13.5181 0.0655034 13.3961C0.0177115 13.2742 -0.00434842 13.1436 0.000708381 13.0127C0.00576522 12.8818 0.0378304 12.7533 0.0948891 12.6354C0.150805 12.5198 0.229542 12.4168 0.326326 12.3325L5.70384 6.96235L0.323475 1.57461L0.318633 1.56895C0.162897 1.3871 0.0815178 1.15317 0.0907589 0.913926C0.1 0.674678 0.199181 0.447729 0.36848 0.27843C0.53778 0.10913 0.76473 0.00995005 1.00398 0.000708956C1.24322 -0.00853214 1.47715 0.0728459 1.659 0.228582L1.66476 0.233511L7.04512 5.62125L12.4253 0.241029Z" fill="#3C393E"/>
3
+ </svg>
@@ -1,23 +1,26 @@
1
1
  import React, { useEffect, useState } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import classnames from "classnames";
4
+ import { compereConfigs } from "./../../utils";
4
5
  import styles from "./autocomplate.module.css";
5
6
 
6
7
  export const Autocomplate = ({
7
- className,
8
8
  label,
9
+ value,
9
10
  required,
10
11
  disabled,
11
- jsonOptionsData,
12
- jsonSelectedOptionsData,
12
+ keyNames,
13
13
  onChange,
14
- value,
14
+ className,
15
15
  searchCount,
16
16
  placeHolder,
17
- keyNames,
18
17
  errorMesage,
18
+ autoComplete,
19
+ jsonOptionsData,
20
+ jsonSelectedOptionsData,
19
21
  ...props
20
22
  }) => {
23
+ const configStyles = compereConfigs();
21
24
  const classProps = classnames(styles.searchBox, className);
22
25
  const parseSelectedOptionsData =
23
26
  jsonSelectedOptionsData ? JSON.parse(jsonSelectedOptionsData) : { name: '', id: '' };
@@ -27,10 +30,6 @@ export const Autocomplate = ({
27
30
  const [showOptions, setShowOptions] = useState(false);
28
31
  const parseOptionsData =
29
32
  jsonOptionsData ? JSON.parse(jsonOptionsData) : [];
30
- useEffect(() => {
31
- setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name])
32
- setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id])
33
- }, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]])
34
33
 
35
34
  const handleChange = (e) => {
36
35
  const currentInputValue = e.currentTarget.value;
@@ -89,6 +88,11 @@ export const Autocomplate = ({
89
88
  }
90
89
  }
91
90
 
91
+ useEffect(() => {
92
+ setInputValue(JSON.parse(jsonSelectedOptionsData)[keyNames.name])
93
+ setInputId(JSON.parse(jsonSelectedOptionsData)[keyNames.id])
94
+ }, [JSON.parse(jsonSelectedOptionsData)[keyNames.id]])
95
+
92
96
  return (
93
97
  <>
94
98
  {label ? <label className={`${styles['autocomplate-title']} autocomplate-title-rem`}>{label} {required && <sup style={{color: "#ee0000"}}>*</sup>}</label> : ""}
@@ -96,6 +100,7 @@ export const Autocomplate = ({
96
100
  <input
97
101
  id={inputId}
98
102
  type="text"
103
+ autoComplete={autoComplete ? autoComplete : configStyles.INPUT.autoComplete}
99
104
  className={`${styles['autocomplate-content-top']} autocomplate-content-top-rem ${errorMesage ? styles.errorBorder : ''}`}
100
105
  disabled={disabled}
101
106
  onChange={handleChange}
@@ -112,21 +117,21 @@ export const Autocomplate = ({
112
117
  };
113
118
 
114
119
  Autocomplate.propTypes = {
115
- className: PropTypes.string,
116
120
  label: PropTypes.string,
117
- placeHolder: PropTypes.string,
118
- required: PropTypes.bool,
119
121
  disabled: PropTypes.bool,
120
- jsonOptionsData: PropTypes.string,
121
- jsonSelectedOptionsData: PropTypes.string,
122
+ required: PropTypes.bool,
122
123
  onChange: PropTypes.func,
123
124
  value: PropTypes.string,
124
- searchCount: PropTypes.number,
125
125
  keyNames: PropTypes.object,
126
+ className: PropTypes.string,
127
+ searchCount: PropTypes.number,
126
128
  errorMesage: PropTypes.string,
129
+ placeHolder: PropTypes.string,
130
+ autoComplete: PropTypes.string,
131
+ jsonOptionsData: PropTypes.string,
132
+ jsonSelectedOptionsData: PropTypes.string,
127
133
  };
128
134
 
129
-
130
135
  Autocomplate.defaultProps = {
131
136
  required: false,
132
- };
137
+ };
@@ -17,7 +17,6 @@ export const Button = ({
17
17
  radius,
18
18
  outline,
19
19
  padding,
20
- bgColor,
21
20
  onClick,
22
21
  disabled,
23
22
  className,
@@ -26,8 +25,9 @@ export const Button = ({
26
25
  contentWidth,
27
26
  disabledColor,
28
27
  textTransform,
29
- disabledBgColor,
28
+ backgroundColor,
30
29
  disabledLineColor,
30
+ disabledBackgroundColor,
31
31
  ...props
32
32
  }) => {
33
33
 
@@ -68,17 +68,17 @@ export const Button = ({
68
68
  cursor: disabled ? 'not-allowed' : cursor ? cursor : configStyles.BUTTON.cursor,
69
69
  textTransform: textTransform ? textTransform : configStyles.BUTTON.textTransform,
70
70
  backgroundColor:
71
- (outline || !outline) && disabled ? disabledBgColor ? disabledBgColor : configStyles.BUTTON.disabledBgColor :
72
- outline && !disabled ? isHover ? bgColor ? bgColor : configStyles.BUTTON.bgColor : '#ffffff' : bgColor ? bgColor : configStyles.BUTTON.bgColor,
71
+ (outline || !outline) && disabled ? disabledBackgroundColor ? disabledBackgroundColor : configStyles.BUTTON.disabledBackgroundColor :
72
+ outline && !disabled ? isHover ? backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor : '#ffffff' : backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor,
73
73
  boxShadow:
74
74
  outline ?
75
75
  disabled ?
76
76
  `inset 0 0 0 2px ${disabledLineColor ? disabledLineColor : configStyles.BUTTON.disabledLineColor}` :
77
- `inset 0 0 0 2px ${bgColor ? bgColor : configStyles.BUTTON.bgColor}` :
77
+ `inset 0 0 0 2px ${backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor}` :
78
78
  'none',
79
79
  color:
80
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
81
+ outline && !disabled ? isHover ? color ? color : configStyles.BUTTON.color : backgroundColor ? backgroundColor : configStyles.BUTTON.backgroundColor : color ? color : configStyles.BUTTON.color
82
82
  }}
83
83
  type={type ? type : configStyles.BUTTON.type}
84
84
  disabled={disabled ? disabled : configStyles.BUTTON.disabled}
@@ -108,14 +108,14 @@ Button.propTypes = {
108
108
  disabled: PropTypes.bool,
109
109
  radius: PropTypes.string,
110
110
  padding: PropTypes.string,
111
- bgColor: PropTypes.string,
112
111
  boxSizing: PropTypes.string,
113
112
  className: PropTypes.string,
114
113
  transition: PropTypes.string,
115
114
  contentWidth: PropTypes.bool,
116
115
  textTransform: PropTypes.string,
117
116
  disabledColor: PropTypes.string,
118
- disabledBgColor: PropTypes.string,
117
+ backgroundColor: PropTypes.string,
119
118
  label: PropTypes.string.isRequired,
120
119
  disabledLineColor: PropTypes.string,
120
+ disabledBackgroundColor: PropTypes.string
121
121
  };
@@ -62,6 +62,13 @@ export const File = ({
62
62
  document.querySelector(`.${name}`).value = "";
63
63
  };
64
64
 
65
+ useEffect(() => {
66
+ return () => {
67
+ setError('');
68
+ setImage(null);
69
+ }
70
+ }, []);
71
+
65
72
  return (
66
73
  <>
67
74
  <p className={`${styles['file-form-title']} ile-form-title-rem`}>
@@ -1,7 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
  import PropTypes from "prop-types";
3
3
  import classnames from "classnames";
4
- import { Typography } from "../typography";
5
4
  import { compereConfigs } from "./../../utils";
6
5
  import styled, { keyframes, css } from 'styled-components';
7
6
 
@@ -60,7 +59,6 @@ export const Input = ({
60
59
  }) => {
61
60
  const [show, setShow] = useState(false);
62
61
  const [isHover, setIsHover] = useState(false);
63
- const [tooltipStatus, setTooltipStatus] = useState(false);
64
62
 
65
63
  const random = Math.floor((Math.random() * 1000) + 1);
66
64
  const configStyles = compereConfigs();
@@ -68,18 +66,6 @@ export const Input = ({
68
66
  className ? className : configStyles.INPUT.className
69
67
  );
70
68
 
71
- const handleChange = (event) => {
72
- onChange ? onChange(event.target.value) : _ => _;
73
- };
74
-
75
- const handleMouseEnter = () => {
76
- setIsHover(true);
77
- };
78
-
79
- const handleMouseLeave = () => {
80
- setIsHover(false);
81
- };
82
-
83
69
  const errorShow = keyframes`
84
70
  100% {
85
71
  bottom: '-20px';
@@ -98,6 +84,18 @@ export const Input = ({
98
84
  const P = styled.p`
99
85
  animation: ${errorAnimation ? animation : 'none'};
100
86
  `;
87
+
88
+ const handleChange = (event) => {
89
+ onChange ? onChange(event.target.value) : _ => _;
90
+ };
91
+
92
+ const handleMouseEnter = () => {
93
+ setIsHover(true);
94
+ };
95
+
96
+ const handleMouseLeave = () => {
97
+ setIsHover(false);
98
+ };
101
99
 
102
100
  return (
103
101
  <div className={`${styles["input-wrap"]}`}>
@@ -120,6 +118,7 @@ export const Input = ({
120
118
  <div
121
119
  className={`${styles["input-content"]}`}
122
120
  style={{
121
+ width: width ? width : configStyles.INPUT.width,
123
122
  borderRadius: radius ? radius : configStyles.INPUT.radius,
124
123
  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
125
124
  }}
@@ -211,11 +210,8 @@ export const Input = ({
211
210
  }
212
211
  </div>
213
212
  {
214
- tooltip ? <Typography variant="p" onClick={()=> setTooltipStatus(!tooltipStatus)}>
215
-
216
- </Typography> : null
213
+ tooltip ? tooltip : ''
217
214
  }
218
- {tooltipStatus ? <p>{tooltip}</p> : null}
219
215
  {
220
216
  errorMessage ?
221
217
  <P