nn-ui 1.0.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/README.md +54 -0
- package/dist/lingma-ui.css +1 -0
- package/dist/lingma-ui.es.js +297 -0
- package/dist/lingma-ui.umd.js +23 -0
- package/dist/vite.svg +1 -0
- package/package.json +32 -0
- package/src/components/Button/index.tsx +24 -0
- package/src/components/Button/style.css +27 -0
- package/src/components/index.ts +3 -0
package/README.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# React + TypeScript + Vite
|
2
|
+
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
4
|
+
|
5
|
+
Currently, two official plugins are available:
|
6
|
+
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) for Fast Refresh
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
9
|
+
|
10
|
+
## Expanding the ESLint configuration
|
11
|
+
|
12
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
13
|
+
|
14
|
+
```js
|
15
|
+
export default tseslint.config({
|
16
|
+
extends: [
|
17
|
+
// Remove ...tseslint.configs.recommended and replace with this
|
18
|
+
...tseslint.configs.recommendedTypeChecked,
|
19
|
+
// Alternatively, use this for stricter rules
|
20
|
+
...tseslint.configs.strictTypeChecked,
|
21
|
+
// Optionally, add this for stylistic rules
|
22
|
+
...tseslint.configs.stylisticTypeChecked,
|
23
|
+
],
|
24
|
+
languageOptions: {
|
25
|
+
// other options...
|
26
|
+
parserOptions: {
|
27
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
28
|
+
tsconfigRootDir: import.meta.dirname,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
})
|
32
|
+
```
|
33
|
+
|
34
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
35
|
+
|
36
|
+
```js
|
37
|
+
// eslint.config.js
|
38
|
+
import reactX from 'eslint-plugin-react-x'
|
39
|
+
import reactDom from 'eslint-plugin-react-dom'
|
40
|
+
|
41
|
+
export default tseslint.config({
|
42
|
+
plugins: {
|
43
|
+
// Add the react-x and react-dom plugins
|
44
|
+
'react-x': reactX,
|
45
|
+
'react-dom': reactDom,
|
46
|
+
},
|
47
|
+
rules: {
|
48
|
+
// other rules...
|
49
|
+
// Enable its recommended typescript rules
|
50
|
+
...reactX.configs['recommended-typescript'].rules,
|
51
|
+
...reactDom.configs.recommended.rules,
|
52
|
+
},
|
53
|
+
})
|
54
|
+
```
|
@@ -0,0 +1 @@
|
|
1
|
+
.btn{padding:8px 16px;border-radius:4px;cursor:pointer;transition:all .2s}.primary{background:#1677ff;color:#fff;border:none}.primary:hover{background:#4096ff}.default{background:#fff;color:#333;border:1px solid #d9d9d9}.default:hover{border-color:#1677ff;color:#1677ff}
|
@@ -0,0 +1,297 @@
|
|
1
|
+
import ee from "react";
|
2
|
+
var T = { exports: {} }, b = {};
|
3
|
+
/**
|
4
|
+
* @license React
|
5
|
+
* react-jsx-runtime.production.js
|
6
|
+
*
|
7
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
8
|
+
*
|
9
|
+
* This source code is licensed under the MIT license found in the
|
10
|
+
* LICENSE file in the root directory of this source tree.
|
11
|
+
*/
|
12
|
+
var I;
|
13
|
+
function re() {
|
14
|
+
if (I) return b;
|
15
|
+
I = 1;
|
16
|
+
var a = Symbol.for("react.transitional.element"), f = Symbol.for("react.fragment");
|
17
|
+
function i(m, s, u) {
|
18
|
+
var E = null;
|
19
|
+
if (u !== void 0 && (E = "" + u), s.key !== void 0 && (E = "" + s.key), "key" in s) {
|
20
|
+
u = {};
|
21
|
+
for (var R in s)
|
22
|
+
R !== "key" && (u[R] = s[R]);
|
23
|
+
} else u = s;
|
24
|
+
return s = u.ref, {
|
25
|
+
$$typeof: a,
|
26
|
+
type: m,
|
27
|
+
key: E,
|
28
|
+
ref: s !== void 0 ? s : null,
|
29
|
+
props: u
|
30
|
+
};
|
31
|
+
}
|
32
|
+
return b.Fragment = f, b.jsx = i, b.jsxs = i, b;
|
33
|
+
}
|
34
|
+
var _ = {};
|
35
|
+
/**
|
36
|
+
* @license React
|
37
|
+
* react-jsx-runtime.development.js
|
38
|
+
*
|
39
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
40
|
+
*
|
41
|
+
* This source code is licensed under the MIT license found in the
|
42
|
+
* LICENSE file in the root directory of this source tree.
|
43
|
+
*/
|
44
|
+
var F;
|
45
|
+
function te() {
|
46
|
+
return F || (F = 1, process.env.NODE_ENV !== "production" && function() {
|
47
|
+
function a(e) {
|
48
|
+
if (e == null) return null;
|
49
|
+
if (typeof e == "function")
|
50
|
+
return e.$$typeof === Z ? null : e.displayName || e.name || null;
|
51
|
+
if (typeof e == "string") return e;
|
52
|
+
switch (e) {
|
53
|
+
case k:
|
54
|
+
return "Fragment";
|
55
|
+
case q:
|
56
|
+
return "Profiler";
|
57
|
+
case U:
|
58
|
+
return "StrictMode";
|
59
|
+
case G:
|
60
|
+
return "Suspense";
|
61
|
+
case X:
|
62
|
+
return "SuspenseList";
|
63
|
+
case H:
|
64
|
+
return "Activity";
|
65
|
+
}
|
66
|
+
if (typeof e == "object")
|
67
|
+
switch (typeof e.tag == "number" && console.error(
|
68
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
69
|
+
), e.$$typeof) {
|
70
|
+
case W:
|
71
|
+
return "Portal";
|
72
|
+
case z:
|
73
|
+
return (e.displayName || "Context") + ".Provider";
|
74
|
+
case J:
|
75
|
+
return (e._context.displayName || "Context") + ".Consumer";
|
76
|
+
case V:
|
77
|
+
var r = e.render;
|
78
|
+
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
79
|
+
case B:
|
80
|
+
return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
|
81
|
+
case h:
|
82
|
+
r = e._payload, e = e._init;
|
83
|
+
try {
|
84
|
+
return a(e(r));
|
85
|
+
} catch {
|
86
|
+
}
|
87
|
+
}
|
88
|
+
return null;
|
89
|
+
}
|
90
|
+
function f(e) {
|
91
|
+
return "" + e;
|
92
|
+
}
|
93
|
+
function i(e) {
|
94
|
+
try {
|
95
|
+
f(e);
|
96
|
+
var r = !1;
|
97
|
+
} catch {
|
98
|
+
r = !0;
|
99
|
+
}
|
100
|
+
if (r) {
|
101
|
+
r = console;
|
102
|
+
var t = r.error, n = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
103
|
+
return t.call(
|
104
|
+
r,
|
105
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
106
|
+
n
|
107
|
+
), f(e);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
function m(e) {
|
111
|
+
if (e === k) return "<>";
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === h)
|
113
|
+
return "<...>";
|
114
|
+
try {
|
115
|
+
var r = a(e);
|
116
|
+
return r ? "<" + r + ">" : "<...>";
|
117
|
+
} catch {
|
118
|
+
return "<...>";
|
119
|
+
}
|
120
|
+
}
|
121
|
+
function s() {
|
122
|
+
var e = p.A;
|
123
|
+
return e === null ? null : e.getOwner();
|
124
|
+
}
|
125
|
+
function u() {
|
126
|
+
return Error("react-stack-top-frame");
|
127
|
+
}
|
128
|
+
function E(e) {
|
129
|
+
if (g.call(e, "key")) {
|
130
|
+
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
131
|
+
if (r && r.isReactWarning) return !1;
|
132
|
+
}
|
133
|
+
return e.key !== void 0;
|
134
|
+
}
|
135
|
+
function R(e, r) {
|
136
|
+
function t() {
|
137
|
+
y || (y = !0, console.error(
|
138
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
139
|
+
r
|
140
|
+
));
|
141
|
+
}
|
142
|
+
t.isReactWarning = !0, Object.defineProperty(e, "key", {
|
143
|
+
get: t,
|
144
|
+
configurable: !0
|
145
|
+
});
|
146
|
+
}
|
147
|
+
function L() {
|
148
|
+
var e = a(this.type);
|
149
|
+
return N[e] || (N[e] = !0, console.error(
|
150
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
151
|
+
)), e = this.props.ref, e !== void 0 ? e : null;
|
152
|
+
}
|
153
|
+
function M(e, r, t, n, l, c, A, P) {
|
154
|
+
return t = c.ref, e = {
|
155
|
+
$$typeof: x,
|
156
|
+
type: e,
|
157
|
+
key: r,
|
158
|
+
props: c,
|
159
|
+
_owner: l
|
160
|
+
}, (t !== void 0 ? t : null) !== null ? Object.defineProperty(e, "ref", {
|
161
|
+
enumerable: !1,
|
162
|
+
get: L
|
163
|
+
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
164
|
+
configurable: !1,
|
165
|
+
enumerable: !1,
|
166
|
+
writable: !0,
|
167
|
+
value: 0
|
168
|
+
}), Object.defineProperty(e, "_debugInfo", {
|
169
|
+
configurable: !1,
|
170
|
+
enumerable: !1,
|
171
|
+
writable: !0,
|
172
|
+
value: null
|
173
|
+
}), Object.defineProperty(e, "_debugStack", {
|
174
|
+
configurable: !1,
|
175
|
+
enumerable: !1,
|
176
|
+
writable: !0,
|
177
|
+
value: A
|
178
|
+
}), Object.defineProperty(e, "_debugTask", {
|
179
|
+
configurable: !1,
|
180
|
+
enumerable: !1,
|
181
|
+
writable: !0,
|
182
|
+
value: P
|
183
|
+
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
184
|
+
}
|
185
|
+
function j(e, r, t, n, l, c, A, P) {
|
186
|
+
var o = r.children;
|
187
|
+
if (o !== void 0)
|
188
|
+
if (n)
|
189
|
+
if (Q(o)) {
|
190
|
+
for (n = 0; n < o.length; n++)
|
191
|
+
w(o[n]);
|
192
|
+
Object.freeze && Object.freeze(o);
|
193
|
+
} else
|
194
|
+
console.error(
|
195
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
196
|
+
);
|
197
|
+
else w(o);
|
198
|
+
if (g.call(r, "key")) {
|
199
|
+
o = a(e);
|
200
|
+
var d = Object.keys(r).filter(function(K) {
|
201
|
+
return K !== "key";
|
202
|
+
});
|
203
|
+
n = 0 < d.length ? "{key: someKey, " + d.join(": ..., ") + ": ...}" : "{key: someKey}", $[o + n] || (d = 0 < d.length ? "{" + d.join(": ..., ") + ": ...}" : "{}", console.error(
|
204
|
+
`A props object containing a "key" prop is being spread into JSX:
|
205
|
+
let props = %s;
|
206
|
+
<%s {...props} />
|
207
|
+
React keys must be passed directly to JSX without using spread:
|
208
|
+
let props = %s;
|
209
|
+
<%s key={someKey} {...props} />`,
|
210
|
+
n,
|
211
|
+
o,
|
212
|
+
d,
|
213
|
+
o
|
214
|
+
), $[o + n] = !0);
|
215
|
+
}
|
216
|
+
if (o = null, t !== void 0 && (i(t), o = "" + t), E(r) && (i(r.key), o = "" + r.key), "key" in r) {
|
217
|
+
t = {};
|
218
|
+
for (var S in r)
|
219
|
+
S !== "key" && (t[S] = r[S]);
|
220
|
+
} else t = r;
|
221
|
+
return o && R(
|
222
|
+
t,
|
223
|
+
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
224
|
+
), M(
|
225
|
+
e,
|
226
|
+
o,
|
227
|
+
c,
|
228
|
+
l,
|
229
|
+
s(),
|
230
|
+
t,
|
231
|
+
A,
|
232
|
+
P
|
233
|
+
);
|
234
|
+
}
|
235
|
+
function w(e) {
|
236
|
+
typeof e == "object" && e !== null && e.$$typeof === x && e._store && (e._store.validated = 1);
|
237
|
+
}
|
238
|
+
var v = ee, x = Symbol.for("react.transitional.element"), W = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), U = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), J = Symbol.for("react.consumer"), z = Symbol.for("react.context"), V = Symbol.for("react.forward_ref"), G = Symbol.for("react.suspense"), X = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), H = Symbol.for("react.activity"), Z = Symbol.for("react.client.reference"), p = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, g = Object.prototype.hasOwnProperty, Q = Array.isArray, O = console.createTask ? console.createTask : function() {
|
239
|
+
return null;
|
240
|
+
};
|
241
|
+
v = {
|
242
|
+
"react-stack-bottom-frame": function(e) {
|
243
|
+
return e();
|
244
|
+
}
|
245
|
+
};
|
246
|
+
var y, N = {}, C = v["react-stack-bottom-frame"].bind(
|
247
|
+
v,
|
248
|
+
u
|
249
|
+
)(), Y = O(m(u)), $ = {};
|
250
|
+
_.Fragment = k, _.jsx = function(e, r, t, n, l) {
|
251
|
+
var c = 1e4 > p.recentlyCreatedOwnerStacks++;
|
252
|
+
return j(
|
253
|
+
e,
|
254
|
+
r,
|
255
|
+
t,
|
256
|
+
!1,
|
257
|
+
n,
|
258
|
+
l,
|
259
|
+
c ? Error("react-stack-top-frame") : C,
|
260
|
+
c ? O(m(e)) : Y
|
261
|
+
);
|
262
|
+
}, _.jsxs = function(e, r, t, n, l) {
|
263
|
+
var c = 1e4 > p.recentlyCreatedOwnerStacks++;
|
264
|
+
return j(
|
265
|
+
e,
|
266
|
+
r,
|
267
|
+
t,
|
268
|
+
!0,
|
269
|
+
n,
|
270
|
+
l,
|
271
|
+
c ? Error("react-stack-top-frame") : C,
|
272
|
+
c ? O(m(e)) : Y
|
273
|
+
);
|
274
|
+
};
|
275
|
+
}()), _;
|
276
|
+
}
|
277
|
+
var D;
|
278
|
+
function ne() {
|
279
|
+
return D || (D = 1, process.env.NODE_ENV === "production" ? T.exports = re() : T.exports = te()), T.exports;
|
280
|
+
}
|
281
|
+
var oe = ne();
|
282
|
+
const se = (a) => {
|
283
|
+
const { type: f = "default", ...i } = a;
|
284
|
+
return /* @__PURE__ */ oe.jsx(
|
285
|
+
"button",
|
286
|
+
{
|
287
|
+
className: `btn ${f} ${a.className || ""}`,
|
288
|
+
style: a.style,
|
289
|
+
onClick: a.onClick,
|
290
|
+
...i,
|
291
|
+
children: a.children
|
292
|
+
}
|
293
|
+
);
|
294
|
+
};
|
295
|
+
export {
|
296
|
+
se as Button
|
297
|
+
};
|
@@ -0,0 +1,23 @@
|
|
1
|
+
(function(i,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(i=typeof globalThis<"u"?globalThis:i||self,b(i.LingmaUI={},i.React))})(this,function(i,b){"use strict";var P=document.createElement("style");P.textContent=`.btn{padding:8px 16px;border-radius:4px;cursor:pointer;transition:all .2s}.primary{background:#1677ff;color:#fff;border:none}.primary:hover{background:#4096ff}.default{background:#fff;color:#333;border:1px solid #d9d9d9}.default:hover{border-color:#1677ff;color:#1677ff}
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(P);var T={exports:{}},E={};/**
|
3
|
+
* @license React
|
4
|
+
* react-jsx-runtime.production.js
|
5
|
+
*
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
7
|
+
*
|
8
|
+
* This source code is licensed under the MIT license found in the
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
10
|
+
*/var g;function W(){if(g)return E;g=1;var a=Symbol.for("react.transitional.element"),d=Symbol.for("react.fragment");function f(_,s,u){var v=null;if(u!==void 0&&(v=""+u),s.key!==void 0&&(v=""+s.key),"key"in s){u={};for(var p in s)p!=="key"&&(u[p]=s[p])}else u=s;return s=u.ref,{$$typeof:a,type:_,key:v,ref:s!==void 0?s:null,props:u}}return E.Fragment=d,E.jsx=f,E.jsxs=f,E}var R={};/**
|
11
|
+
* @license React
|
12
|
+
* react-jsx-runtime.development.js
|
13
|
+
*
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
15
|
+
*
|
16
|
+
* This source code is licensed under the MIT license found in the
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
18
|
+
*/var j;function q(){return j||(j=1,process.env.NODE_ENV!=="production"&&function(){function a(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case Z:return"Profiler";case H:return"StrictMode";case re:return"Suspense";case te:return"SuspenseList";case oe:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case B:return"Portal";case K:return(e.displayName||"Context")+".Provider";case Q:return(e._context.displayName||"Context")+".Consumer";case ee:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return r=e.displayName||null,r!==null?r:a(e.type)||"Memo";case $:r=e._payload,e=e._init;try{return a(e(r))}catch{}}return null}function d(e){return""+e}function f(e){try{d(e);var r=!1}catch{r=!0}if(r){r=console;var t=r.error,n=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),d(e)}}function _(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===$)return"<...>";try{var r=a(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function s(){var e=x.A;return e===null?null:e.getOwner()}function u(){return Error("react-stack-top-frame")}function v(e){if(I.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function p(e,r){function t(){F||(F=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",r))}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}function G(){var e=a(this.type);return D[e]||(D[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function X(e,r,t,n,l,c,y,S){return t=c.ref,e={$$typeof:Y,type:e,key:r,props:c,_owner:l},(t!==void 0?t:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:G}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:y}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:S}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function N(e,r,t,n,l,c,y,S){var o=r.children;if(o!==void 0)if(n)if(se(o)){for(n=0;n<o.length;n++)C(o[n]);Object.freeze&&Object.freeze(o)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(o);if(I.call(r,"key")){o=a(e);var m=Object.keys(r).filter(function(ue){return ue!=="key"});n=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",U[o+n]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
19
|
+
let props = %s;
|
20
|
+
<%s {...props} />
|
21
|
+
React keys must be passed directly to JSX without using spread:
|
22
|
+
let props = %s;
|
23
|
+
<%s key={someKey} {...props} />`,n,o,m,o),U[o+n]=!0)}if(o=null,t!==void 0&&(f(t),o=""+t),v(r)&&(f(r.key),o=""+r.key),"key"in r){t={};for(var A in r)A!=="key"&&(t[A]=r[A])}else t=r;return o&&p(t,typeof e=="function"?e.displayName||e.name||"Unknown":e),X(e,o,c,l,s(),t,y,S)}function C(e){typeof e=="object"&&e!==null&&e.$$typeof===Y&&e._store&&(e._store.validated=1)}var k=b,Y=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),Z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),K=Symbol.for("react.context"),ee=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),oe=Symbol.for("react.activity"),ae=Symbol.for("react.client.reference"),x=k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=Object.prototype.hasOwnProperty,se=Array.isArray,h=console.createTask?console.createTask:function(){return null};k={"react-stack-bottom-frame":function(e){return e()}};var F,D={},L=k["react-stack-bottom-frame"].bind(k,u)(),M=h(_(u)),U={};R.Fragment=O,R.jsx=function(e,r,t,n,l){var c=1e4>x.recentlyCreatedOwnerStacks++;return N(e,r,t,!1,n,l,c?Error("react-stack-top-frame"):L,c?h(_(e)):M)},R.jsxs=function(e,r,t,n,l){var c=1e4>x.recentlyCreatedOwnerStacks++;return N(e,r,t,!0,n,l,c?Error("react-stack-top-frame"):L,c?h(_(e)):M)}}()),R}var w;function J(){return w||(w=1,process.env.NODE_ENV==="production"?T.exports=W():T.exports=q()),T.exports}var z=J();const V=a=>{const{type:d="default",...f}=a;return z.jsx("button",{className:`btn ${d} ${a.className||""}`,style:a.style,onClick:a.onClick,...f,children:a.children})};i.Button=V,Object.defineProperty(i,Symbol.toStringTag,{value:"Module"})});
|
package/dist/vite.svg
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
{
|
2
|
+
"name": "nn-ui",
|
3
|
+
"version": "1.0.1",
|
4
|
+
"type": "module",
|
5
|
+
"main": "./dist/lingma-ui.umd.js",
|
6
|
+
"module": "./dist/lingma-ui.es.js",
|
7
|
+
"types": "./dist/index.d.ts",
|
8
|
+
"files": ["dist", "src/components"],
|
9
|
+
"scripts": {
|
10
|
+
"dev": "vite",
|
11
|
+
"build": "tsc -b && vite build",
|
12
|
+
"lint": "eslint .",
|
13
|
+
"preview": "vite preview"
|
14
|
+
},
|
15
|
+
"dependencies": {
|
16
|
+
"react": "^19.1.0",
|
17
|
+
"react-dom": "^19.1.0"
|
18
|
+
},
|
19
|
+
"devDependencies": {
|
20
|
+
"@eslint/js": "^9.25.0",
|
21
|
+
"@types/react": "^19.1.2",
|
22
|
+
"@types/react-dom": "^19.1.2",
|
23
|
+
"@vitejs/plugin-react": "^4.4.1",
|
24
|
+
"eslint": "^9.25.0",
|
25
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
26
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
27
|
+
"globals": "^16.0.0",
|
28
|
+
"typescript": "~5.8.3",
|
29
|
+
"typescript-eslint": "^8.30.1",
|
30
|
+
"vite": "^6.3.5"
|
31
|
+
}
|
32
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import type { CSSProperties, MouseEventHandler, ReactNode } from 'react';
|
2
|
+
import './style.css';
|
3
|
+
|
4
|
+
interface ButtonProps {
|
5
|
+
children?: ReactNode;
|
6
|
+
className?: string;
|
7
|
+
style?: CSSProperties;
|
8
|
+
onClick?: MouseEventHandler<HTMLButtonElement>;
|
9
|
+
type?: 'primary' | 'default';
|
10
|
+
}
|
11
|
+
export const Button = (props: ButtonProps) => {
|
12
|
+
const { type = 'default', ...restProps } = props;
|
13
|
+
|
14
|
+
return (
|
15
|
+
<button
|
16
|
+
className={`btn ${type} ${props.className || ''}`}
|
17
|
+
style={props.style}
|
18
|
+
onClick={props.onClick}
|
19
|
+
{...restProps}
|
20
|
+
>
|
21
|
+
{props.children}
|
22
|
+
</button>
|
23
|
+
);
|
24
|
+
};
|
@@ -0,0 +1,27 @@
|
|
1
|
+
.btn {
|
2
|
+
padding: 8px 16px;
|
3
|
+
border-radius: 4px;
|
4
|
+
cursor: pointer;
|
5
|
+
transition: all 0.2s;
|
6
|
+
}
|
7
|
+
|
8
|
+
.primary {
|
9
|
+
background: #1677ff;
|
10
|
+
color: white;
|
11
|
+
border: none;
|
12
|
+
}
|
13
|
+
|
14
|
+
.primary:hover {
|
15
|
+
background: #4096ff;
|
16
|
+
}
|
17
|
+
|
18
|
+
.default {
|
19
|
+
background: #ffffff;
|
20
|
+
color: #333;
|
21
|
+
border: 1px solid #d9d9d9;
|
22
|
+
}
|
23
|
+
|
24
|
+
.default:hover {
|
25
|
+
border-color: #1677ff;
|
26
|
+
color: #1677ff;
|
27
|
+
}
|