@xaypay/tui 0.0.2 → 0.0.3
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 +51 -6
- package/dist/index.js +53 -5
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
import 'react';
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import 'classnames';
|
|
3
|
+
import classnames from 'classnames';
|
|
4
|
+
|
|
5
|
+
function _extends() {
|
|
6
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
7
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
8
|
+
var source = arguments[i];
|
|
9
|
+
|
|
10
|
+
for (var key in source) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
12
|
+
target[key] = source[key];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
return _extends.apply(this, arguments);
|
|
20
|
+
}
|
|
4
21
|
|
|
5
22
|
function styleInject(css, ref) {
|
|
6
23
|
if ( ref === void 0 ) ref = {};
|
|
@@ -30,6 +47,7 @@ function styleInject(css, ref) {
|
|
|
30
47
|
}
|
|
31
48
|
|
|
32
49
|
var css_248z = ".button-module_btn__ffRtT{color:green}";
|
|
50
|
+
var styles = {"btn":"button-module_btn__ffRtT"};
|
|
33
51
|
styleInject(css_248z);
|
|
34
52
|
|
|
35
53
|
/**
|
|
@@ -55,8 +73,29 @@ const ButtonSize = {
|
|
|
55
73
|
MEDIUM: 'medium',
|
|
56
74
|
LARGE: 'large'
|
|
57
75
|
};
|
|
58
|
-
|
|
59
|
-
|
|
76
|
+
const Button = ({
|
|
77
|
+
primary,
|
|
78
|
+
backgroundColor,
|
|
79
|
+
theme,
|
|
80
|
+
size,
|
|
81
|
+
className,
|
|
82
|
+
disabled,
|
|
83
|
+
label,
|
|
84
|
+
...props
|
|
85
|
+
}) => {
|
|
86
|
+
console.log(styles);
|
|
87
|
+
const classProps = classnames(styles.btn, styles[theme], styles[size], 'test', {
|
|
88
|
+
[styles.disabled]: disabled
|
|
89
|
+
}, className);
|
|
90
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
91
|
+
type: "button",
|
|
92
|
+
className: classProps,
|
|
93
|
+
style: backgroundColor && {
|
|
94
|
+
backgroundColor
|
|
95
|
+
}
|
|
96
|
+
}, props), label);
|
|
97
|
+
};
|
|
98
|
+
Button.propTypes = {
|
|
60
99
|
type: PropTypes.oneOf(Object.values(ButtonType)),
|
|
61
100
|
theme: PropTypes.oneOf(Object.values(ButtonTheme)),
|
|
62
101
|
size: PropTypes.oneOf(Object.values(ButtonSize)),
|
|
@@ -86,6 +125,12 @@ const ButtonSize = {
|
|
|
86
125
|
*/
|
|
87
126
|
disabled: PropTypes.bool,
|
|
88
127
|
className: PropTypes.string
|
|
89
|
-
}
|
|
128
|
+
};
|
|
129
|
+
Button.defaultProps = {
|
|
130
|
+
backgroundColor: null,
|
|
131
|
+
primary: false,
|
|
132
|
+
size: 'medium',
|
|
133
|
+
onClick: undefined
|
|
134
|
+
};
|
|
90
135
|
|
|
91
|
-
export { ButtonSize, ButtonTheme, ButtonType };
|
|
136
|
+
export { Button, ButtonSize, ButtonTheme, ButtonType };
|
package/dist/index.js
CHANGED
|
@@ -2,13 +2,32 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('react');
|
|
5
|
+
var React = require('react');
|
|
6
6
|
var PropTypes = require('prop-types');
|
|
7
|
-
require('classnames');
|
|
7
|
+
var classnames = require('classnames');
|
|
8
8
|
|
|
9
9
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
10
|
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
11
12
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
13
|
+
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
14
|
+
|
|
15
|
+
function _extends() {
|
|
16
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
17
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
18
|
+
var source = arguments[i];
|
|
19
|
+
|
|
20
|
+
for (var key in source) {
|
|
21
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
22
|
+
target[key] = source[key];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
29
|
+
return _extends.apply(this, arguments);
|
|
30
|
+
}
|
|
12
31
|
|
|
13
32
|
function styleInject(css, ref) {
|
|
14
33
|
if ( ref === void 0 ) ref = {};
|
|
@@ -38,6 +57,7 @@ function styleInject(css, ref) {
|
|
|
38
57
|
}
|
|
39
58
|
|
|
40
59
|
var css_248z = ".button-module_btn__ffRtT{color:green}";
|
|
60
|
+
var styles = {"btn":"button-module_btn__ffRtT"};
|
|
41
61
|
styleInject(css_248z);
|
|
42
62
|
|
|
43
63
|
/**
|
|
@@ -63,8 +83,29 @@ const ButtonSize = {
|
|
|
63
83
|
MEDIUM: 'medium',
|
|
64
84
|
LARGE: 'large'
|
|
65
85
|
};
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
const Button = ({
|
|
87
|
+
primary,
|
|
88
|
+
backgroundColor,
|
|
89
|
+
theme,
|
|
90
|
+
size,
|
|
91
|
+
className,
|
|
92
|
+
disabled,
|
|
93
|
+
label,
|
|
94
|
+
...props
|
|
95
|
+
}) => {
|
|
96
|
+
console.log(styles);
|
|
97
|
+
const classProps = classnames__default["default"](styles.btn, styles[theme], styles[size], 'test', {
|
|
98
|
+
[styles.disabled]: disabled
|
|
99
|
+
}, className);
|
|
100
|
+
return /*#__PURE__*/React__default["default"].createElement("button", _extends({
|
|
101
|
+
type: "button",
|
|
102
|
+
className: classProps,
|
|
103
|
+
style: backgroundColor && {
|
|
104
|
+
backgroundColor
|
|
105
|
+
}
|
|
106
|
+
}, props), label);
|
|
107
|
+
};
|
|
108
|
+
Button.propTypes = {
|
|
68
109
|
type: PropTypes__default["default"].oneOf(Object.values(ButtonType)),
|
|
69
110
|
theme: PropTypes__default["default"].oneOf(Object.values(ButtonTheme)),
|
|
70
111
|
size: PropTypes__default["default"].oneOf(Object.values(ButtonSize)),
|
|
@@ -94,8 +135,15 @@ const ButtonSize = {
|
|
|
94
135
|
*/
|
|
95
136
|
disabled: PropTypes__default["default"].bool,
|
|
96
137
|
className: PropTypes__default["default"].string
|
|
97
|
-
}
|
|
138
|
+
};
|
|
139
|
+
Button.defaultProps = {
|
|
140
|
+
backgroundColor: null,
|
|
141
|
+
primary: false,
|
|
142
|
+
size: 'medium',
|
|
143
|
+
onClick: undefined
|
|
144
|
+
};
|
|
98
145
|
|
|
146
|
+
exports.Button = Button;
|
|
99
147
|
exports.ButtonSize = ButtonSize;
|
|
100
148
|
exports.ButtonTheme = ButtonTheme;
|
|
101
149
|
exports.ButtonType = ButtonType;
|