@tdm-design/icons 0.0.14 → 0.0.15

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 CHANGED
@@ -108,43 +108,118 @@ export default RefIcon;
108
108
 
109
109
  ## Adding New Icons
110
110
 
111
- 1. **Prepare SVG file**: Ensure your SVG has standard attributes:
112
- ```xml
113
- <svg width="24" height="24" viewBox="0 0 24 24" fill="#cacaca" xmlns="http://www.w3.org/2000/svg">
114
- <path d="..." />
115
- </svg>
116
- ```
117
-
118
- 2. **Place SVG file**: Add the file to the appropriate folder in `svg/`:
119
- - `svg/filled/` - For filled style icons (e.g., `BellFilledIcon.svg`)
120
- - `svg/outlined/` - For outlined style icons (e.g., `BellOutlinedIcon.svg`)
121
- - `svg/color/` - For color icons (e.g., `LogoColorIcon.svg`)
122
- - `svg/` - For icons without a specific style
123
-
124
- 3. **Run the generator**:
125
- ```bash
126
- node generate-icons.js
127
- ```
128
-
129
- 4. **Import and use** the new component:
130
- ```tsx
131
- import BellFilledIcon from '@tdm-design/icons/BellFilledIcon';
132
-
133
- function App() {
134
- return <BellFilledIcon />;
135
- }
136
- ```
137
-
138
- ### Using Barrel Export (Supports Tree-shaking)
139
-
140
- ```tsx
141
- import { BellFilledIcon } from '@tdm-design/icons';
142
- ```
143
-
144
- ### Customizing Icons
145
- ```tsx
146
- <BellFilledIcon style={{ color: 'red' }} spin />
147
- ```
111
+ ### 1. Chuẩn bị file SVG
112
+
113
+ Đảm bảo file SVG của bạn các thuộc tính chuẩn:
114
+
115
+ ```xml
116
+ <svg width="24" height="24" viewBox="0 0 24 24" fill="#cacaca" xmlns="http://www.w3.org/2000/svg">
117
+ <path d="..." />
118
+ </svg>
119
+ ```
120
+
121
+ ### 2. Đặt file SVG vào thư mục phù hợp
122
+
123
+ Thêm file vào thư mục tương ứng trong `svg/`:
124
+ - `svg/filled/` - Icon kiểu filled (ví dụ: `BellFilledIcon.svg`)
125
+ - `svg/outlined/` - Icon kiểu outlined (ví dụ: `BellOutlinedIcon.svg`)
126
+ - `svg/color/` - Icon có màu (ví dụ: `LogoColorIcon.svg`)
127
+ - `svg/` - Icon không thuộc style cụ thể
128
+
129
+ ### 3. Generate icon components
130
+
131
+ Chạy script để tạo các component React từ file SVG:
132
+
133
+ ```bash
134
+ node generate-icons.js
135
+ ```
136
+
137
+ Hoặc dùng `--force` để ghi đè các file đã tồn tại:
138
+
139
+ ```bash
140
+ node generate-icons.js --force
141
+ ```
142
+
143
+ ### 4. Tạo changeset
144
+
145
+ Tạo changeset để ghi nhận thay đổi cho version tiếp theo:
146
+
147
+ ```bash
148
+ pnpm changeset
149
+ ```
150
+
151
+ Chọn loại thay đổi:
152
+ - **patch** - Sửa lỗi hoặc thay đổi nhỏ (0.0.x)
153
+ - **minor** - Thêm tính năng mới (0.x.0)
154
+ - **major** - Thay đổi breaking changes (x.0.0)
155
+
156
+ Nhập mô tả thay đổi (ví dụ: "Add new BellFilledIcon")
157
+
158
+ ### 5. Build package
159
+
160
+ Build package để tạo các file output:
161
+
162
+ ```bash
163
+ pnpm build
164
+ ```
165
+
166
+ Lệnh này sẽ:
167
+ - Compile TypeScript sang JavaScript
168
+ - Tạo type definitions (.d.ts)
169
+ - Bundle các file theo cấu trúc trong `tsup.config.ts`
170
+
171
+ ### 6. Publish lên npm
172
+
173
+ #### Cách 1: Sử dụng changeset (Khuyến nghị)
174
+
175
+ ```bash
176
+ pnpm changeset version
177
+ ```
178
+
179
+ Lệnh này sẽ:
180
+ - Cập nhật version trong `package.json`
181
+ - Tạo/cập nhật `CHANGELOG.md`
182
+ - Xóa các changeset files đã được áp dụng
183
+
184
+ Sau đó publish:
185
+
186
+ ```bash
187
+ pnpm publish
188
+ ```
189
+
190
+ #### Cách 2: Publish trực tiếp
191
+
192
+ ```bash
193
+ npm publish
194
+ ```
195
+
196
+ **Lưu ý**: Đảm bảo bạn đã đăng nhập npm (`npm login`) và có quyền publish package.
197
+
198
+ ### 7. Sử dụng icon mới
199
+
200
+ Sau khi publish, bạn có thể sử dụng icon trong project:
201
+
202
+ #### Import trực tiếp (Recommended)
203
+
204
+ ```tsx
205
+ import BellFilledIcon from '@tdm-design/icons/BellFilledIcon';
206
+
207
+ function App() {
208
+ return <BellFilledIcon />;
209
+ }
210
+ ```
211
+
212
+ #### Sử dụng Barrel Export (Hỗ trợ Tree-shaking)
213
+
214
+ ```tsx
215
+ import { BellFilledIcon } from '@tdm-design/icons';
216
+ ```
217
+
218
+ #### Tùy chỉnh Icon
219
+
220
+ ```tsx
221
+ <BellFilledIcon style={{ color: 'red' }} spin />
222
+ ```
148
223
 
