hans-ui-design-lib 0.0.67 → 0.0.68
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.cjs.js +16 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.es.js +76 -61
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -6,4 +6,19 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var f;function I(){if(f)return p;f=1;var o=Symbol.for("react.transitional.element"),s=Symbol.for("react.fragment");function i(a,e,t){var r=null;if(t!==void 0&&(r=""+t),e.key!==void 0&&(r=""+e.key),"key"in e){t={};for(var n in e)n!=="key"&&(t[n]=e[n])}else t=e;return e=t.ref,{$$typeof:o,type:a,key:r,ref:e!==void 0?e:null,props:t}}return p.Fragment=s,p.jsx=i,p.jsxs=i,p}var v;function q(){return v||(v=1,h.exports=I()),h.exports}var u=q();const x=d.memo(o=>{const{label:s="",buttonSize:i="medium",buttonColor:a="primary",buttonVariant:e="default",buttonType:t="button",customClasses:r="",disabled:n=!1,children:c,...l}=o;return u.jsx("button",{type:t,disabled:n,className:`
|
|
10
|
+
hans-button
|
|
11
|
+
hans-button-${i}
|
|
12
|
+
hans-button-${a}
|
|
13
|
+
hans-button-${e}
|
|
14
|
+
${r}
|
|
15
|
+
`,...l,children:u.jsx("slot",{children:c??(s&&u.jsx("span",{children:s}))})})});x.displayName="HansButton";const b=d.memo(o=>{const{label:s="",placeholder:i="",value:a="",inputColor:e="primary",inputSize:t="medium",inputType:r="text",customClasses:n="",disabled:c=!1,children:l,...m}=o;return u.jsxs(u.Fragment,{children:[l,s,u.jsx("input",{type:r,disabled:c,value:a,placeholder:i,className:`
|
|
16
|
+
hans-input
|
|
17
|
+
hans-input-${t}
|
|
18
|
+
hans-input-${e}
|
|
19
|
+
${n}
|
|
20
|
+
`,...m})]})});b.displayName="HansInput";function P(o){return Object.keys(o)}const R={name:"string",iconSize:{type:"custom",ref:{}},customClasses:"string"},j=P(R),y={Fa:()=>Promise.resolve().then(()=>require("./index-B8vGj59Y.cjs")),Md:()=>Promise.resolve().then(()=>require("./index-BniI3q7_.cjs")),Bi:()=>Promise.resolve().then(()=>require("./index-CzJEuaAC.cjs")),Ai:()=>Promise.resolve().then(()=>require("./index-DpGEmQKf.cjs")),Bs:()=>Promise.resolve().then(()=>require("./index-DOM24eP1.cjs")),Io:()=>Promise.resolve().then(()=>require("./index-DqJAPiPg.cjs")),Ri:()=>Promise.resolve().then(()=>require("./index-Cg9EwHiA.cjs")),Hi:()=>Promise.resolve().then(()=>require("./index-Cd4f2LU9.cjs")),Pi:()=>Promise.resolve().then(()=>require("./index-DgzbVFqs.cjs")),Tb:()=>Promise.resolve().then(()=>require("./index-BMJKTS9q.cjs")),Lu:()=>Promise.resolve().then(()=>require("./index-CsmLabva.cjs"))},H=d.memo(o=>{const{name:s,iconSize:i="medium",customClasses:a="",...e}=o,[t,r]=d.useState(null);return d.useEffect(()=>{let n=!0;if(!s)return;const c=s.slice(0,2),l=y[c];if(l)return(async()=>{try{const m=await l();if(!n)return;r(()=>m[s]||null)}catch(m){console.warn(`[HansUI] Error loading icon ${s}:`,m),n&&r(()=>null)}})(),()=>{n=!1}},[s]),t?u.jsx(t,{className:`
|
|
21
|
+
hans-icon
|
|
22
|
+
hans-icon-${i}
|
|
23
|
+
${a}
|
|
24
|
+
`,...e}):u.jsx("span",{className:"hans-icon-loading"})});H.displayName="HansIcon";const C={label:"string",buttonSize:{type:"custom",ref:{}},buttonColor:{type:"custom",ref:{}},buttonVariant:{type:"custom",ref:{}},buttonType:{type:"custom",ref:{}},customClasses:"string",disabled:"boolean"},S=P(C);exports.DynamicIconImports=y;exports.HansButton=x;exports.HansButtonPropsList=S;exports.HansIcon=H;exports.HansIconPropsList=j;exports.HansInput=b;
|
package/dist/index.d.ts
CHANGED
|
@@ -11,19 +11,19 @@ export declare const HansButton: default_2.MemoExoticComponent<(props: HansButto
|
|
|
11
11
|
|
|
12
12
|
export declare type HansButtonProps = InferPropsFromSchema<typeof HansButtonSchema> & default_2.ButtonHTMLAttributes<HTMLButtonElement>;
|
|
13
13
|
|
|
14
|
-
export declare const HansButtonPropsList: ("label" | "
|
|
14
|
+
export declare const HansButtonPropsList: ("label" | "buttonSize" | "buttonColor" | "buttonVariant" | "buttonType" | "customClasses" | "disabled")[];
|
|
15
15
|
|
|
16
16
|
declare const HansButtonSchema: {
|
|
17
17
|
readonly label: "string";
|
|
18
|
-
readonly
|
|
18
|
+
readonly buttonSize: {
|
|
19
19
|
readonly type: "custom";
|
|
20
20
|
readonly ref: Size;
|
|
21
21
|
};
|
|
22
|
-
readonly
|
|
22
|
+
readonly buttonColor: {
|
|
23
23
|
readonly type: "custom";
|
|
24
24
|
readonly ref: Color;
|
|
25
25
|
};
|
|
26
|
-
readonly
|
|
26
|
+
readonly buttonVariant: {
|
|
27
27
|
readonly type: "custom";
|
|
28
28
|
readonly ref: Variant;
|
|
29
29
|
};
|
|
@@ -39,11 +39,11 @@ export declare const HansIcon: default_2.FC<HansIconProps>;
|
|
|
39
39
|
|
|
40
40
|
export declare type HansIconProps = InferPropsFromSchema<typeof HansIconSchema>;
|
|
41
41
|
|
|
42
|
-
export declare const HansIconPropsList: ("
|
|
42
|
+
export declare const HansIconPropsList: ("customClasses" | "name" | "iconSize")[];
|
|
43
43
|
|
|
44
44
|
declare const HansIconSchema: {
|
|
45
45
|
readonly name: "string";
|
|
46
|
-
readonly
|
|
46
|
+
readonly iconSize: {
|
|
47
47
|
readonly type: "custom";
|
|
48
48
|
readonly ref: Size;
|
|
49
49
|
};
|
|
@@ -58,7 +58,7 @@ declare const HansInputSchema: {
|
|
|
58
58
|
readonly label: "string";
|
|
59
59
|
readonly placeholder: "string";
|
|
60
60
|
readonly value: "string";
|
|
61
|
-
readonly
|
|
61
|
+
readonly inputColor: {
|
|
62
62
|
readonly type: "custom";
|
|
63
63
|
readonly ref: Color;
|
|
64
64
|
};
|
package/dist/index.es.js
CHANGED
|
@@ -10,94 +10,105 @@ var x = { exports: {} }, p = {};
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
12
|
var f;
|
|
13
|
-
function
|
|
13
|
+
function y() {
|
|
14
14
|
if (f) return p;
|
|
15
15
|
f = 1;
|
|
16
|
-
var o = Symbol.for("react.transitional.element"),
|
|
17
|
-
function
|
|
16
|
+
var o = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
|
|
17
|
+
function i(u, t, n) {
|
|
18
18
|
var r = null;
|
|
19
|
-
if (
|
|
20
|
-
|
|
19
|
+
if (n !== void 0 && (r = "" + n), t.key !== void 0 && (r = "" + t.key), "key" in t) {
|
|
20
|
+
n = {};
|
|
21
21
|
for (var e in t)
|
|
22
|
-
e !== "key" && (
|
|
23
|
-
} else
|
|
24
|
-
return t =
|
|
22
|
+
e !== "key" && (n[e] = t[e]);
|
|
23
|
+
} else n = t;
|
|
24
|
+
return t = n.ref, {
|
|
25
25
|
$$typeof: o,
|
|
26
26
|
type: u,
|
|
27
27
|
key: r,
|
|
28
28
|
ref: t !== void 0 ? t : null,
|
|
29
|
-
props:
|
|
29
|
+
props: n
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return p.Fragment =
|
|
32
|
+
return p.Fragment = s, p.jsx = i, p.jsxs = i, p;
|
|
33
33
|
}
|
|
34
34
|
var h;
|
|
35
|
-
function
|
|
36
|
-
return h || (h = 1, x.exports =
|
|
35
|
+
function R() {
|
|
36
|
+
return h || (h = 1, x.exports = y()), x.exports;
|
|
37
37
|
}
|
|
38
|
-
var
|
|
39
|
-
const
|
|
38
|
+
var a = R();
|
|
39
|
+
const j = d.memo((o) => {
|
|
40
40
|
const {
|
|
41
|
-
label:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
buttonType:
|
|
41
|
+
label: s = "",
|
|
42
|
+
buttonSize: i = "medium",
|
|
43
|
+
buttonColor: u = "primary",
|
|
44
|
+
buttonVariant: t = "default",
|
|
45
|
+
buttonType: n = "button",
|
|
46
46
|
customClasses: r = "",
|
|
47
47
|
disabled: e = !1,
|
|
48
48
|
children: l,
|
|
49
49
|
...c
|
|
50
50
|
} = o;
|
|
51
|
-
return /* @__PURE__ */
|
|
51
|
+
return /* @__PURE__ */ a.jsx(
|
|
52
52
|
"button",
|
|
53
53
|
{
|
|
54
|
-
type:
|
|
54
|
+
type: n,
|
|
55
55
|
disabled: e,
|
|
56
|
-
className: `
|
|
56
|
+
className: `
|
|
57
|
+
hans-button
|
|
58
|
+
hans-button-${i}
|
|
59
|
+
hans-button-${u}
|
|
60
|
+
hans-button-${t}
|
|
61
|
+
${r}
|
|
62
|
+
`,
|
|
57
63
|
...c,
|
|
58
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ a.jsx("slot", { children: l ?? (s && /* @__PURE__ */ a.jsx("span", { children: s })) })
|
|
59
65
|
}
|
|
60
66
|
);
|
|
61
67
|
});
|
|
62
|
-
|
|
63
|
-
const
|
|
68
|
+
j.displayName = "HansButton";
|
|
69
|
+
const v = d.memo((o) => {
|
|
64
70
|
const {
|
|
65
|
-
label:
|
|
66
|
-
placeholder:
|
|
71
|
+
label: s = "",
|
|
72
|
+
placeholder: i = "",
|
|
67
73
|
value: u = "",
|
|
68
|
-
|
|
69
|
-
inputSize:
|
|
74
|
+
inputColor: t = "primary",
|
|
75
|
+
inputSize: n = "medium",
|
|
70
76
|
inputType: r = "text",
|
|
71
77
|
customClasses: e = "",
|
|
72
78
|
disabled: l = !1,
|
|
73
79
|
children: c,
|
|
74
80
|
...m
|
|
75
81
|
} = o;
|
|
76
|
-
return /* @__PURE__ */
|
|
82
|
+
return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
|
|
77
83
|
c,
|
|
78
|
-
|
|
79
|
-
/* @__PURE__ */
|
|
84
|
+
s,
|
|
85
|
+
/* @__PURE__ */ a.jsx(
|
|
80
86
|
"input",
|
|
81
87
|
{
|
|
82
88
|
type: r,
|
|
83
89
|
disabled: l,
|
|
84
90
|
value: u,
|
|
85
|
-
placeholder:
|
|
86
|
-
className: `
|
|
91
|
+
placeholder: i,
|
|
92
|
+
className: `
|
|
93
|
+
hans-input
|
|
94
|
+
hans-input-${n}
|
|
95
|
+
hans-input-${t}
|
|
96
|
+
${e}
|
|
97
|
+
`,
|
|
87
98
|
...m
|
|
88
99
|
}
|
|
89
100
|
)
|
|
90
101
|
] });
|
|
91
102
|
});
|
|
92
|
-
|
|
93
|
-
function
|
|
103
|
+
v.displayName = "HansInput";
|
|
104
|
+
function b(o) {
|
|
94
105
|
return Object.keys(o);
|
|
95
106
|
}
|
|
96
|
-
const
|
|
107
|
+
const C = {
|
|
97
108
|
name: "string",
|
|
98
|
-
|
|
109
|
+
iconSize: { type: "custom", ref: {} },
|
|
99
110
|
customClasses: "string"
|
|
100
|
-
},
|
|
111
|
+
}, S = b(C), H = {
|
|
101
112
|
Fa: () => import("./index-CuLnU-aI.js"),
|
|
102
113
|
Md: () => import("./index-D5QBazti.js"),
|
|
103
114
|
Bi: () => import("./index-Cru_aeJC.js"),
|
|
@@ -109,49 +120,53 @@ const H = {
|
|
|
109
120
|
Pi: () => import("./index-CraOMhSg.js"),
|
|
110
121
|
Tb: () => import("./index-C_w14lJB.js"),
|
|
111
122
|
Lu: () => import("./index-HCQwBvMc.js")
|
|
112
|
-
},
|
|
123
|
+
}, I = d.memo(
|
|
113
124
|
(o) => {
|
|
114
|
-
const { name:
|
|
125
|
+
const { name: s, iconSize: i = "medium", customClasses: u = "", ...t } = o, [n, r] = d.useState(null);
|
|
115
126
|
return d.useEffect(() => {
|
|
116
127
|
let e = !0;
|
|
117
|
-
if (!
|
|
118
|
-
const l =
|
|
128
|
+
if (!s) return;
|
|
129
|
+
const l = s.slice(0, 2), c = H[l];
|
|
119
130
|
if (c)
|
|
120
131
|
return (async () => {
|
|
121
132
|
try {
|
|
122
133
|
const m = await c();
|
|
123
134
|
if (!e) return;
|
|
124
|
-
r(() => m[
|
|
135
|
+
r(() => m[s] || null);
|
|
125
136
|
} catch (m) {
|
|
126
|
-
console.warn(`[HansUI] Error loading icon ${
|
|
137
|
+
console.warn(`[HansUI] Error loading icon ${s}:`, m), e && r(() => null);
|
|
127
138
|
}
|
|
128
139
|
})(), () => {
|
|
129
140
|
e = !1;
|
|
130
141
|
};
|
|
131
|
-
}, [
|
|
132
|
-
|
|
142
|
+
}, [s]), n ? /* @__PURE__ */ a.jsx(
|
|
143
|
+
n,
|
|
133
144
|
{
|
|
134
|
-
className: `
|
|
145
|
+
className: `
|
|
146
|
+
hans-icon
|
|
147
|
+
hans-icon-${i}
|
|
148
|
+
${u}
|
|
149
|
+
`,
|
|
135
150
|
...t
|
|
136
151
|
}
|
|
137
|
-
) : /* @__PURE__ */
|
|
152
|
+
) : /* @__PURE__ */ a.jsx("span", { className: "hans-icon-loading" });
|
|
138
153
|
}
|
|
139
154
|
);
|
|
140
|
-
|
|
141
|
-
const
|
|
155
|
+
I.displayName = "HansIcon";
|
|
156
|
+
const $ = {
|
|
142
157
|
label: "string",
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
158
|
+
buttonSize: { type: "custom", ref: {} },
|
|
159
|
+
buttonColor: { type: "custom", ref: {} },
|
|
160
|
+
buttonVariant: { type: "custom", ref: {} },
|
|
146
161
|
buttonType: { type: "custom", ref: {} },
|
|
147
162
|
customClasses: "string",
|
|
148
163
|
disabled: "boolean"
|
|
149
|
-
},
|
|
164
|
+
}, T = b($);
|
|
150
165
|
export {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
166
|
+
H as DynamicIconImports,
|
|
167
|
+
j as HansButton,
|
|
168
|
+
T as HansButtonPropsList,
|
|
169
|
+
I as HansIcon,
|
|
170
|
+
S as HansIconPropsList,
|
|
171
|
+
v as HansInput
|
|
157
172
|
};
|