@ak2021/react-ui 0.0.1-beta.1
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/LICENSE +21 -0
- package/dist/index.js +60 -0
- package/dist/index.mjs +55 -0
- package/dist/index.umd.js +155 -0
- package/dist/types/index.d.ts +18 -0
- package/package.json +34 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Shine Shao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @ak2021/react-ui v0.1.0
|
|
3
|
+
* Copyright (c) 2025-12-23 undefined
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
'use strict';
|
|
7
|
+
|
|
8
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
|
+
|
|
10
|
+
var cls = require('classnames');
|
|
11
|
+
|
|
12
|
+
function styleInject(css, ref) {
|
|
13
|
+
if ( ref === void 0 ) ref = {};
|
|
14
|
+
var insertAt = ref.insertAt;
|
|
15
|
+
|
|
16
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
17
|
+
|
|
18
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
19
|
+
var style = document.createElement('style');
|
|
20
|
+
style.type = 'text/css';
|
|
21
|
+
|
|
22
|
+
if (insertAt === 'top') {
|
|
23
|
+
if (head.firstChild) {
|
|
24
|
+
head.insertBefore(style, head.firstChild);
|
|
25
|
+
} else {
|
|
26
|
+
head.appendChild(style);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
head.appendChild(style);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (style.styleSheet) {
|
|
33
|
+
style.styleSheet.cssText = css;
|
|
34
|
+
} else {
|
|
35
|
+
style.appendChild(document.createTextNode(css));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var css_248z$1 = "a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,p,pre,q,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;margin:0;outline:0;padding:0}body,div,fieldset,form,h1,h2,h3,h4,h5,h6,html,p{-webkit-text-size-adjust:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{clear:both;display:block}html{font-family:Microsoft YaHei,Helvetica Neue,Helvetica,STHeiTi,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:62.5%}body{background:#f9f9f9;font-size:1.4rem;min-width:320px;overflow-x:hidden}a,body{color:#1a1a1a}a{background:transparent;text-decoration:none;-webkit-tap-highlight-color:transparent}a:active{color:#3990e6;outline:0}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto;white-space:pre;white-space:pre-wrap;word-wrap:break-word}code,kbd,pre,samp{font-family:monospace;font-size:1rem}mark{background:#ff0;color:#1a1a1a}dfn{font-style:italic}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}ol,ul{list-style:none outside none}h1,h2,h3,strong{font-weight:600}img{border:0;vertical-align:middle;-ms-interpolation-mode:bicubic}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}button,input,select,textarea{font-family:Microsoft YaHei,Helvetica Neue,Helvetica,STHeiTi,Arial,sans-serif}input::-moz-placeholder,textarea::-moz-placeholder{color:#ccc}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#ccc}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#ccc}";
|
|
40
|
+
styleInject(css_248z$1);
|
|
41
|
+
|
|
42
|
+
var css_248z = ".wc-btn{background-image:none;background:#fff;border:1px solid #d9d9d9;border-radius:2px;box-shadow:0 2px rgba(0,0,0,.016);color:rgba(0,0,0,.851);cursor:pointer;display:inline-block;font-size:14px;font-weight:400;height:32px;line-height:1.5715;padding:4px 15px;position:relative;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.wc-btn:hover{background-color:#1890ff}.wc-btn-primary,.wc-btn:hover{border-color:#1890ff;color:#fff}.wc-btn-primary{background:#1890ff;box-shadow:0 2px rgba(0,0,0,.043);text-shadow:0 -1px 0 rgba(0,0,0,.12)}";
|
|
43
|
+
styleInject(css_248z);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
*/ var Button = function(props) {
|
|
47
|
+
var _obj;
|
|
48
|
+
var classNames = cls('wc-btn', (_obj = {}, _obj["wc-btn-" + props.type] = props.type === 'primary', _obj), props.className);
|
|
49
|
+
return /*#__PURE__*/ React.createElement("button", {
|
|
50
|
+
className: classNames,
|
|
51
|
+
style: props.style
|
|
52
|
+
}, props.children);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
var index = {
|
|
56
|
+
Button: Button
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports.Button = Button;
|
|
60
|
+
exports.default = index;
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @ak2021/react-ui v0.1.0
|
|
3
|
+
* Copyright (c) 2025-12-23 undefined
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
import cls from 'classnames';
|
|
7
|
+
|
|
8
|
+
function styleInject(css, ref) {
|
|
9
|
+
if ( ref === void 0 ) ref = {};
|
|
10
|
+
var insertAt = ref.insertAt;
|
|
11
|
+
|
|
12
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
13
|
+
|
|
14
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
15
|
+
var style = document.createElement('style');
|
|
16
|
+
style.type = 'text/css';
|
|
17
|
+
|
|
18
|
+
if (insertAt === 'top') {
|
|
19
|
+
if (head.firstChild) {
|
|
20
|
+
head.insertBefore(style, head.firstChild);
|
|
21
|
+
} else {
|
|
22
|
+
head.appendChild(style);
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
head.appendChild(style);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (style.styleSheet) {
|
|
29
|
+
style.styleSheet.cssText = css;
|
|
30
|
+
} else {
|
|
31
|
+
style.appendChild(document.createTextNode(css));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var css_248z$1 = "a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,p,pre,q,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;margin:0;outline:0;padding:0}body,div,fieldset,form,h1,h2,h3,h4,h5,h6,html,p{-webkit-text-size-adjust:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{clear:both;display:block}html{font-family:Microsoft YaHei,Helvetica Neue,Helvetica,STHeiTi,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:62.5%}body{background:#f9f9f9;font-size:1.4rem;min-width:320px;overflow-x:hidden}a,body{color:#1a1a1a}a{background:transparent;text-decoration:none;-webkit-tap-highlight-color:transparent}a:active{color:#3990e6;outline:0}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto;white-space:pre;white-space:pre-wrap;word-wrap:break-word}code,kbd,pre,samp{font-family:monospace;font-size:1rem}mark{background:#ff0;color:#1a1a1a}dfn{font-style:italic}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}ol,ul{list-style:none outside none}h1,h2,h3,strong{font-weight:600}img{border:0;vertical-align:middle;-ms-interpolation-mode:bicubic}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}button,input,select,textarea{font-family:Microsoft YaHei,Helvetica Neue,Helvetica,STHeiTi,Arial,sans-serif}input::-moz-placeholder,textarea::-moz-placeholder{color:#ccc}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#ccc}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#ccc}";
|
|
36
|
+
styleInject(css_248z$1);
|
|
37
|
+
|
|
38
|
+
var css_248z = ".wc-btn{background-image:none;background:#fff;border:1px solid #d9d9d9;border-radius:2px;box-shadow:0 2px rgba(0,0,0,.016);color:rgba(0,0,0,.851);cursor:pointer;display:inline-block;font-size:14px;font-weight:400;height:32px;line-height:1.5715;padding:4px 15px;position:relative;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.wc-btn:hover{background-color:#1890ff}.wc-btn-primary,.wc-btn:hover{border-color:#1890ff;color:#fff}.wc-btn-primary{background:#1890ff;box-shadow:0 2px rgba(0,0,0,.043);text-shadow:0 -1px 0 rgba(0,0,0,.12)}";
|
|
39
|
+
styleInject(css_248z);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
*/ var Button = function(props) {
|
|
43
|
+
var _obj;
|
|
44
|
+
var classNames = cls('wc-btn', (_obj = {}, _obj["wc-btn-" + props.type] = props.type === 'primary', _obj), props.className);
|
|
45
|
+
return /*#__PURE__*/ React.createElement("button", {
|
|
46
|
+
className: classNames,
|
|
47
|
+
style: props.style
|
|
48
|
+
}, props.children);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
var index = {
|
|
52
|
+
Button: Button
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { Button, index as default };
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @ak2021/react-ui v0.1.0
|
|
3
|
+
* Copyright (c) 2025-12-23 undefined
|
|
4
|
+
* Released under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
(function (global, factory) {
|
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
8
|
+
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
9
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactUi = {}));
|
|
10
|
+
})(this, (function (exports) { 'use strict';
|
|
11
|
+
|
|
12
|
+
function styleInject(css, ref) {
|
|
13
|
+
if ( ref === void 0 ) ref = {};
|
|
14
|
+
var insertAt = ref.insertAt;
|
|
15
|
+
|
|
16
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
17
|
+
|
|
18
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
19
|
+
var style = document.createElement('style');
|
|
20
|
+
style.type = 'text/css';
|
|
21
|
+
|
|
22
|
+
if (insertAt === 'top') {
|
|
23
|
+
if (head.firstChild) {
|
|
24
|
+
head.insertBefore(style, head.firstChild);
|
|
25
|
+
} else {
|
|
26
|
+
head.appendChild(style);
|
|
27
|
+
}
|
|
28
|
+
} else {
|
|
29
|
+
head.appendChild(style);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (style.styleSheet) {
|
|
33
|
+
style.styleSheet.cssText = css;
|
|
34
|
+
} else {
|
|
35
|
+
style.appendChild(document.createTextNode(css));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
var css_248z$1 = "a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,p,pre,q,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;margin:0;outline:0;padding:0}body,div,fieldset,form,h1,h2,h3,h4,h5,h6,html,p{-webkit-text-size-adjust:none}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{clear:both;display:block}html{font-family:Microsoft YaHei,Helvetica Neue,Helvetica,STHeiTi,Arial,sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;font-size:62.5%}body{background:#f9f9f9;font-size:1.4rem;min-width:320px;overflow-x:hidden}a,body{color:#1a1a1a}a{background:transparent;text-decoration:none;-webkit-tap-highlight-color:transparent}a:active{color:#3990e6;outline:0}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre{overflow:auto;white-space:pre;white-space:pre-wrap;word-wrap:break-word}code,kbd,pre,samp{font-family:monospace;font-size:1rem}mark{background:#ff0;color:#1a1a1a}dfn{font-style:italic}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}ol,ul{list-style:none outside none}h1,h2,h3,strong{font-weight:600}img{border:0;vertical-align:middle;-ms-interpolation-mode:bicubic}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:border-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}button,input,select,textarea{font-family:Microsoft YaHei,Helvetica Neue,Helvetica,STHeiTi,Arial,sans-serif}input::-moz-placeholder,textarea::-moz-placeholder{color:#ccc}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#ccc}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#ccc}";
|
|
40
|
+
styleInject(css_248z$1);
|
|
41
|
+
|
|
42
|
+
var css_248z = ".wc-btn{background-image:none;background:#fff;border:1px solid #d9d9d9;border-radius:2px;box-shadow:0 2px rgba(0,0,0,.016);color:rgba(0,0,0,.851);cursor:pointer;display:inline-block;font-size:14px;font-weight:400;height:32px;line-height:1.5715;padding:4px 15px;position:relative;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.wc-btn:hover{background-color:#1890ff}.wc-btn-primary,.wc-btn:hover{border-color:#1890ff;color:#fff}.wc-btn-primary{background:#1890ff;box-shadow:0 2px rgba(0,0,0,.043);text-shadow:0 -1px 0 rgba(0,0,0,.12)}";
|
|
43
|
+
styleInject(css_248z);
|
|
44
|
+
|
|
45
|
+
function getDefaultExportFromCjs (x) {
|
|
46
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
var classnames = {exports: {}};
|
|
50
|
+
|
|
51
|
+
/*!
|
|
52
|
+
Copyright (c) 2018 Jed Watson.
|
|
53
|
+
Licensed under the MIT License (MIT), see
|
|
54
|
+
http://jedwatson.github.io/classnames
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
var hasRequiredClassnames;
|
|
58
|
+
|
|
59
|
+
function requireClassnames () {
|
|
60
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
61
|
+
hasRequiredClassnames = 1;
|
|
62
|
+
(function (module) {
|
|
63
|
+
/* global define */
|
|
64
|
+
|
|
65
|
+
(function () {
|
|
66
|
+
|
|
67
|
+
var hasOwn = {}.hasOwnProperty;
|
|
68
|
+
|
|
69
|
+
function classNames () {
|
|
70
|
+
var classes = '';
|
|
71
|
+
|
|
72
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
73
|
+
var arg = arguments[i];
|
|
74
|
+
if (arg) {
|
|
75
|
+
classes = appendClass(classes, parseValue(arg));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return classes;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function parseValue (arg) {
|
|
83
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
84
|
+
return arg;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (typeof arg !== 'object') {
|
|
88
|
+
return '';
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (Array.isArray(arg)) {
|
|
92
|
+
return classNames.apply(null, arg);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
96
|
+
return arg.toString();
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
var classes = '';
|
|
100
|
+
|
|
101
|
+
for (var key in arg) {
|
|
102
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
103
|
+
classes = appendClass(classes, key);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return classes;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function appendClass (value, newClass) {
|
|
111
|
+
if (!newClass) {
|
|
112
|
+
return value;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (value) {
|
|
116
|
+
return value + ' ' + newClass;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return value + newClass;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (module.exports) {
|
|
123
|
+
classNames.default = classNames;
|
|
124
|
+
module.exports = classNames;
|
|
125
|
+
} else {
|
|
126
|
+
window.classNames = classNames;
|
|
127
|
+
}
|
|
128
|
+
}());
|
|
129
|
+
} (classnames));
|
|
130
|
+
return classnames.exports;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
var classnamesExports = requireClassnames();
|
|
134
|
+
var cls = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
*/ var Button = function(props) {
|
|
138
|
+
var _obj;
|
|
139
|
+
var classNames = cls('wc-btn', (_obj = {}, _obj["wc-btn-" + props.type] = props.type === 'primary', _obj), props.className);
|
|
140
|
+
return /*#__PURE__*/ React.createElement("button", {
|
|
141
|
+
className: classNames,
|
|
142
|
+
style: props.style
|
|
143
|
+
}, props.children);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
var index = {
|
|
147
|
+
Button: Button
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
exports.Button = Button;
|
|
151
|
+
exports.default = index;
|
|
152
|
+
|
|
153
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
154
|
+
|
|
155
|
+
}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
interface IButtonProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
type?: 'primary';
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
*/
|
|
12
|
+
declare const Button: (props: IButtonProps) => react_jsx_runtime.JSX.Element;
|
|
13
|
+
|
|
14
|
+
declare const _default: {
|
|
15
|
+
Button: (props: IButtonProps) => react_jsx_runtime.JSX.Element;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { Button, _default as default };
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ak2021/react-ui",
|
|
3
|
+
"version": "0.0.1-beta.1",
|
|
4
|
+
"main": "dist/index.js",
|
|
5
|
+
"module": "dist/index.mjs",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"dev": "cross-env NODE_ENV=development rollup --config rollup.config.mjs --watch",
|
|
10
|
+
"build": "npm run clean && cross-env NODE_ENV=production rollup --config rollup.config.mjs",
|
|
11
|
+
"clean": "rimraf dist"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist",
|
|
15
|
+
"!dist/**/*.map"
|
|
16
|
+
],
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@config/rollup": "workspace:*",
|
|
19
|
+
"@types/react": "^18.3.11",
|
|
20
|
+
"@types/react-dom": "^18.3.0",
|
|
21
|
+
"react": "^18.3.1",
|
|
22
|
+
"react-dom": "^18.3.1"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"classnames": "^2.5.1"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"react": ">=17"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"gitHead": "00456e7dd27d022975d5b8a39bfb8815a73401fe"
|
|
34
|
+
}
|