@vuonweb/react 0.1.0
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.d.ts +52 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +1 -0
- package/package.json +37 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 icon-builder contributors
|
|
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.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
type IconProps = React.SVGProps<SVGSVGElement> & {
|
|
4
|
+
size?: number;
|
|
5
|
+
color?: string;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Mọi icon generated đều render qua BaseIcon để tránh lặp code.
|
|
10
|
+
* `color` set cả fill lẫn stroke; icon component tự quyết định thuộc tính
|
|
11
|
+
* nào bị vô hiệu (fill="none" cho outline, stroke="none" cho solid) bằng
|
|
12
|
+
* cách truyền static prop đó *trước* {...props}, nên người dùng vẫn có thể
|
|
13
|
+
* override fill/stroke/className/... trực tiếp qua props.
|
|
14
|
+
*/
|
|
15
|
+
declare const BaseIcon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* File này được sinh tự động bởi icon-builder. Không sửa tay.
|
|
19
|
+
* @generated
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
declare const Home: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* File này được sinh tự động bởi icon-builder. Không sửa tay.
|
|
26
|
+
* @generated
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
declare const Search: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* File này được sinh tự động bởi icon-builder. Không sửa tay.
|
|
33
|
+
* @generated
|
|
34
|
+
*/
|
|
35
|
+
|
|
36
|
+
declare const Trashed: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* File này được sinh tự động bởi icon-builder. Không sửa tay.
|
|
40
|
+
* @generated
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
declare const User: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* File này được sinh tự động bởi icon-builder. Không sửa tay.
|
|
47
|
+
* @generated
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
declare const HomeSolid: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
51
|
+
|
|
52
|
+
export { BaseIcon, Home, HomeSolid, type IconProps, Search, Trashed, User };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// src/Icon.tsx
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var BaseIcon = React.forwardRef(
|
|
5
|
+
({ size = 24, color = "currentColor", strokeWidth = 2, children, ...rest }, ref) => {
|
|
6
|
+
return /* @__PURE__ */ jsx(
|
|
7
|
+
"svg",
|
|
8
|
+
{
|
|
9
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
10
|
+
width: size,
|
|
11
|
+
height: size,
|
|
12
|
+
fill: color,
|
|
13
|
+
stroke: color,
|
|
14
|
+
strokeWidth,
|
|
15
|
+
strokeLinecap: "round",
|
|
16
|
+
strokeLinejoin: "round",
|
|
17
|
+
ref,
|
|
18
|
+
...rest,
|
|
19
|
+
children
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
BaseIcon.displayName = "BaseIcon";
|
|
25
|
+
|
|
26
|
+
// src/Home.tsx
|
|
27
|
+
import * as React2 from "react";
|
|
28
|
+
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
29
|
+
var Home = React2.forwardRef((props, ref) => {
|
|
30
|
+
return /* @__PURE__ */ jsxs(BaseIcon, { ref, viewBox: "0 0 24 24", fill: "none", ...props, children: [
|
|
31
|
+
/* @__PURE__ */ jsx2("path", { d: "M3 10.5 12 3l9 7.5" }),
|
|
32
|
+
/* @__PURE__ */ jsx2("path", { d: "M5 9.5V21h14V9.5" }),
|
|
33
|
+
/* @__PURE__ */ jsx2("path", { d: "M9 21v-6h6v6" })
|
|
34
|
+
] });
|
|
35
|
+
});
|
|
36
|
+
Home.displayName = "Home";
|
|
37
|
+
|
|
38
|
+
// src/Search.tsx
|
|
39
|
+
import * as React3 from "react";
|
|
40
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
41
|
+
var Search = React3.forwardRef((props, ref) => {
|
|
42
|
+
return /* @__PURE__ */ jsxs2(BaseIcon, { ref, viewBox: "0 0 24 24", fill: "none", ...props, children: [
|
|
43
|
+
/* @__PURE__ */ jsx3("circle", { cx: "11", cy: "11", r: "7" }),
|
|
44
|
+
/* @__PURE__ */ jsx3("path", { d: "m21 21-4.35-4.35" })
|
|
45
|
+
] });
|
|
46
|
+
});
|
|
47
|
+
Search.displayName = "Search";
|
|
48
|
+
|
|
49
|
+
// src/Trashed.tsx
|
|
50
|
+
import * as React4 from "react";
|
|
51
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
52
|
+
var Trashed = React4.forwardRef((props, ref) => {
|
|
53
|
+
return /* @__PURE__ */ jsx4(BaseIcon, { ref, viewBox: "0 0 24 24", fill: "none", ...props, children: /* @__PURE__ */ jsx4("path", { d: "M21 5.98c-3.33-.33-6.68-.5-10.02-.5q-2.97 0-5.94.3L3 5.98m5.5-1.01.22-1.31C8.88 2.71 9 2 10.69 2h2.62c1.69 0 1.82.75 1.97 1.67l.22 1.3m3.35 4.17-.65 10.07C18.09 20.78 18 22 15.21 22H8.79C6 22 5.91 20.78 5.8 19.21L5.15 9.14m5.18 7.36h3.33m-4.16-4h5" }) });
|
|
54
|
+
});
|
|
55
|
+
Trashed.displayName = "Trashed";
|
|
56
|
+
|
|
57
|
+
// src/User.tsx
|
|
58
|
+
import * as React5 from "react";
|
|
59
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
60
|
+
var User = React5.forwardRef((props, ref) => {
|
|
61
|
+
return /* @__PURE__ */ jsxs3(BaseIcon, { ref, viewBox: "0 0 24 24", fill: "none", ...props, children: [
|
|
62
|
+
/* @__PURE__ */ jsx5("circle", { cx: "12", cy: "8", r: "4" }),
|
|
63
|
+
/* @__PURE__ */ jsx5("path", { d: "M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8" })
|
|
64
|
+
] });
|
|
65
|
+
});
|
|
66
|
+
User.displayName = "User";
|
|
67
|
+
|
|
68
|
+
// src/HomeSolid.tsx
|
|
69
|
+
import * as React6 from "react";
|
|
70
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
71
|
+
var HomeSolid = React6.forwardRef((props, ref) => {
|
|
72
|
+
return /* @__PURE__ */ jsx6(BaseIcon, { ref, viewBox: "0 0 24 24", stroke: "none", ...props, children: /* @__PURE__ */ jsx6("path", { d: "m12 3-9 7.5V21h6v-6h6v6h6V10.5z" }) });
|
|
73
|
+
});
|
|
74
|
+
HomeSolid.displayName = "HomeSolid";
|
|
75
|
+
export {
|
|
76
|
+
BaseIcon,
|
|
77
|
+
Home,
|
|
78
|
+
HomeSolid,
|
|
79
|
+
Search,
|
|
80
|
+
Trashed,
|
|
81
|
+
User
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/Icon.tsx","../src/Home.tsx","../src/Search.tsx","../src/Trashed.tsx","../src/User.tsx","../src/HomeSolid.tsx"],"sourcesContent":["import * as React from \"react\";\n\nexport type IconProps = React.SVGProps<SVGSVGElement> & {\n size?: number;\n color?: string;\n strokeWidth?: number;\n};\n\n/**\n * Mọi icon generated đều render qua BaseIcon để tránh lặp code.\n * `color` set cả fill lẫn stroke; icon component tự quyết định thuộc tính\n * nào bị vô hiệu (fill=\"none\" cho outline, stroke=\"none\" cho solid) bằng\n * cách truyền static prop đó *trước* {...props}, nên người dùng vẫn có thể\n * override fill/stroke/className/... trực tiếp qua props.\n */\nexport const BaseIcon = React.forwardRef<SVGSVGElement, IconProps>(\n ({ size = 24, color = \"currentColor\", strokeWidth = 2, children, ...rest }, ref) => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={size}\n height={size}\n fill={color}\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n ref={ref}\n {...rest}\n >\n {children}\n </svg>\n );\n },\n);\n\nBaseIcon.displayName = \"BaseIcon\";\n","/**\n * File này được sinh tự động bởi icon-builder. Không sửa tay.\n * @generated\n */\n\nimport * as React from \"react\";\nimport { BaseIcon, type IconProps } from \"./Icon.js\";\n\nexport const Home = React.forwardRef<SVGSVGElement, IconProps>((props, ref) => {\n return (\n <BaseIcon ref={ref} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <path d=\"M3 10.5 12 3l9 7.5\" />\n <path d=\"M5 9.5V21h14V9.5\" />\n <path d=\"M9 21v-6h6v6\" />\n </BaseIcon>\n );\n});\n\nHome.displayName = \"Home\";\n","/**\n * File này được sinh tự động bởi icon-builder. Không sửa tay.\n * @generated\n */\n\nimport * as React from \"react\";\nimport { BaseIcon, type IconProps } from \"./Icon.js\";\n\nexport const Search = React.forwardRef<SVGSVGElement, IconProps>((props, ref) => {\n return (\n <BaseIcon ref={ref} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m21 21-4.35-4.35\" />\n </BaseIcon>\n );\n});\n\nSearch.displayName = \"Search\";\n","/**\n * File này được sinh tự động bởi icon-builder. Không sửa tay.\n * @generated\n */\n\nimport * as React from \"react\";\nimport { BaseIcon, type IconProps } from \"./Icon.js\";\n\nexport const Trashed = React.forwardRef<SVGSVGElement, IconProps>((props, ref) => {\n return (\n <BaseIcon ref={ref} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <path d=\"M21 5.98c-3.33-.33-6.68-.5-10.02-.5q-2.97 0-5.94.3L3 5.98m5.5-1.01.22-1.31C8.88 2.71 9 2 10.69 2h2.62c1.69 0 1.82.75 1.97 1.67l.22 1.3m3.35 4.17-.65 10.07C18.09 20.78 18 22 15.21 22H8.79C6 22 5.91 20.78 5.8 19.21L5.15 9.14m5.18 7.36h3.33m-4.16-4h5\" />\n </BaseIcon>\n );\n});\n\nTrashed.displayName = \"Trashed\";\n","/**\n * File này được sinh tự động bởi icon-builder. Không sửa tay.\n * @generated\n */\n\nimport * as React from \"react\";\nimport { BaseIcon, type IconProps } from \"./Icon.js\";\n\nexport const User = React.forwardRef<SVGSVGElement, IconProps>((props, ref) => {\n return (\n <BaseIcon ref={ref} viewBox=\"0 0 24 24\" fill=\"none\" {...props}>\n <circle cx=\"12\" cy=\"8\" r=\"4\" />\n <path d=\"M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8\" />\n </BaseIcon>\n );\n});\n\nUser.displayName = \"User\";\n","/**\n * File này được sinh tự động bởi icon-builder. Không sửa tay.\n * @generated\n */\n\nimport * as React from \"react\";\nimport { BaseIcon, type IconProps } from \"./Icon.js\";\n\nexport const HomeSolid = React.forwardRef<SVGSVGElement, IconProps>((props, ref) => {\n return (\n <BaseIcon ref={ref} viewBox=\"0 0 24 24\" stroke=\"none\" {...props}>\n <path d=\"m12 3-9 7.5V21h6v-6h6v6h6V10.5z\" />\n </BaseIcon>\n );\n});\n\nHomeSolid.displayName = \"HomeSolid\";\n"],"mappings":";AAAA,YAAY,WAAW;AAkBjB;AAHC,IAAM,WAAiB;AAAA,EAC5B,CAAC,EAAE,OAAO,IAAI,QAAQ,gBAAgB,cAAc,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ;AAClF,WACE;AAAA,MAAC;AAAA;AAAA,QACC,OAAM;AAAA,QACN,OAAO;AAAA,QACP,QAAQ;AAAA,QACR,MAAM;AAAA,QACN,QAAQ;AAAA,QACR;AAAA,QACA,eAAc;AAAA,QACd,gBAAe;AAAA,QACf;AAAA,QACC,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,E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,mCAAkC;AAAA,KAC5C;AAEJ,CAAC;AAED,KAAK,cAAc;;;ACZnB,YAAYE,YAAW;AAMjB,gBAAAC,YAAA;AAHC,IAAM,YAAkB,kBAAqC,CAAC,OAAO,QAAQ;AAClF,SACE,gBAAAA,KAAC,YAAS,KAAU,SAAQ,aAAY,QAAO,QAAQ,GAAG,OACxD,0BAAAA,KAAC,UAAK,GAAE,mCAAkC,GAC5C;AAEJ,CAAC;AAED,UAAU,cAAc;","names":["React","jsx","React","jsx","jsxs","React","jsx","React","jsx","jsxs","React","jsx"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vuonweb/react",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Icon components sinh tự động từ icons/ cho React.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"react": ">=18"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/react": "^18.3.5",
|
|
28
|
+
"react": "^18.3.1",
|
|
29
|
+
"tsup": "^8.3.0",
|
|
30
|
+
"typescript": "^5.6.2"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsup",
|
|
34
|
+
"dev": "tsup --watch",
|
|
35
|
+
"typecheck": "tsc --noEmit"
|
|
36
|
+
}
|
|
37
|
+
}
|