149
224
  ## Output Status
150
225
 
@@ -0,0 +1,7 @@
1
+ import * as React from 'react';
2
+ import { T as TdmIconProps } from './TdmIcon-CClytigf.js';
3
+
4
+ /**![RotateLeftOutlinedIcon](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0iI2NhY2FjYSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy45MzEwMyAxMC43NTg2QzMuMzYyMDcgMTAuNzA2OSAzLjA1MTcyIDEwLjM5NjYgMyA5LjgyNzYxVjQuMjQxNEMzLjA1MTcyIDMuNjcyNDMgMy4zNjIwNyAzLjM2MjA5IDMuOTMxMDMgMy4zMTAzNkM0LjUgMy4zNjIwOSA0LjgxMDM0IDMuNjcyNDMgNC44NjIwNyA0LjI0MTRWNy4zNDQ4NUw1LjYzNzkzIDYuNDUyNjFDNi40Mzk2NiA1LjQ2OTg1IDcuNDA5NDggNC43MDY5MiA4LjU0NzQxIDQuMTYzODFDOS43MTEyMSAzLjU5NDg1IDEwLjk2NTUgMy4zMTAzNiAxMi4zMTAzIDMuMzEwMzZDMTMuOTM5NyAzLjMzNjIzIDE1LjQwMDkgMy43MzcwOSAxNi42OTQgNC41MTI5NUMxOC4wMTI5IDUuMjYyO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uNTE3MjQgMTAuNzU4NkgzLjkzMTAzWiIvPjwvc3ZnPg==) */
5
+ declare const RefIcon: React.ForwardRefExoticComponent<Omit<TdmIconProps, 'ref'> & React.RefAttributes<HTMLSpanElement>>;
6
+
7
+ export { RefIcon as default };
@@ -0,0 +1,82 @@
1
+ "use client";
2
+ "use strict";
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __defProps = Object.defineProperties;
6
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
7
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
10
+ var __getProtoOf = Object.getPrototypeOf;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __spreadValues = (a, b) => {
15
+ for (var prop in b || (b = {}))
16
+ if (__hasOwnProp.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols)
19
+ for (var prop of __getOwnPropSymbols(b)) {
20
+ if (__propIsEnum.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ }
23
+ return a;
24
+ };
25
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
+ var __export = (target, all) => {
27
+ for (var name in all)
28
+ __defProp(target, name, { get: all[name], enumerable: true });
29
+ };
30
+ var __copyProps = (to, from, except, desc) => {
31
+ if (from && typeof from === "object" || typeof from === "function") {
32
+ for (let key of __getOwnPropNames(from))
33
+ if (!__hasOwnProp.call(to, key) && key !== except)
34
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
35
+ }
36
+ return to;
37
+ };
38
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
39
+ // If the importer is in node compatibility mode or this is not an ESM
40
+ // file that has been converted to a CommonJS file using a Babel-
41
+ // compatible transform (i.e. "__esModule" has not been set), then set
42
+ // "default" to the CommonJS "module.exports" for node compatibility.
43
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
44
+ mod
45
+ ));
46
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
47
+ var RotateLeftOutlinedIcon_exports = {};
48
+ __export(RotateLeftOutlinedIcon_exports, {
49
+ default: () => RotateLeftOutlinedIcon_default
50
+ });
51
+ module.exports = __toCommonJS(RotateLeftOutlinedIcon_exports);
52
+ var import_jsx_runtime = require("react/jsx-runtime");
53
+ var React = __toESM(require("react"));
54
+ var import_TdmIcon = __toESM(require("../components/TdmIcon"));
55
+ var import_utils = require("../utils");
56
+ const rotateLeftOutlinedSvg = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
57
+ "svg",
58
+ {
59
+ width: "24",
60
+ height: "24",
61
+ viewBox: "0 0 24 24",
62
+ fill: "#cacaca",
63
+ xmlns: "http://www.w3.org/2000/svg",
64
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
65
+ "path",
66
+ {
67
+ d: "M3.93103 10.7586C3.36207 10.7069 3.05172 10.3966 3 9.82761V4.2414C3.05172 3.67243 3.36207 3.36209 3.93103 3.31036C4.5 3.36209 4.81034 3.67243 4.86207 4.2414V7.34485L5.63793 6.45261C6.43966 5.46985 7.40948 4.70692 8.54741 4.16381C9.71121 3.59485 10.9655 3.31036 12.3103 3.31036C13.9397 3.33623 15.4009 3.73709 16.694 4.51295C18.0129 5.26295 19.0474 6.29743 19.7974 7.6164C20.5733 8.9095 20.9741 10.3707 21 12C20.9741 13.6293 20.5733 15.0905 19.7974 16.3836C19.0474 17.7026 18.0129 18.7371 16.694 19.4871C15.4009 20.263 13.9397 20.6638 12.3103 20.6897C10.319 20.6638 8.58621 20.0819 7.11207 18.944C6.67241 18.5561 6.60776 18.1293 6.9181 17.6638C7.30603 17.2242 7.73276 17.1595 8.19828 17.4698C9.36207 18.3492 10.7328 18.8017 12.3103 18.8276C14.25 18.7759 15.8534 18.1035 17.1207 16.8104C18.4138 15.5431 19.0862 13.9397 19.1379 12C19.0862 10.0604 18.4138 8.45692 17.1207 7.18967C15.8534 5.89657 14.25 5.22416 12.3103 5.17243C11.25 5.17243 10.2672 5.39226 9.36207 5.83192C8.4569 6.27157 7.69397 6.8664 7.07328 7.6164V7.65519L5.98707 8.89657H9.51724C10.0862 8.9483 10.3966 9.25864 10.4483 9.82761C10.3966 10.3966 10.0862 10.7069 9.51724 10.7586H3.93103Z"
68
+ }
69
+ )
70
+ }
71
+ );
72
+ const rotateLeftOutlinedIconDefinition = (0, import_utils.svgToIconDefinition)(
73
+ rotateLeftOutlinedSvg,
74
+ "rotate-left-outlined"
75
+ );
76
+ const RefIcon = React.forwardRef((props, ref) => {
77
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TdmIcon.default, __spreadProps(__spreadValues({}, props), { ref, icon: rotateLeftOutlinedIconDefinition }));
78
+ });
79
+ if (process.env.NODE_ENV !== "production") {
80
+ RefIcon.displayName = "RotateLeftOutlinedIcon";
81
+ }
82
+ var RotateLeftOutlinedIcon_default = RefIcon;