@ichaingo/iconfont 1.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/.babelrc ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@nx/react/babel",
5
+ {
6
+ "runtime": "automatic",
7
+ "useBuiltIns": "usage"
8
+ }
9
+ ]
10
+ ],
11
+ "plugins": []
12
+ }
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # @ichaingo/iconfont
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Running unit tests
6
+
7
+ Run `nx test @ichaingo/iconfont` to execute the unit tests via [Vitest](https://vitest.dev/).
@@ -0,0 +1,8 @@
1
+ import { IconFontProps } from '@ant-design/icons/lib/components/IconFont';
2
+ export interface IProps extends IconFontProps {
3
+ lightType?: string;
4
+ darkType?: string;
5
+ }
6
+ declare const IconFont: (props: IProps) => import("react/jsx-runtime").JSX.Element;
7
+ export default IconFont;
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAO/E,MAAM,WAAW,MAAO,SAAQ,aAAa;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,QAAA,MAAM,QAAQ,GAAI,OAAO,MAAM,4CAa9B,CAAC;AACF,eAAe,QAAQ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,637 @@
1
+ import * as b from "react";
2
+ import { createContext as $e, useContext as je, useEffect as ne, version as Le, useState as Fe, createElement as ke } from "react";
3
+ var re = /* @__PURE__ */ $e({});
4
+ function x() {
5
+ return x = Object.assign ? Object.assign.bind() : function(e) {
6
+ for (var n = 1; n < arguments.length; n++) {
7
+ var r = arguments[n];
8
+ for (var t in r) ({}).hasOwnProperty.call(r, t) && (e[t] = r[t]);
9
+ }
10
+ return e;
11
+ }, x.apply(null, arguments);
12
+ }
13
+ function R(e) {
14
+ "@babel/helpers - typeof";
15
+ return R = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
16
+ return typeof n;
17
+ } : function(n) {
18
+ return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
19
+ }, R(e);
20
+ }
21
+ function De(e, n) {
22
+ if (R(e) != "object" || !e) return e;
23
+ var r = e[Symbol.toPrimitive];
24
+ if (r !== void 0) {
25
+ var t = r.call(e, n);
26
+ if (R(t) != "object") return t;
27
+ throw new TypeError("@@toPrimitive must return a primitive value.");
28
+ }
29
+ return (n === "string" ? String : Number)(e);
30
+ }
31
+ function Ye(e) {
32
+ var n = De(e, "string");
33
+ return R(n) == "symbol" ? n : n + "";
34
+ }
35
+ function L(e, n, r) {
36
+ return (n = Ye(n)) in e ? Object.defineProperty(e, n, {
37
+ value: r,
38
+ enumerable: !0,
39
+ configurable: !0,
40
+ writable: !0
41
+ }) : e[n] = r, e;
42
+ }
43
+ function Be(e, n) {
44
+ if (e == null) return {};
45
+ var r = {};
46
+ for (var t in e) if ({}.hasOwnProperty.call(e, t)) {
47
+ if (n.indexOf(t) !== -1) continue;
48
+ r[t] = e[t];
49
+ }
50
+ return r;
51
+ }
52
+ function te(e, n) {
53
+ if (e == null) return {};
54
+ var r, t, c = Be(e, n);
55
+ if (Object.getOwnPropertySymbols) {
56
+ var o = Object.getOwnPropertySymbols(e);
57
+ for (t = 0; t < o.length; t++) r = o[t], n.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (c[r] = e[r]);
58
+ }
59
+ return c;
60
+ }
61
+ function Ve(e) {
62
+ return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
63
+ }
64
+ var j = { exports: {} };
65
+ /*!
66
+ Copyright (c) 2018 Jed Watson.
67
+ Licensed under the MIT License (MIT), see
68
+ http://jedwatson.github.io/classnames
69
+ */
70
+ var H;
71
+ function qe() {
72
+ return H || (H = 1, (function(e) {
73
+ (function() {
74
+ var n = {}.hasOwnProperty;
75
+ function r() {
76
+ for (var o = "", a = 0; a < arguments.length; a++) {
77
+ var l = arguments[a];
78
+ l && (o = c(o, t(l)));
79
+ }
80
+ return o;
81
+ }
82
+ function t(o) {
83
+ if (typeof o == "string" || typeof o == "number")
84
+ return o;
85
+ if (typeof o != "object")
86
+ return "";
87
+ if (Array.isArray(o))
88
+ return r.apply(null, o);
89
+ if (o.toString !== Object.prototype.toString && !o.toString.toString().includes("[native code]"))
90
+ return o.toString();
91
+ var a = "";
92
+ for (var l in o)
93
+ n.call(o, l) && o[l] && (a = c(a, l));
94
+ return a;
95
+ }
96
+ function c(o, a) {
97
+ return a ? o ? o + " " + a : o + a : o;
98
+ }
99
+ e.exports ? (r.default = r, e.exports = r) : window.classNames = r;
100
+ })();
101
+ })(j)), j.exports;
102
+ }
103
+ var ze = qe();
104
+ const U = /* @__PURE__ */ Ve(ze);
105
+ function K(e, n) {
106
+ var r = Object.keys(e);
107
+ if (Object.getOwnPropertySymbols) {
108
+ var t = Object.getOwnPropertySymbols(e);
109
+ n && (t = t.filter(function(c) {
110
+ return Object.getOwnPropertyDescriptor(e, c).enumerable;
111
+ })), r.push.apply(r, t);
112
+ }
113
+ return r;
114
+ }
115
+ function A(e) {
116
+ for (var n = 1; n < arguments.length; n++) {
117
+ var r = arguments[n] != null ? arguments[n] : {};
118
+ n % 2 ? K(Object(r), !0).forEach(function(t) {
119
+ L(e, t, r[t]);
120
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : K(Object(r)).forEach(function(t) {
121
+ Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(r, t));
122
+ });
123
+ }
124
+ return e;
125
+ }
126
+ function We() {
127
+ return !!(typeof window < "u" && window.document && window.document.createElement);
128
+ }
129
+ function He(e, n) {
130
+ if (!e)
131
+ return !1;
132
+ if (e.contains)
133
+ return e.contains(n);
134
+ for (var r = n; r; ) {
135
+ if (r === e)
136
+ return !0;
137
+ r = r.parentNode;
138
+ }
139
+ return !1;
140
+ }
141
+ var Q = "data-rc-order", X = "data-rc-priority", Ue = "rc-util-key", F = /* @__PURE__ */ new Map();
142
+ function oe() {
143
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.mark;
144
+ return n ? n.startsWith("data-") ? n : "data-".concat(n) : Ue;
145
+ }
146
+ function D(e) {
147
+ if (e.attachTo)
148
+ return e.attachTo;
149
+ var n = document.querySelector("head");
150
+ return n || document.body;
151
+ }
152
+ function Ke(e) {
153
+ return e === "queue" ? "prependQueue" : e ? "prepend" : "append";
154
+ }
155
+ function Y(e) {
156
+ return Array.from((F.get(e) || e).children).filter(function(n) {
157
+ return n.tagName === "STYLE";
158
+ });
159
+ }
160
+ function ie(e) {
161
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
162
+ if (!We())
163
+ return null;
164
+ var r = n.csp, t = n.prepend, c = n.priority, o = c === void 0 ? 0 : c, a = Ke(t), l = a === "prependQueue", u = document.createElement("style");
165
+ u.setAttribute(Q, a), l && o && u.setAttribute(X, "".concat(o)), r != null && r.nonce && (u.nonce = r == null ? void 0 : r.nonce), u.innerHTML = e;
166
+ var f = D(n), v = f.firstChild;
167
+ if (t) {
168
+ if (l) {
169
+ var g = (n.styles || Y(f)).filter(function(h) {
170
+ if (!["prepend", "prependQueue"].includes(h.getAttribute(Q)))
171
+ return !1;
172
+ var p = Number(h.getAttribute(X) || 0);
173
+ return o >= p;
174
+ });
175
+ if (g.length)
176
+ return f.insertBefore(u, g[g.length - 1].nextSibling), u;
177
+ }
178
+ f.insertBefore(u, v);
179
+ } else
180
+ f.appendChild(u);
181
+ return u;
182
+ }
183
+ function Qe(e) {
184
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = D(n);
185
+ return (n.styles || Y(r)).find(function(t) {
186
+ return t.getAttribute(oe(n)) === e;
187
+ });
188
+ }
189
+ function Xe(e, n) {
190
+ var r = F.get(e);
191
+ if (!r || !He(document, r)) {
192
+ var t = ie("", n), c = t.parentNode;
193
+ F.set(e, c), e.removeChild(t);
194
+ }
195
+ }
196
+ function Ge(e, n) {
197
+ var r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, t = D(r), c = Y(t), o = A(A({}, r), {}, {
198
+ styles: c
199
+ });
200
+ Xe(t, o);
201
+ var a = Qe(n, o);
202
+ if (a) {
203
+ var l, u;
204
+ if ((l = o.csp) !== null && l !== void 0 && l.nonce && a.nonce !== ((u = o.csp) === null || u === void 0 ? void 0 : u.nonce)) {
205
+ var f;
206
+ a.nonce = (f = o.csp) === null || f === void 0 ? void 0 : f.nonce;
207
+ }
208
+ return a.innerHTML !== e && (a.innerHTML = e), a;
209
+ }
210
+ var v = ie(e, o);
211
+ return v.setAttribute(oe(o), n), v;
212
+ }
213
+ function ae(e) {
214
+ var n;
215
+ return e == null || (n = e.getRootNode) === null || n === void 0 ? void 0 : n.call(e);
216
+ }
217
+ function Je(e) {
218
+ return ae(e) instanceof ShadowRoot;
219
+ }
220
+ function Ze(e) {
221
+ return Je(e) ? ae(e) : null;
222
+ }
223
+ var k = {}, B = [], en = function(n) {
224
+ B.push(n);
225
+ };
226
+ function nn(e, n) {
227
+ if (process.env.NODE_ENV !== "production" && !e && console !== void 0) {
228
+ var r = B.reduce(function(t, c) {
229
+ return c(t ?? "", "warning");
230
+ }, n);
231
+ r && console.error("Warning: ".concat(r));
232
+ }
233
+ }
234
+ function rn(e, n) {
235
+ if (process.env.NODE_ENV !== "production" && !e && console !== void 0) {
236
+ var r = B.reduce(function(t, c) {
237
+ return c(t ?? "", "note");
238
+ }, n);
239
+ r && console.warn("Note: ".concat(r));
240
+ }
241
+ }
242
+ function tn() {
243
+ k = {};
244
+ }
245
+ function ce(e, n, r) {
246
+ !n && !k[r] && (e(!1, r), k[r] = !0);
247
+ }
248
+ function M(e, n) {
249
+ ce(nn, e, n);
250
+ }
251
+ function on(e, n) {
252
+ ce(rn, e, n);
253
+ }
254
+ M.preMessage = en;
255
+ M.resetWarned = tn;
256
+ M.noteOnce = on;
257
+ function G(e, n) {
258
+ M(e, "[@ant-design/icons] ".concat(n));
259
+ }
260
+ var an = {
261
+ width: "1em",
262
+ height: "1em",
263
+ fill: "currentColor",
264
+ "aria-hidden": "true",
265
+ focusable: "false"
266
+ }, cn = `
267
+ .anticon {
268
+ display: inline-flex;
269
+ align-items: center;
270
+ color: inherit;
271
+ font-style: normal;
272
+ line-height: 0;
273
+ text-align: center;
274
+ text-transform: none;
275
+ vertical-align: -0.125em;
276
+ text-rendering: optimizeLegibility;
277
+ -webkit-font-smoothing: antialiased;
278
+ -moz-osx-font-smoothing: grayscale;
279
+ }
280
+
281
+ .anticon > * {
282
+ line-height: 1;
283
+ }
284
+
285
+ .anticon svg {
286
+ display: inline-block;
287
+ }
288
+
289
+ .anticon::before {
290
+ display: none;
291
+ }
292
+
293
+ .anticon .anticon-icon {
294
+ display: block;
295
+ }
296
+
297
+ .anticon[tabindex] {
298
+ cursor: pointer;
299
+ }
300
+
301
+ .anticon-spin::before,
302
+ .anticon-spin {
303
+ display: inline-block;
304
+ -webkit-animation: loadingCircle 1s infinite linear;
305
+ animation: loadingCircle 1s infinite linear;
306
+ }
307
+
308
+ @-webkit-keyframes loadingCircle {
309
+ 100% {
310
+ -webkit-transform: rotate(360deg);
311
+ transform: rotate(360deg);
312
+ }
313
+ }
314
+
315
+ @keyframes loadingCircle {
316
+ 100% {
317
+ -webkit-transform: rotate(360deg);
318
+ transform: rotate(360deg);
319
+ }
320
+ }
321
+ `, sn = function(n) {
322
+ var r = je(re), t = r.csp, c = r.prefixCls, o = r.layer, a = cn;
323
+ c && (a = a.replace(/anticon/g, c)), o && (a = "@layer ".concat(o, ` {
324
+ `).concat(a, `
325
+ }`)), ne(function() {
326
+ var l = n.current, u = Ze(l);
327
+ Ge(a, "@ant-design-icons", {
328
+ prepend: !o,
329
+ csp: t,
330
+ attachTo: u
331
+ });
332
+ }, []);
333
+ }, O = { exports: {} }, d = {};
334
+ /**
335
+ * @license React
336
+ * react-is.production.min.js
337
+ *
338
+ * Copyright (c) Facebook, Inc. and its affiliates.
339
+ *
340
+ * This source code is licensed under the MIT license found in the
341
+ * LICENSE file in the root directory of this source tree.
342
+ */
343
+ var J;
344
+ function un() {
345
+ if (J) return d;
346
+ J = 1;
347
+ var e = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), t = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.server_context"), u = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), E;
348
+ E = Symbol.for("react.module.reference");
349
+ function y(i) {
350
+ if (typeof i == "object" && i !== null) {
351
+ var C = i.$$typeof;
352
+ switch (C) {
353
+ case e:
354
+ switch (i = i.type, i) {
355
+ case r:
356
+ case c:
357
+ case t:
358
+ case f:
359
+ case v:
360
+ return i;
361
+ default:
362
+ switch (i = i && i.$$typeof, i) {
363
+ case l:
364
+ case a:
365
+ case u:
366
+ case h:
367
+ case g:
368
+ case o:
369
+ return i;
370
+ default:
371
+ return C;
372
+ }
373
+ }
374
+ case n:
375
+ return C;
376
+ }
377
+ }
378
+ }
379
+ return d.ContextConsumer = a, d.ContextProvider = o, d.Element = e, d.ForwardRef = u, d.Fragment = r, d.Lazy = h, d.Memo = g, d.Portal = n, d.Profiler = c, d.StrictMode = t, d.Suspense = f, d.SuspenseList = v, d.isAsyncMode = function() {
380
+ return !1;
381
+ }, d.isConcurrentMode = function() {
382
+ return !1;
383
+ }, d.isContextConsumer = function(i) {
384
+ return y(i) === a;
385
+ }, d.isContextProvider = function(i) {
386
+ return y(i) === o;
387
+ }, d.isElement = function(i) {
388
+ return typeof i == "object" && i !== null && i.$$typeof === e;
389
+ }, d.isForwardRef = function(i) {
390
+ return y(i) === u;
391
+ }, d.isFragment = function(i) {
392
+ return y(i) === r;
393
+ }, d.isLazy = function(i) {
394
+ return y(i) === h;
395
+ }, d.isMemo = function(i) {
396
+ return y(i) === g;
397
+ }, d.isPortal = function(i) {
398
+ return y(i) === n;
399
+ }, d.isProfiler = function(i) {
400
+ return y(i) === c;
401
+ }, d.isStrictMode = function(i) {
402
+ return y(i) === t;
403
+ }, d.isSuspense = function(i) {
404
+ return y(i) === f;
405
+ }, d.isSuspenseList = function(i) {
406
+ return y(i) === v;
407
+ }, d.isValidElementType = function(i) {
408
+ return typeof i == "string" || typeof i == "function" || i === r || i === c || i === t || i === f || i === v || i === p || typeof i == "object" && i !== null && (i.$$typeof === h || i.$$typeof === g || i.$$typeof === o || i.$$typeof === a || i.$$typeof === u || i.$$typeof === E || i.getModuleId !== void 0);
409
+ }, d.typeOf = y, d;
410
+ }
411
+ var m = {};
412
+ /**
413
+ * @license React
414
+ * react-is.development.js
415
+ *
416
+ * Copyright (c) Facebook, Inc. and its affiliates.
417
+ *
418
+ * This source code is licensed under the MIT license found in the
419
+ * LICENSE file in the root directory of this source tree.
420
+ */
421
+ var Z;
422
+ function fn() {
423
+ return Z || (Z = 1, process.env.NODE_ENV !== "production" && (function() {
424
+ var e = Symbol.for("react.element"), n = Symbol.for("react.portal"), r = Symbol.for("react.fragment"), t = Symbol.for("react.strict_mode"), c = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), a = Symbol.for("react.context"), l = Symbol.for("react.server_context"), u = Symbol.for("react.forward_ref"), f = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), g = Symbol.for("react.memo"), h = Symbol.for("react.lazy"), p = Symbol.for("react.offscreen"), E = !1, y = !1, i = !1, C = !1, I = !1, T;
425
+ T = Symbol.for("react.module.reference");
426
+ function w(s) {
427
+ return !!(typeof s == "string" || typeof s == "function" || s === r || s === c || I || s === t || s === f || s === v || C || s === p || E || y || i || typeof s == "object" && s !== null && (s.$$typeof === h || s.$$typeof === g || s.$$typeof === o || s.$$typeof === a || s.$$typeof === u || // This needs to include all possible module reference object
428
+ // types supported by any Flight configuration anywhere since
429
+ // we don't know which Flight build this will end up being used
430
+ // with.
431
+ s.$$typeof === T || s.getModuleId !== void 0));
432
+ }
433
+ function S(s) {
434
+ if (typeof s == "object" && s !== null) {
435
+ var $ = s.$$typeof;
436
+ switch ($) {
437
+ case e:
438
+ var _ = s.type;
439
+ switch (_) {
440
+ case r:
441
+ case c:
442
+ case t:
443
+ case f:
444
+ case v:
445
+ return _;
446
+ default:
447
+ var W = _ && _.$$typeof;
448
+ switch (W) {
449
+ case l:
450
+ case a:
451
+ case u:
452
+ case h:
453
+ case g:
454
+ case o:
455
+ return W;
456
+ default:
457
+ return $;
458
+ }
459
+ }
460
+ case n:
461
+ return $;
462
+ }
463
+ }
464
+ }
465
+ var P = a, V = o, fe = e, le = u, de = r, me = h, ve = g, pe = n, ye = c, ge = t, be = f, he = v, q = !1, z = !1;
466
+ function Se(s) {
467
+ return q || (q = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.")), !1;
468
+ }
469
+ function Ee(s) {
470
+ return z || (z = !0, console.warn("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.")), !1;
471
+ }
472
+ function Ce(s) {
473
+ return S(s) === a;
474
+ }
475
+ function Re(s) {
476
+ return S(s) === o;
477
+ }
478
+ function we(s) {
479
+ return typeof s == "object" && s !== null && s.$$typeof === e;
480
+ }
481
+ function Pe(s) {
482
+ return S(s) === u;
483
+ }
484
+ function xe(s) {
485
+ return S(s) === r;
486
+ }
487
+ function Te(s) {
488
+ return S(s) === h;
489
+ }
490
+ function _e(s) {
491
+ return S(s) === g;
492
+ }
493
+ function Oe(s) {
494
+ return S(s) === n;
495
+ }
496
+ function Ae(s) {
497
+ return S(s) === c;
498
+ }
499
+ function Ne(s) {
500
+ return S(s) === t;
501
+ }
502
+ function Me(s) {
503
+ return S(s) === f;
504
+ }
505
+ function Ie(s) {
506
+ return S(s) === v;
507
+ }
508
+ m.ContextConsumer = P, m.ContextProvider = V, m.Element = fe, m.ForwardRef = le, m.Fragment = de, m.Lazy = me, m.Memo = ve, m.Portal = pe, m.Profiler = ye, m.StrictMode = ge, m.Suspense = be, m.SuspenseList = he, m.isAsyncMode = Se, m.isConcurrentMode = Ee, m.isContextConsumer = Ce, m.isContextProvider = Re, m.isElement = we, m.isForwardRef = Pe, m.isFragment = xe, m.isLazy = Te, m.isMemo = _e, m.isPortal = Oe, m.isProfiler = Ae, m.isStrictMode = Ne, m.isSuspense = Me, m.isSuspenseList = Ie, m.isValidElementType = w, m.typeOf = S;
509
+ })()), m;
510
+ }
511
+ var ee;
512
+ function ln() {
513
+ return ee || (ee = 1, process.env.NODE_ENV === "production" ? O.exports = un() : O.exports = fn()), O.exports;
514
+ }
515
+ ln();
516
+ function dn(e, n, r) {
517
+ var t = b.useRef({});
518
+ return (!("value" in t.current) || r(t.current.condition, n)) && (t.current.value = e(), t.current.condition = n), t.current.value;
519
+ }
520
+ Number(Le.split(".")[0]);
521
+ var mn = function(n, r) {
522
+ typeof n == "function" ? n(r) : R(n) === "object" && n && "current" in n && (n.current = r);
523
+ }, vn = function() {
524
+ for (var n = arguments.length, r = new Array(n), t = 0; t < n; t++)
525
+ r[t] = arguments[t];
526
+ var c = r.filter(Boolean);
527
+ return c.length <= 1 ? c[0] : function(o) {
528
+ r.forEach(function(a) {
529
+ mn(a, o);
530
+ });
531
+ };
532
+ }, pn = function() {
533
+ for (var n = arguments.length, r = new Array(n), t = 0; t < n; t++)
534
+ r[t] = arguments[t];
535
+ return dn(function() {
536
+ return vn.apply(void 0, r);
537
+ }, r, function(c, o) {
538
+ return c.length !== o.length || c.every(function(a, l) {
539
+ return a !== o[l];
540
+ });
541
+ });
542
+ }, yn = ["className", "component", "viewBox", "spin", "rotate", "tabIndex", "onClick", "children"], se = /* @__PURE__ */ b.forwardRef(function(e, n) {
543
+ var r = e.className, t = e.component, c = e.viewBox, o = e.spin, a = e.rotate, l = e.tabIndex, u = e.onClick, f = e.children, v = te(e, yn), g = b.useRef(), h = pn(g, n);
544
+ G(!!(t || f), "Should have `component` prop or `children`."), sn(g);
545
+ var p = b.useContext(re), E = p.prefixCls, y = E === void 0 ? "anticon" : E, i = p.rootClassName, C = U(i, y, L({}, "".concat(y, "-spin"), !!o && !!t), r), I = U(L({}, "".concat(y, "-spin"), !!o)), T = a ? {
546
+ msTransform: "rotate(".concat(a, "deg)"),
547
+ transform: "rotate(".concat(a, "deg)")
548
+ } : void 0, w = A(A({}, an), {}, {
549
+ className: I,
550
+ style: T,
551
+ viewBox: c
552
+ });
553
+ c || delete w.viewBox;
554
+ var S = function() {
555
+ return t ? /* @__PURE__ */ b.createElement(t, w, f) : f ? (G(!!c || b.Children.count(f) === 1 && /* @__PURE__ */ b.isValidElement(f) && b.Children.only(f).type === "use", "Make sure that you provide correct `viewBox` prop (default `0 0 1024 1024`) to the icon."), /* @__PURE__ */ b.createElement("svg", x({}, w, {
556
+ viewBox: c
557
+ }), f)) : null;
558
+ }, P = l;
559
+ return P === void 0 && u && (P = -1), /* @__PURE__ */ b.createElement("span", x({
560
+ role: "img"
561
+ }, v, {
562
+ ref: h,
563
+ tabIndex: P,
564
+ onClick: u,
565
+ className: C
566
+ }), S());
567
+ });
568
+ se.displayName = "AntdIcon";
569
+ var gn = ["type", "children"], ue = /* @__PURE__ */ new Set();
570
+ function bn(e) {
571
+ return !!(typeof e == "string" && e.length && !ue.has(e));
572
+ }
573
+ function N(e) {
574
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, r = e[n];
575
+ if (bn(r)) {
576
+ var t = document.createElement("script");
577
+ t.setAttribute("src", r), t.setAttribute("data-namespace", r), e.length > n + 1 && (t.onload = function() {
578
+ N(e, n + 1);
579
+ }, t.onerror = function() {
580
+ N(e, n + 1);
581
+ }), ue.add(r), document.body.appendChild(t);
582
+ }
583
+ }
584
+ function hn() {
585
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = e.scriptUrl, r = e.extraCommonProps, t = r === void 0 ? {} : r;
586
+ n && typeof document < "u" && typeof window < "u" && typeof document.createElement == "function" && (Array.isArray(n) ? N(n.reverse()) : N([n]));
587
+ var c = /* @__PURE__ */ b.forwardRef(function(o, a) {
588
+ var l = o.type, u = o.children, f = te(o, gn), v = null;
589
+ return o.type && (v = /* @__PURE__ */ b.createElement("use", {
590
+ xlinkHref: "#".concat(l)
591
+ })), u && (v = u), /* @__PURE__ */ b.createElement(se, x({}, t, f, {
592
+ ref: a
593
+ }), v);
594
+ });
595
+ return c.displayName = "Iconfont", c;
596
+ }
597
+ var Sn = (e, n, r, t, c, o, a, l) => {
598
+ let u = document.documentElement, f = ["light", "dark"];
599
+ function v(p) {
600
+ (Array.isArray(e) ? e : [e]).forEach((E) => {
601
+ let y = E === "class", i = y && o ? c.map((C) => o[C] || C) : c;
602
+ y ? (u.classList.remove(...i), u.classList.add(o && o[p] ? o[p] : p)) : u.setAttribute(E, p);
603
+ }), g(p);
604
+ }
605
+ function g(p) {
606
+ l && f.includes(p) && (u.style.colorScheme = p);
607
+ }
608
+ function h() {
609
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
610
+ }
611
+ if (t) v(t);
612
+ else try {
613
+ let p = localStorage.getItem(n) || r, E = a && p === "system" ? h() : p;
614
+ v(E);
615
+ } catch {
616
+ }
617
+ }, En = b.createContext(void 0), Cn = { setTheme: (e) => {
618
+ }, themes: [] }, Rn = () => {
619
+ var e;
620
+ return (e = b.useContext(En)) != null ? e : Cn;
621
+ };
622
+ b.memo(({ forcedTheme: e, storageKey: n, attribute: r, enableSystem: t, enableColorScheme: c, defaultTheme: o, value: a, themes: l, nonce: u, scriptProps: f }) => {
623
+ let v = JSON.stringify([r, n, o, e, l, a, t, c]).slice(1, -1);
624
+ return b.createElement("script", { ...f, suppressHydrationWarning: !0, nonce: typeof window > "u" ? u : "", dangerouslySetInnerHTML: { __html: `(${Sn.toString()})(${v})` } });
625
+ });
626
+ const wn = hn({
627
+ scriptUrl: "//cdn.ichaingo.com/common/iconfont/20250925/iconfont.js"
628
+ // 在 iconfont.cn 上生成
629
+ }), xn = (e) => {
630
+ const { type: n, lightType: r, darkType: t, ...c } = e, { resolvedTheme: o, theme: a } = Rn(), l = o || a, [u, f] = Fe(n);
631
+ return ne(() => {
632
+ f(l === "dark" ? t || n : r || n);
633
+ }, [l]), /* @__PURE__ */ ke(wn, { ...c, type: u, key: u });
634
+ };
635
+ export {
636
+ xn as default
637
+ };
@@ -0,0 +1,12 @@
1
+ import nx from '@nx/eslint-plugin';
2
+ import baseConfig from '../../eslint.config.mjs';
3
+
4
+ export default [
5
+ ...baseConfig,
6
+ ...nx.configs['flat/react'],
7
+ {
8
+ files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
9
+ // Override or add rules here
10
+ rules: {},
11
+ },
12
+ ];
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@ichaingo/iconfont",
3
+ "version": "1.1.0",
4
+ "type": "module",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ "./package.json": "./package.json",
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "default": "./dist/index.js"
14
+ }
15
+ },
16
+ "peerDependencies": {
17
+ "react": "^19.1.0",
18
+ "react-dom": "^19.1.0",
19
+ "tailwind-merge": "^2.5.5",
20
+ "next": "^15.1.6",
21
+ "next-themes": "^0.4.4",
22
+ "@ant-design/icons": "^5.5.2"
23
+ }
24
+ }
package/src/index.tsx ADDED
@@ -0,0 +1,29 @@
1
+ 'use client';
2
+
3
+ import { createFromIconfontCN } from '@ant-design/icons';
4
+ import type { IconFontProps } from '@ant-design/icons/lib/components/IconFont';
5
+ import { useTheme } from 'next-themes';
6
+ import { useEffect, useState } from 'react';
7
+
8
+ const Instance = createFromIconfontCN({
9
+ scriptUrl: '//cdn.ichaingo.com/common/iconfont/20250925/iconfont.js', // 在 iconfont.cn 上生成
10
+ });
11
+ export interface IProps extends IconFontProps {
12
+ lightType?: string; // 浅色主题下的图标类型
13
+ darkType?: string; // 深色主题下的图标类型
14
+ }
15
+ const IconFont = (props: IProps) => {
16
+ const { type, lightType, darkType, ...restProps } = props;
17
+ const { resolvedTheme, theme } = useTheme();
18
+ const currentTheme = resolvedTheme || theme;
19
+ const [finalType, setFinalType] = useState(type);
20
+ useEffect(() => {
21
+ if (currentTheme === 'dark') {
22
+ setFinalType(darkType || type);
23
+ } else {
24
+ setFinalType(lightType || type);
25
+ }
26
+ }, [currentTheme]);
27
+ return <Instance {...restProps} type={finalType} key={finalType} />;
28
+ };
29
+ export default IconFont;
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "files": [],
3
+ "include": [],
4
+ "references": [
5
+ {
6
+ "path": "./tsconfig.lib.json"
7
+ },
8
+ {
9
+ "path": "./tsconfig.spec.json"
10
+ }
11
+ ],
12
+ "extends": "../../tsconfig.base.json"
13
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "dist",
5
+ "types": [
6
+ "node",
7
+ "@nx/react/typings/cssmodule.d.ts",
8
+ "@nx/react/typings/image.d.ts",
9
+ "vite/client"
10
+ ],
11
+ "rootDir": "src",
12
+ "jsx": "react-jsx",
13
+ "module": "esnext",
14
+ "moduleResolution": "bundler",
15
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo"
16
+ },
17
+ "exclude": [
18
+ "out-tsc",
19
+ "dist",
20
+ "**/*.spec.ts",
21
+ "**/*.test.ts",
22
+ "**/*.spec.tsx",
23
+ "**/*.test.tsx",
24
+ "**/*.spec.js",
25
+ "**/*.test.js",
26
+ "**/*.spec.jsx",
27
+ "**/*.test.jsx",
28
+ "vite.config.ts",
29
+ "vite.config.mts",
30
+ "vitest.config.ts",
31
+ "vitest.config.mts",
32
+ "src/**/*.test.ts",
33
+ "src/**/*.spec.ts",
34
+ "src/**/*.test.tsx",
35
+ "src/**/*.spec.tsx",
36
+ "src/**/*.test.js",
37
+ "src/**/*.spec.js",
38
+ "src/**/*.test.jsx",
39
+ "src/**/*.spec.jsx",
40
+ "eslint.config.js",
41
+ "eslint.config.cjs",
42
+ "eslint.config.mjs"
43
+ ],
44
+ "include": ["src/**/*.js", "src/**/*.jsx", "src/**/*.ts", "src/**/*.tsx"]
45
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "outDir": "./out-tsc/vitest",
5
+ "types": [
6
+ "vitest/globals",
7
+ "vitest/importMeta",
8
+ "vite/client",
9
+ "node",
10
+ "vitest"
11
+ ],
12
+ "jsx": "react-jsx",
13
+ "module": "esnext",
14
+ "moduleResolution": "bundler"
15
+ },
16
+ "include": [
17
+ "vite.config.ts",
18
+ "vite.config.mts",
19
+ "vitest.config.ts",
20
+ "vitest.config.mts",
21
+ "src/**/*.test.ts",
22
+ "src/**/*.spec.ts",
23
+ "src/**/*.test.tsx",
24
+ "src/**/*.spec.tsx",
25
+ "src/**/*.test.js",
26
+ "src/**/*.spec.js",
27
+ "src/**/*.test.jsx",
28
+ "src/**/*.spec.jsx",
29
+ "src/**/*.d.ts"
30
+ ],
31
+ "references": [
32
+ {
33
+ "path": "./tsconfig.lib.json"
34
+ }
35
+ ]
36
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,56 @@
1
+ /// <reference types='vitest' />
2
+ import { defineConfig } from 'vite';
3
+ import react from '@vitejs/plugin-react';
4
+ import dts from 'vite-plugin-dts';
5
+ import * as path from 'path';
6
+
7
+ export default defineConfig(() => ({
8
+ root: __dirname,
9
+ cacheDir: '../../node_modules/.vite/packages/iconfont',
10
+ plugins: [
11
+ react(),
12
+ dts({
13
+ entryRoot: 'src',
14
+ tsconfigPath: path.join(__dirname, 'tsconfig.lib.json'),
15
+ }),
16
+ ],
17
+ // Uncomment this if you are using workers.
18
+ // worker: {
19
+ // plugins: [ nxViteTsPaths() ],
20
+ // },
21
+ // Configuration for building your library.
22
+ // See: https://vitejs.dev/guide/build.html#library-mode
23
+ build: {
24
+ outDir: './dist',
25
+ emptyOutDir: true,
26
+ reportCompressedSize: true,
27
+ commonjsOptions: {
28
+ transformMixedEsModules: true,
29
+ },
30
+ lib: {
31
+ // Could also be a dictionary or array of multiple entry points.
32
+ entry: 'src/index.tsx',
33
+ name: '@ichaingo/iconfont',
34
+ fileName: 'index',
35
+ // Change this to the formats you want to support.
36
+ // Don't forget to update your package.json as well.
37
+ formats: ['es' as const],
38
+ },
39
+ rollupOptions: {
40
+ // External packages that should not be bundled into your library.
41
+ external: ['react', 'react-dom', 'react/jsx-runtime'],
42
+ },
43
+ },
44
+ test: {
45
+ name: '@ichaingo/iconfont',
46
+ watch: false,
47
+ globals: true,
48
+ environment: 'jsdom',
49
+ include: ['{src,tests}/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
50
+ reporters: ['default'],
51
+ coverage: {
52
+ reportsDirectory: './test-output/vitest/coverage',
53
+ provider: 'v8' as const,
54
+ },
55
+ },
56
+ }));